Page MenuHomePhabricator

D17774.diff
No OneTemporary

D17774.diff

diff --git a/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php b/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php
--- a/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php
+++ b/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php
@@ -559,8 +559,7 @@
return false;
}
- // TODO: For now, this is only supported for Git.
- if (!$repository->isGit()) {
+ if (!$repository->supportsSynchronization()) {
return false;
}
diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php
--- a/src/applications/repository/storage/PhabricatorRepository.php
+++ b/src/applications/repository/storage/PhabricatorRepository.php
@@ -1929,10 +1929,31 @@
'Cluster hosts must correctly route their intracluster requests.'));
}
+ if (count($results) > 1) {
+ if (!$this->supportsSynchronization()) {
+ throw new Exception(
+ pht(
+ 'Repository "%s" is bound to multiple active repository hosts, '.
+ 'but this repository does not support cluster synchronization. '.
+ 'Declusterize this repository or move it to a service with only '.
+ 'one host.',
+ $this->getDisplayName()));
+ }
+ }
+
shuffle($results);
return head($results);
}
+ public function supportsSynchronization() {
+ // TODO: For now, this is only supported for Git.
+ if (!$this->isGit()) {
+ return false;
+ }
+
+ return true;
+ }
+
public function getAlmanacServiceCacheKey() {
$service_phid = $this->getAlmanacServicePHID();
if (!$service_phid) {

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 23, 1:34 PM (1 w, 3 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7718528
Default Alt Text
D17774.diff (1 KB)

Event Timeline