From eb9a0a73c9f13320f17a62e5d69b51a502926749 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 14 Feb 2017 14:21:19 -0800 Subject: [PATCH] Make ChronologyProtector::init() use instanceof instead of empty() This is more robust and handles old root namespaced DBMasterPos values Bug: T158127 Change-Id: Iba775fc808ac3e73d360f1adbe45ad222351c2d9 --- includes/libs/rdbms/ChronologyProtector.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ); -- 2.20.1