r56820 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56819‎ | r56820 | r56821 >
Date:15:09, 23 September 2009
Author:catrope
Status:ok
Tags:
Comment:
LocalisationUpdate: Query the master when verifying whether the l10ncache needs rebuilding. I'm pretty sure that the file cache being faster than replication caused LU to recache constantly when it was deployed yesterday, causing the large increase in CPU usage. Also query the master on recaching, so we don't recache with stale data.
Modified paths:
  • /trunk/extensions/LocalisationUpdate/LocalisationUpdate.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LocalisationUpdate/LocalisationUpdate.class.php
@@ -32,7 +32,7 @@
3333
3434 // MW 1.16+
3535 public static function onRecache( $lc, $langcode, &$cache ) {
36 - $dbr = wfGetDB ( DB_SLAVE );
 36+ $dbr = wfGetDB ( DB_MASTER );
3737
3838 // Get the messages from the database
3939 $res = $dbr->select( self::table( 'localisation' ),
@@ -568,7 +568,7 @@
569569 }
570570
571571 function getTimestamp() {
572 - $dbr = wfGetDB( DB_SLAVE );
 572+ $dbr = wfGetDB( DB_MASTER );
573573 return $dbr->selectField(
574574 LocalisationUpdate::table( 'localisation_file_hash' ),
575575 'MAX(lfh_timestamp)',

Status & tagging log