jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/352624 )

Change subject: MessageCache: Avoid 'contributions' replicas
......................................................................


MessageCache: Avoid 'contributions' replicas

On WMF wikis, the partitioning of the revision table on the
'contributions' replicas makes the query here perform really poorly.
Specify 'api' as a hack for now to avoid those replicas.

This query happens once per day per wiki, plus when someone edits the
MediaWiki namespace, so it shouldn't be much additional load.

Bug: T164666
Change-Id: I5ae74d1702144f6475e9cfb13effc43389d66233
---
M includes/cache/MessageCache.php
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified
  Jcrespo: Looks good to me, but someone else must approve



diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php
index c992112..8f88ee9 100644
--- a/includes/cache/MessageCache.php
+++ b/includes/cache/MessageCache.php
@@ -464,7 +464,11 @@
        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 = [];
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5ae74d1702144f6475e9cfb13effc43389d66233
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Jcrespo <jcre...@wikimedia.org>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to