Anomie has uploaded a new change for review.

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


Change subject: l10nupdate: Use refreshMessageBlobs.php instead of 
clearMessageBlobs.php
......................................................................

l10nupdate: Use refreshMessageBlobs.php instead of clearMessageBlobs.php

The clearMessageBlobs.php script is a bit too heavy-handed: it
obliterates the entire ResourceLoader message caches for all wikis,
which can lead to a database stampede as user requests try to repopulate
the cache all at once.

refreshMessageBlobs.php takes a more nuanced approach: It iterates over
all the cache entries and updates only those where the message cdb has
changed. And it does this one resource at a time, rather than having
every client connection try to do it in parallel.

The downside is that this is a good bit slower.

Note this requires I3b6ae128 be deployed to all active versions.

Bug: 27320
Change-Id: Ic633a7fde8d4a1d9e9326aa5ae52bf1227e8d30f
---
M files/misc/l10nupdate/l10nupdate-1
1 file changed, 13 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/11/58911/1

diff --git a/files/misc/l10nupdate/l10nupdate-1 
b/files/misc/l10nupdate/l10nupdate-1
index 22a8d2d..4f1d845 100755
--- a/files/misc/l10nupdate/l10nupdate-1
+++ b/files/misc/l10nupdate/l10nupdate-1
@@ -1,7 +1,10 @@
 #!/bin/bash
 # This script belongs in /usr/local/bin/.
+. /usr/local/lib/mw-deployment-vars.sh
+. $MW_COMMON_SOURCE/multiversion/MWRealm.sh
+
 BINDIR=/usr/local/bin
-MWMULTIDIR=/home/wikipedia/common/multiversion
+MWMULTIDIR=$MW_COMMON_SOURCE/multiversion
 GITDIR=/var/lib/l10nupdate/mediawiki
 GITURL=https://gerrit.wikimedia.org/r/p/mediawiki
 GITREPOS="core extensions"
@@ -76,10 +79,6 @@
                cp --preserve=timestamps --force 
/var/lib/l10nupdate/cache-"$mwVerNum"/l10n_cache-* 
/home/wikipedia/common/php-"$mwVerNum"/cache/l10n
                echo "Syncing to Apaches"
                $BINDIR/sync-l10nupdate-1 "$mwVerNum"
-               # clearMessageBlobs.php sometimes causes some sort of database 
stampede
-               # that brings the site down. Disable it for now.
-               #echo "Clearing message blobs"
-               #/usr/local/bin/mwscript 
extensions/WikimediaMaintenance/clearMessageBlobs.php --wiki="$mwDbName"
                $BINDIR/dologmsg "!log LocalisationUpdate completed ($mwVerNum) 
at `date`"
                echo "All done"
        else
@@ -87,3 +86,12 @@
                echo "FAILED"
        fi
 done
+
+# Clear the ResourceLoader cached messages
+echo "Refreshing ResourceLoader caches"
+ALLDB=`getRealmSpecificFilename "$MW_COMMON_SOURCE/all.dblist"`
+for wiki in `<"$ALLDB"`; do
+       /usr/local/bin/mwscript 
extensions/WikimediaMaintenance/refreshMessageBlobs.php --wiki="$wiki"
+done
+echo "All done"
+$BINDIR/dologmsg "!log LocalisationUpdate ResourceLoader cache refresh 
completed at `date`"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic633a7fde8d4a1d9e9326aa5ae52bf1227e8d30f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Anomie <bjor...@wikimedia.org>

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

Reply via email to