- // T126436: jobs programmed to wait on master positions might be referencing binlogs
- // with an old master hostname. Such calls make MASTER_POS_WAIT() return null. Try
- // to detect this and treat the replica DB as having reached the position; a proper master
- // switchover already requires that the new master be caught up before the switch.
- $replicationPos = $this->getReplicaPos();
- if ( $replicationPos && !$replicationPos->channelsMatch( $pos ) ) {
- $this->lastKnownReplicaPos = $replicationPos;
- $status = 0;
+ if ( !$pos->getGTIDs() ) {
+ // T126436: jobs programmed to wait on master positions might be referencing
+ // binlogs with an old master hostname; this makes MASTER_POS_WAIT() return null.
+ // Try to detect this case and treat the replica DB as having reached the given
+ // position (any master switchover already requires that the new master be caught
+ // up before the switch).
+ $replicationPos = $this->getReplicaPos();
+ if ( $replicationPos && !$replicationPos->channelsMatch( $pos ) ) {
+ $this->lastKnownReplicaPos = $replicationPos;
+ $status = 0;
+ }