aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/mysql.php
diff options
context:
space:
mode:
authorAriel T. Glenn <ariel@wikimedia.org>2021-02-08 20:42:39 +0200
committerAriel T. Glenn <ariel@wikimedia.org>2021-02-09 12:29:31 +0200
commitc9c2995a1aca4508561618338c70b84375fdaddf (patch)
tree0c5ed63229feb71d0495d7f2e0e17c07aa8777a8 /maintenance/mysql.php
parentc2d66ab8179dd33f17478f059ffa0ee01e4df4db (diff)
downloadmediawikicore-c9c2995a1aca4508561618338c70b84375fdaddf.tar.gz
mediawikicore-c9c2995a1aca4508561618338c70b84375fdaddf.zip
in deployment-prep some groups don't exist, permit scripts that use them to run
Example, there are dump scripts that use mysql.php with group=dump and these work fine in production where the groups are, but die in deployment-prep. Instead of dying, try to get any replica for the wiki and use that instead. Bug: T269377 Change-Id: I54e295175a8a78d886b9390c15a0cacd16d41a15
Diffstat (limited to 'maintenance/mysql.php')
-rw-r--r--maintenance/mysql.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/maintenance/mysql.php b/maintenance/mysql.php
index e73bd25c66f8..281356489dd7 100644
--- a/maintenance/mysql.php
+++ b/maintenance/mysql.php
@@ -86,6 +86,10 @@ class MysqlMaintenance extends Maintenance {
} else {
$group = $this->getOption( 'group', false );
$index = $lb->getReaderIndex( $group, $dbName );
+ if ( $index === false && $group ) {
+ // retry without the group; it may not exist
+ $index = $lb->getReaderIndex( false, $dbName );
+ }
if ( $index === false ) {
$this->error( "Error: unable to get reader index" );
exit( 1 );