r32955 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32954‎ | r32955 | r32956 >
Date:11:54, 8 April 2008
Author:tstarling
Status:old
Tags:
Comment:
Don't use query groups for master connections
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuthUser.php (modified) (history)
  • /trunk/phase3/includes/LoadBalancer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LoadBalancer.php
@@ -364,7 +364,9 @@
365365 }
366366
367367 # Query groups
368 - if ( !is_array( $groups ) ) {
 368+ if ( $i == DB_MASTER ) {
 369+ $i = $this->getWriterIndex();
 370+ } elseif ( !is_array( $groups ) ) {
369371 $groupIndex = $this->getReaderIndex( $groups, $wiki );
370372 if ( $groupIndex !== false ) {
371373 $serverName = $this->getServerName( $groupIndex );
@@ -386,8 +388,6 @@
387389 # Operation-based index
388390 if ( $i == DB_SLAVE ) {
389391 $i = $this->getReaderIndex( false, $wiki );
390 - } elseif ( $i == DB_MASTER ) {
391 - $i = $this->getWriterIndex();
392392 } elseif ( $i == DB_LAST ) {
393393 # Just use $this->mLastIndex, which should already be set
394394 $i = $this->mLastIndex;
Index: trunk/extensions/CentralAuth/CentralAuthUser.php
@@ -24,7 +24,7 @@
2525 }
2626
2727 public static function getCentralDB() {
28 - return wfGetLB( 'centralauth' )->getConnection( DB_MASTER, 'centralauth', 'centralauth' );
 28+ return wfGetLB( 'centralauth' )->getConnection( DB_MASTER, array(), 'centralauth' );
2929 }
3030
3131 public static function getCentralSlaveDB() {

Status & tagging log