Merge "MessageCache: Avoid 'contributions' replicas"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 9 May 2017 02:32:38 +0000 (02:32 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 9 May 2017 02:32:39 +0000 (02:32 +0000)
includes/cache/MessageCache.php

index c992112..8f88ee9 100644 (file)
@@ -464,7 +464,11 @@ class MessageCache {
        protected function loadFromDB( $code, $mode = null ) {
                global $wgMaxMsgCacheEntrySize, $wgLanguageCode, $wgAdaptiveMessageCache;
 
-               $dbr = wfGetDB( ( $mode == self::FOR_UPDATE ) ? DB_MASTER : DB_REPLICA );
+               // (T164666) The query here performs really poorly on WMF's
+               // contributions replicas. We don't have a way to say "any group except
+               // contributions", so for the moment let's specify 'api'.
+               // @todo: Get rid of this hack.
+               $dbr = wfGetDB( ( $mode == self::FOR_UPDATE ) ? DB_MASTER : DB_REPLICA, 'api' );
 
                $cache = [];