Ref T11044. Few issues here:
- The PhutilProxyException is missing an argument (hit this while in read-only mode).
- The $ref_key is unused.
- When you add a new master to an existing cluster, we can incorrectly apply .php patches which we should not reapply. Instead, mark them as already-applied.