From: Aaron Schulz Date: Sat, 3 Sep 2016 22:06:59 +0000 (-0700) Subject: Rename some variables in DatabaseMysqlBase X-Git-Tag: 1.31.0-rc.0~5762^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=74e3e082e0dc29e0678411fa1d2c726d69721d82;p=lhc%2Fweb%2Fwiklou.git Rename some variables in DatabaseMysqlBase Positions may be MariaDB GTIDs, which can even be kept in sync in master/master Galera setups. See https://mariadb.com/kb/en/mariadb/gtid/ Change-Id: I3dc80ae099d0849e57a7278d662317da362ff8fc --- diff --git a/includes/db/DatabaseMysqlBase.php b/includes/db/DatabaseMysqlBase.php index 3c383e3dd2..e813f801f1 100644 --- a/includes/db/DatabaseMysqlBase.php +++ b/includes/db/DatabaseMysqlBase.php @@ -31,7 +31,7 @@ */ abstract class DatabaseMysqlBase extends Database { /** @var MysqlMasterPos */ - protected $lastKnownSlavePos; + protected $lastKnownReplicaPos; /** @var string Method to detect replica DB lag */ protected $lagDetectionMethod; /** @var array Method to detect replica DB lag */ @@ -771,7 +771,7 @@ abstract class DatabaseMysqlBase extends Database { if ( $this->getLBInfo( 'is static' ) === true ) { return 0; // this is a copy of a read-only dataset with no master DB - } elseif ( $this->lastKnownSlavePos && $this->lastKnownSlavePos->hasReached( $pos ) ) { + } elseif ( $this->lastKnownReplicaPos && $this->lastKnownReplicaPos->hasReached( $pos ) ) { return 0; // already reached this point for sure } @@ -799,14 +799,14 @@ abstract class DatabaseMysqlBase extends Database { // with an old master hostname. Such calls make MASTER_POS_WAIT() return null. Try // to detect this and treat the replica DB as having reached the position; a proper master // switchover already requires that the new master be caught up before the switch. - $slavePos = $this->getSlavePos(); - if ( $slavePos && !$slavePos->channelsMatch( $pos ) ) { - $this->lastKnownSlavePos = $slavePos; + $replicationPos = $this->getSlavePos(); + if ( $replicationPos && !$replicationPos->channelsMatch( $pos ) ) { + $this->lastKnownReplicaPos = $replicationPos; $status = 0; } } elseif ( $status >= 0 ) { // Remember that this position was reached to save queries next time - $this->lastKnownSlavePos = $pos; + $this->lastKnownReplicaPos = $pos; } return $status;