1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

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:
epriestley 2016-09-05 10:34:34 -07:00
parent c38bc3988d
commit 4dc37bcee0
2 changed files with 9 additions and 1 deletions

View file

@ -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) {

View file

@ -104,7 +104,7 @@ final class DiffusionRepositoryClusterEngine extends Phobject {
// We identify all the cluster leaders and reset their version to 0.
// We identify all the cluster followers and demote them.
// This allows the cluter to start over again at version 0 but keep the
// This allows the cluster to start over again at version 0 but keep the
// same leaders.
if ($versions) {