r83558 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83557‎ | r83558 | r83559 >
Date:00:24, 9 March 2011
Author:catrope
Status:resolved (Comments)
Tags:
Comment:
Merge r83555 from 1.17wmf1: fix wait for slaves code from r83529
Modified paths:
  • /trunk/phase3/includes/db/LoadBalancer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/LoadBalancer.php
@@ -346,7 +346,7 @@
347347 wfProfileIn( __METHOD__ );
348348 $this->mWaitForPos = $pos;
349349 for ( $i = 1; $i < count( $this->mServers ); $i++ ) {
350 - $this->doWait( $i );
 350+ $this->doWait( $i , true );
351351 }
352352 wfProfileOut( __METHOD__ );
353353 }
@@ -367,12 +367,20 @@
368368 /**
369369 * Wait for a given slave to catch up to the master pos stored in $this
370370 */
371 - function doWait( $index ) {
 371+ function doWait( $index, $open ) {
372372 # Find a connection to wait on
373373 $conn = $this->getAnyOpenConnection( $index );
374374 if ( !$conn ) {
375 - wfDebug( __METHOD__ . ": no connection open\n" );
376 - return false;
 375+ if ( !$open ) {
 376+ wfDebug( __METHOD__ . ": no connection open\n" );
 377+ return false;
 378+ } else {
 379+ $conn = $this->openConnection( $index );
 380+ if ( !$conn ) {
 381+ wfDebug( __METHOD__ . ": failed to open connection\n" );
 382+ return false;
 383+ }
 384+ }
377385 }
378386
379387 wfDebug( __METHOD__.": Waiting for slave #$index to catch up...\n" );
Property changes on: trunk/phase3/includes/db/LoadBalancer.php
___________________________________________________________________
Added: svn:mergeinfo
380388 Merged /branches/new-installer/phase3/includes/db/LoadBalancer.php:r43664-66004
381389 Merged /branches/wmf-deployment/includes/db/LoadBalancer.php:r53381
382390 Merged /branches/wmf/1.17wmf1/includes/db/LoadBalancer.php:r83555
383391 Merged /branches/REL1_15/phase3/includes/db/LoadBalancer.php:r51646
384392 Merged /branches/sqlite/includes/db/LoadBalancer.php:r58211-58321

Follow-up revisions

RevisionCommit summaryAuthorDate
r83590Followup r83558, r83555...reedy16:37, 9 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r83529Make updateCollation.php a bit less murderous for WMF databases:...catrope16:47, 8 March 2011
r835551.17wmf1: Live hack to fix wait for slaves logic. Will merge to trunkcatrope00:21, 9 March 2011

Comments

#Comment by Reedy (talk | contribs)   16:34, 9 March 2011

You've left at least 2 callers (lines 300, and 334) a parameter short

Which I guess is still existent in r83555

Status & tagging log