r92767 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92766‎ | r92767 | r92768 >
Date:18:48, 21 July 2011
Author:kaldari
Status:ok
Tags:
Comment:
fix for concurrency problem with logging
Modified paths:
  • /trunk/extensions/CentralNotice/CentralNotice.db.php (modified) (history)
  • /trunk/extensions/CentralNotice/special/SpecialCentralNotice.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/special/SpecialCentralNotice.php
@@ -1277,7 +1277,8 @@
12781278 * Lookup the name of a campaign based on the campaign ID
12791279 */
12801280 public static function getNoticeName( $noticeId ) {
1281 - $dbr = wfGetDB( DB_SLAVE );
 1281+ // Read from the master database to avoid concurrency problems
 1282+ $dbr = wfGetDB( DB_MASTER );
12821283 if ( is_numeric( $noticeId ) ) {
12831284 $row = $dbr->selectRow( 'cn_notices', 'not_name', array( 'not_id' => $noticeId ) );
12841285 if ( $row ) {
Index: trunk/extensions/CentralNotice/CentralNotice.db.php
@@ -131,7 +131,8 @@
132132 static function getCampaignSettings( $campaignName, $detailed = true ) {
133133 global $wgCentralDBname;
134134
135 - $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname );
 135+ // Read from the master database to avoid concurrency problems
 136+ $dbr = wfGetDB( DB_MASTER, array(), $wgCentralDBname );
136137
137138 $campaign = array();
138139

Follow-up revisions

RevisionCommit summaryAuthorDate
r92768MFT r92767, switching db reads from slave -> master for concurrency issuesawjrichards18:50, 21 July 2011

Status & tagging log