@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix a couple of partition migration bugs

Summary:
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.

Test Plan:
- Poked this locally, but will initialize `secure004` as an empty master to be sure.

Reviewers: chad, avivey

Reviewed By: avivey

Maniphest Tasks: T11044

Differential Revision: https://secure.phabricator.com/D16916

+17 -2
+2 -1
src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php
··· 175 175 pht( 176 176 'Failed to acquire read lock after waiting %s second(s). You '. 177 177 'may be able to retry later.', 178 - new PhutilNumber($lock_wait))); 178 + new PhutilNumber($lock_wait)), 179 + $ex); 179 180 } 180 181 181 182 $versions = PhabricatorRepositoryWorkingCopyVersion::loadVersions(
+15 -1
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
··· 826 826 827 827 $locks = array(); 828 828 foreach ($apis as $api) { 829 - $ref_key = $api->getRef()->getRefKey(); 830 829 $locks[] = $this->lock($api); 831 830 } 832 831 ··· 981 980 // up to date one at a time we can end up in a big mess. 982 981 983 982 $duration_map = array(); 983 + 984 + // First, find any global patches which have been applied to ANY database. 985 + // We are just going to mark these as applied without actually running 986 + // them. Otherwise, adding new empty masters to an existing cluster will 987 + // try to apply them against invalid states. 988 + foreach ($patches as $key => $patch) { 989 + if ($patch->getIsGlobalPatch()) { 990 + foreach ($applied_map as $ref_key => $applied) { 991 + if (isset($applied[$key])) { 992 + $duration_map[$key] = 1; 993 + } 994 + } 995 + } 996 + } 997 + 984 998 while (true) { 985 999 $applied_something = false; 986 1000 foreach ($patches as $key => $patch) {