Tim Starling has uploaded a new change for review.

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


Change subject: Exclude servers with zero load from lag checks
......................................................................

Exclude servers with zero load from lag checks

Since r13582, servers with zero load have been isolated from the rest of
the servers in the section in terms of query flow. However, lag checks
still remained. This is not appropriate for backup/QueryPage servers
that are routinely lagged. IIRC we dealt with this once before with a
special case in the core excluding benet from master pos waits, but that
doesn't seem like a very appropriate solution today. Perhaps there is an
application for including zero-load slaves in lag checks, but I can't
think of any right now.

Related WMF conf change in I8fac5c99.

Change-Id: Id354039123f8c04febc8090eea9940fff044c5ea
---
M includes/DefaultSettings.php
M includes/db/LoadBalancer.php
2 files changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/67/95967/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index d428910..4247d1c 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -1608,7 +1608,12 @@
  *   - user:        DB user
  *   - password:    DB password
  *   - type:        "mysql" or "postgres"
- *   - load:        ratio of DB_SLAVE load, must be >=0, the sum of all loads 
must be >0
+ *
+ *   - load:        Ratio of DB_SLAVE load, must be >=0, the sum of all loads 
must be >0.
+ *                  If this is zero for any given server, no normal query 
traffic will be
+ *                  sent to it. It will be excluded from lag checks in 
maintenance scripts.
+ *                  The only way it can receive traffic is if groupLoads is 
used.
+ *
  *   - groupLoads:  array of load ratios, the key is the query group name. A 
query may belong
  *                  to several groups, the most specific group defined here is 
used.
  *
diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php
index 857109d..011c083 100644
--- a/includes/db/LoadBalancer.php
+++ b/includes/db/LoadBalancer.php
@@ -373,7 +373,9 @@
                wfProfileIn( __METHOD__ );
                $this->mWaitForPos = $pos;
                for ( $i = 1; $i < count( $this->mServers ); $i++ ) {
-                       $this->doWait( $i, true );
+                       if ( $this->mLoads[$i] > 0 ) {
+                               $this->doWait( $i, true );
+                       }
                }
                wfProfileOut( __METHOD__ );
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id354039123f8c04febc8090eea9940fff044c5ea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Tim Starling <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to