public function __construct( BagOStuff $store, array $client, $posTime = null ) {
$this->store = $store;
$this->clientId = md5( $client['ip'] . "\n" . $client['agent'] );
public function __construct( BagOStuff $store, array $client, $posTime = null ) {
$this->store = $store;
$this->clientId = md5( $client['ip'] . "\n" . $client['agent'] );
$pos = $this->startupPositions[$masterName];
$this->logger->info( __METHOD__ . ": LB for '$masterName' set to pos $pos\n" );
$lb->waitFor( $pos );
$pos = $this->startupPositions[$masterName];
$this->logger->info( __METHOD__ . ": LB for '$masterName' set to pos $pos\n" );
$lb->waitFor( $pos );
- /** @var DBMasterPos $pos */
- $min = $min ? min( $pos->asOfTime(), $min ) : $pos->asOfTime();
+ if ( $pos instanceof DBMasterPos ) {
+ $min = $min ? min( $pos->asOfTime(), $min ) : $pos->asOfTime();
+ }
if ( $curValue === false ) {
$curPositions = $shutdownPositions;
} else {
$curPositions = $curValue['positions'];
// Use the newest positions for each DB master
foreach ( $shutdownPositions as $db => $pos ) {
if ( $curValue === false ) {
$curPositions = $shutdownPositions;
} else {
$curPositions = $curValue['positions'];
// Use the newest positions for each DB master
foreach ( $shutdownPositions as $db => $pos ) {
- if ( !isset( $curPositions[$db] )
- || $pos->asOfTime() > $curPositions[$db]->asOfTime()
+ if (
+ !isset( $curPositions[$db] ) ||
+ !( $curPositions[$db] instanceof DBMasterPos ) ||
+ $pos->asOfTime() > $curPositions[$db]->asOfTime()