Correct bin/storage analyze internal API for cluster environments
Summary: Ref T12819. This worked right in a non-cluster environment, but `bin/storage upgrade` iterates over each master in a partitioned cluster environment. Tweak the API so `bin/storage analyze` targets a single host but `bin/storage upgrade` can hit all the masters. Test Plan: Will run `bin/storage upgrade` in production again. Ran `upgrade` and `analyze` locally, still work fine. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12819 Differential Revision: https://secure.phabricator.com/D18576
This commit is contained in:
@@ -12,7 +12,8 @@ final class PhabricatorStorageManagementAnalyzeWorkflow
|
||||
}
|
||||
|
||||
public function didExecute(PhutilArgumentParser $args) {
|
||||
$this->analyzeTables();
|
||||
$api = $this->getSingleAPI();
|
||||
$this->analyzeTables($api);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ abstract class PhabricatorStorageManagementWorkflow
|
||||
if (!$this->dryRun) {
|
||||
$should_analyze = (($err == 0) || ($err == 2));
|
||||
if ($should_analyze) {
|
||||
$this->analyzeTables();
|
||||
$this->analyzeTables($api);
|
||||
}
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
@@ -1172,12 +1172,13 @@ abstract class PhabricatorStorageManagementWorkflow
|
||||
->lock();
|
||||
}
|
||||
|
||||
final protected function analyzeTables() {
|
||||
final protected function analyzeTables(
|
||||
PhabricatorStorageManagementAPI $api) {
|
||||
|
||||
// Analyzing tables can sometimes have a significant effect on query
|
||||
// performance, particularly for the fulltext ngrams tables. See T12819
|
||||
// for some specific examples.
|
||||
|
||||
$api = $this->getSingleAPI();
|
||||
$conn = $api->getConn(null);
|
||||
|
||||
$patches = $this->getPatches();
|
||||
|
||||
Reference in New Issue
Block a user