@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 two setup issues arising from partitioning support

Summary:
Ref T11044.

- Use shorter lock names. Fixes T11916.
- These granular exceptions now always raise as a more generic "Cluster" exception, even for a single host, because there's less special code around running just one database.

Test Plan:
- Configured bad `mysql.port`, ran `bin/storage upgrade`, got a more helpful error message.
- Ran `bin/storage upgrade --trace`, saw shorter lock names.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11044, T11916

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

+6 -6
+3 -5
src/infrastructure/env/PhabricatorEnv.php
··· 252 252 // If the database is not available, just skip this configuration 253 253 // source. This happens during `bin/storage upgrade`, `bin/conf` before 254 254 // schema setup, etc. 255 - } catch (AphrontConnectionQueryException $ex) { 256 - if (!$config_optional) { 257 - throw $ex; 258 - } 259 - } catch (AphrontInvalidCredentialsQueryException $ex) { 255 + } catch (PhabricatorClusterStrandedException $ex) { 256 + // This means we can't connect to any database host. That's fine as 257 + // long as we're running a setup script like `bin/storage`. 260 258 if (!$config_optional) { 261 259 throw $ex; 262 260 }
+3 -1
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
··· 1141 1141 // Although we're holding this lock on different databases so it could 1142 1142 // have the same name on each as far as the database is concerned, the 1143 1143 // locks would be the same within this process. 1144 - $lock_name = 'adjust/'.$api->getRef()->getRefKey(); 1144 + $ref_key = $api->getRef()->getRefKey(); 1145 + $ref_hash = PhabricatorHash::digestForIndex($ref_key); 1146 + $lock_name = 'adjust('.$ref_hash.')'; 1145 1147 1146 1148 return PhabricatorGlobalLock::newLock($lock_name) 1147 1149 ->useSpecificConnection($api->getConn(null))