Rename getSlavePos() => getReplicaPos()
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 24 Sep 2016 04:17:32 +0000 (21:17 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 24 Sep 2016 04:17:32 +0000 (21:17 -0700)
All callers updated

Change-Id: Ieb87df1bd134e6b0d8b01be581288e98fe3543ee

includes/libs/rdbms/database/DBConnRef.php
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/DatabaseMysqlBase.php
includes/libs/rdbms/database/IDatabase.php
includes/libs/rdbms/loadbalancer/LoadBalancer.php

index 1cb8906..20198bf 100644 (file)
@@ -445,7 +445,7 @@ class DBConnRef implements IDatabase {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
 
-       public function getSlavePos() {
+       public function getReplicaPos() {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
 
index 350194c..897e55f 100644 (file)
@@ -2436,7 +2436,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                return 0;
        }
 
-       public function getSlavePos() {
+       public function getReplicaPos() {
                # Stub
                return false;
        }
index 1efc6c8..c31b9f9 100644 (file)
@@ -811,7 +811,7 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
                        // 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.
-                       $replicationPos = $this->getSlavePos();
+                       $replicationPos = $this->getReplicaPos();
                        if ( $replicationPos && !$replicationPos->channelsMatch( $pos ) ) {
                                $this->lastKnownReplicaPos = $replicationPos;
                                $status = 0;
@@ -829,7 +829,7 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
         *
         * @return MySQLMasterPos|bool
         */
-       function getSlavePos() {
+       function getReplicaPos() {
                $res = $this->query( 'SHOW SLAVE STATUS', __METHOD__ );
                $row = $this->fetchObject( $res );
 
index 6423247..0396ec8 100644 (file)
@@ -1322,7 +1322,7 @@ interface IDatabase {
         *
         * @return DBMasterPos|bool False if this is not a replica DB.
         */
-       public function getSlavePos();
+       public function getReplicaPos();
 
        /**
         * Get the position of this master
index f1f202e..36e4c6c 100644 (file)
@@ -945,7 +945,7 @@ class LoadBalancer implements ILoadBalancer {
                        for ( $i = 1; $i < $serverCount; $i++ ) {
                                $conn = $this->getAnyOpenConnection( $i );
                                if ( $conn ) {
-                                       return $conn->getSlavePos();
+                                       return $conn->getReplicaPos();
                                }
                        }
                } else {