@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.

Detect unsynchronizable repositories on multiple cluster hosts

Summary:
Ref T12613. Currently, the SVNTEST and HGTEST repositories are improperly configured on `secure`. These repositories use VCS systems which do not support synchronization, so they can not be served from cluster services with multiple hosts.

However, I've incorrectly configured them the same way as all the Git repositories, which support synchronization. This causes about 50% of requests to randomly fail (when they reach the wrong host).

Detect this issue and warn the user that the configuration is not valid.

It should be exceptionally difficult for normal installs to run into this.

Test Plan:
- Mostly faked these conditions locally, verified that `secure` really has this configuration.
- I'll push this, verify that the issue is detected correctly in production, then fix the config which should resolve the intermittent issues with SVNTEST.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12613

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

+22 -2
+1 -2
src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php
··· 559 559 return false; 560 560 } 561 561 562 - // TODO: For now, this is only supported for Git. 563 - if (!$repository->isGit()) { 562 + if (!$repository->supportsSynchronization()) { 564 563 return false; 565 564 } 566 565
+21
src/applications/repository/storage/PhabricatorRepository.php
··· 1929 1929 'Cluster hosts must correctly route their intracluster requests.')); 1930 1930 } 1931 1931 1932 + if (count($results) > 1) { 1933 + if (!$this->supportsSynchronization()) { 1934 + throw new Exception( 1935 + pht( 1936 + 'Repository "%s" is bound to multiple active repository hosts, '. 1937 + 'but this repository does not support cluster synchronization. '. 1938 + 'Declusterize this repository or move it to a service with only '. 1939 + 'one host.', 1940 + $this->getDisplayName())); 1941 + } 1942 + } 1943 + 1932 1944 shuffle($results); 1933 1945 return head($results); 1946 + } 1947 + 1948 + public function supportsSynchronization() { 1949 + // TODO: For now, this is only supported for Git. 1950 + if (!$this->isGit()) { 1951 + return false; 1952 + } 1953 + 1954 + return true; 1934 1955 } 1935 1956 1936 1957 public function getAlmanacServiceCacheKey() {