Differential D19174 Diff 45930 src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
| Show First 20 Lines • Show All 1,157 Lines • ▼ Show 20 Lines | |||||
| * Acquires a @{class:PhabricatorGlobalLock}. | * Acquires a @{class:PhabricatorGlobalLock}. | ||||
| * | * | ||||
| * @return PhabricatorGlobalLock | * @return PhabricatorGlobalLock | ||||
| */ | */ | ||||
| final protected function lock(PhabricatorStorageManagementAPI $api) { | final protected function lock(PhabricatorStorageManagementAPI $api) { | ||||
| // Although we're holding this lock on different databases so it could | // Although we're holding this lock on different databases so it could | ||||
| // have the same name on each as far as the database is concerned, the | // have the same name on each as far as the database is concerned, the | ||||
| // locks would be the same within this process. | // locks would be the same within this process. | ||||
| $ref_key = $api->getRef()->getRefKey(); | $parameters = array( | ||||
| $ref_hash = PhabricatorHash::digestForIndex($ref_key); | 'refKey' => $api->getRef()->getRefKey(), | ||||
| $lock_name = 'adjust('.$ref_hash.')'; | ); | ||||
| // We disable logging for this lock because we may not have created the | |||||
| // log table yet, or may need to adjust it. | |||||
| return PhabricatorGlobalLock::newLock($lock_name) | return PhabricatorGlobalLock::newLock('adjust', $parameters) | ||||
| ->useSpecificConnection($api->getConn(null)) | ->useSpecificConnection($api->getConn(null)) | ||||
| ->setDisableLogging(true) | |||||
| ->lock(); | ->lock(); | ||||
| } | } | ||||
| final protected function analyzeTables( | final protected function analyzeTables( | ||||
| PhabricatorStorageManagementAPI $api) { | PhabricatorStorageManagementAPI $api) { | ||||
| // Analyzing tables can sometimes have a significant effect on query | // Analyzing tables can sometimes have a significant effect on query | ||||
| // performance, particularly for the fulltext ngrams tables. See T12819 | // performance, particularly for the fulltext ngrams tables. See T12819 | ||||
| ▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines | |||||