* Make the slave wait methods work properly in this case if
the config flag is set.
* Also fixed a small IDEA error.
Bug: T135690
Change-Id: I9a12f1fc54c0b426f64c19ac2bf720e683fcf2fe
* if available
*
* - max lag: (optional) Maximum replication lag before a slave will taken out of rotation
+ * - is static: (optional) Set to true if the dataset is static and no replication is used.
*
* These and any other user-defined properties will be assigned to the mLBInfo member
* variable of the Database object.
throw new InvalidArgumentException( "Position not an instance of MySQLMasterPos" );
}
- if ( $this->lastKnownSlavePos && $this->lastKnownSlavePos->hasReached( $pos ) ) {
- return 0;
+ if ( $this->getLBInfo( 'is static' ) === true ) {
+ return 0; // this is a copy of a read-only dataset with no master DB
+ } elseif ( $this->lastKnownSlavePos && $this->lastKnownSlavePos->hasReached( $pos ) ) {
+ return 0; // already reached this point for sure
}
# Commit any open transactions
}
$pos = $pos ?: $this->getConnection( DB_MASTER )->getMasterPos();
- if ( !$pos ) {
+ if ( !( $pos instanceof DBMasterPos ) ) {
return false; // something is misconfigured
}