Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311938

Change subject: Make LBFactory::waitForReplication() use "domain" instead of 
"wiki"
......................................................................

Make LBFactory::waitForReplication() use "domain" instead of "wiki"

Change-Id: Id7e55fddb96631b3938ee6ddcfcc3ce13ba942d4
---
M includes/libs/rdbms/lbfactory/LBFactory.php
1 file changed, 9 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/38/311938/1

diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php 
b/includes/libs/rdbms/lbfactory/LBFactory.php
index cf9a298..67d4d4b 100644
--- a/includes/libs/rdbms/lbfactory/LBFactory.php
+++ b/includes/libs/rdbms/lbfactory/LBFactory.php
@@ -410,14 +410,14 @@
         * This makes sense when lag being waiting on is caused by the code 
that does this check.
         * In that case, setting "ifWritesSince" can avoid the overhead of 
waiting for clusters
         * that were not changed since the last wait check. To forcefully wait 
on a specific cluster
-        * for a given wiki, use the 'wiki' parameter. To forcefully wait on an 
"external" cluster,
+        * for a given domain, use the 'domain' parameter. To forcefully wait 
on an "external" cluster,
         * use the "cluster" parameter.
         *
         * Never call this function after a large DB write that is *still* in a 
transaction.
         * It only makes sense to call this after the possible lag inducing 
changes were committed.
         *
         * @param array $opts Optional fields that include:
-        *   - wiki : wait on the load balancer DBs that handles the given wiki
+        *   - domain : wait on the load balancer DBs that handles the given 
domain ID
         *   - cluster : wait on the given external load balancer DBs
         *   - timeout : Max wait time. Default: ~60 seconds
         *   - ifWritesSince: Only wait if writes were done since this UNIX 
timestamp
@@ -426,19 +426,23 @@
         */
        public function waitForReplication( array $opts = [] ) {
                $opts += [
-                       'wiki' => false,
+                       'domain' => false,
                        'cluster' => false,
                        'timeout' => 60,
                        'ifWritesSince' => null
                ];
+
+               if ( !$opts['domain'] && isset( $opts['wiki'] ) ) {
+                       $opts['domain'] = $opts['wiki']; // b/c
+               }
 
                // Figure out which clusters need to be checked
                /** @var ILoadBalancer[] $lbs */
                $lbs = [];
                if ( $opts['cluster'] !== false ) {
                        $lbs[] = $this->getExternalLB( $opts['cluster'] );
-               } elseif ( $opts['wiki'] !== false ) {
-                       $lbs[] = $this->getMainLB( $opts['wiki'] );
+               } elseif ( $opts['domain'] !== false ) {
+                       $lbs[] = $this->getMainLB( $opts['domain'] );
                } else {
                        $this->forEachLB( function ( ILoadBalancer $lb ) use ( 
&$lbs ) {
                                $lbs[] = $lb;

-- 
To view, visit https://gerrit.wikimedia.org/r/311938
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7e55fddb96631b3938ee6ddcfcc3ce13ba942d4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to