Merge "Make ChronologyProtector::init() use instanceof instead of empty()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 15 Feb 2017 01:21:22 +0000 (01:21 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 15 Feb 2017 01:21:22 +0000 (01:21 +0000)
includes/libs/rdbms/ChronologyProtector.php

index 99e509c..1c28188 100644 (file)
@@ -119,7 +119,10 @@ class ChronologyProtector implements LoggerAwareInterface {
                $this->initPositions();
 
                $masterName = $lb->getServerName( $lb->getWriterIndex() );
-               if ( !empty( $this->startupPositions[$masterName] ) ) {
+               if (
+                       isset( $this->startupPositions[$masterName] ) &&
+                       $this->startupPositions[$masterName] instanceof DBMasterPos
+               ) {
                        $pos = $this->startupPositions[$masterName];
                        $this->logger->info( __METHOD__ . ": LB for '$masterName' set to pos $pos\n" );
                        $lb->waitFor( $pos );