Ignore repository versions on inactive devices in "Repository Servers" panel in Config
Summary:
Fixes T11590. Currently, we incorrectly consider cluster repository versions that are (or were) on devices which are no longer part of the active cluster service when building this status screen.
Instead, ignore them. This is just a display bug; the actual `ClusterEngine` already had similar logic.
Test Plan:
- Added a bad leader record to `repository_workingcopyversion`.
- Before patch, got a bad "Partial (1w)" sync:
{F1802292}
- After patch, got a good "Sycnchronized":
{F1802293}
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T11590
Differential Revision: https://secure.phabricator.com/D16492
This commit is contained in:
@@ -153,6 +153,14 @@ final class PhabricatorConfigClusterRepositoriesController
|
||||
|
||||
$versions = idx($repository_versions, $repository_phid, array());
|
||||
|
||||
// Filter out any versions for devices which are no longer active.
|
||||
foreach ($versions as $key => $version) {
|
||||
$version_device_phid = $version->getDevicePHID();
|
||||
if (empty($active_devices[$version_device_phid])) {
|
||||
unset($versions[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$leaders = 0;
|
||||
foreach ($versions as $version) {
|
||||
if ($version->getRepositoryVersion() == $leader_version) {
|
||||
|
||||
Reference in New Issue
Block a user