From: Aaron Schulz Date: Tue, 14 Feb 2017 22:21:19 +0000 (-0800) Subject: Make ChronologyProtector::init() use instanceof instead of empty() X-Git-Tag: 1.31.0-rc.0~4083^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=eb9a0a73c9f13320f17a62e5d69b51a502926749;p=lhc%2Fweb%2Fwiklou.git Make ChronologyProtector::init() use instanceof instead of empty() This is more robust and handles old root namespaced DBMasterPos values Bug: T158127 Change-Id: Iba775fc808ac3e73d360f1adbe45ad222351c2d9 --- diff --git a/includes/libs/rdbms/ChronologyProtector.php b/includes/libs/rdbms/ChronologyProtector.php index 99e509c1ae..1c28188516 100644 --- a/includes/libs/rdbms/ChronologyProtector.php +++ b/includes/libs/rdbms/ChronologyProtector.php @@ -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 );