Page MenuHomePhabricator

"bin/storage adjust" runs "bin/cache purge --purge-all" with mainline credentials
Closed, ResolvedPublic

Description

bin/storage adjust (possibly via bin/storage upgrade) runs bin/cache purge --purge-all in a subprocess if it applies adjustments. This subprocess does not inherit any --user, etc., flags from the parent, but requires DROP permission, which the web user may reasonably not have.

It also probably does not inherit --namespace, which could cause an unrelated cache purge.

  • Ideally, we should use the provided user -- either:
    • Make bin/cache purge accept MySQL credentials, and make bin/storage pass them (and also --namespace).
    • Put the actual cache purge code somewhere shared and have them both call it, using the constructed API from the storage workflows (probably easier, less messy, and less error-prone).
  • A quick bandaid would be to warn and continue with storage adjust if cache purge fails. This step is not critical, and only improves the performance of storage adjust.

Event Timeline

epriestley raised the priority of this task from to Low.
epriestley updated the task description. (Show Details)
epriestley added a project: Setup.
epriestley added subscribers: epriestley, chasemp.

Another approach would be to either remove this step from storage adjust, or let tables be marked as truncatable: over time, the value of this step will drop significantly, since it's only relevant for installs with a lot of data that are pushing through T1191 for the first time.

Beyond the complexity above, this also destorys the cache generated by bin/auth cache-pkcs8, which is a pain.