Skip to content

Commit

Permalink
Filter out available slaves based on master-link-status flag (#1440)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhl-jfm committed Mar 6, 2024
1 parent d44f073 commit 45b18eb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Connection/Replication/SentinelReplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ protected function querySentinelForSlaves(NodeConnectionInterface $sentinel, $se
continue;
}

// ensure `master-link-status` is ok
if (isset($slave[31]) && $slave[31] === 'err') {
continue;
}

$slaves[] = [
'host' => $slave[3],
'port' => $slave[5],
Expand Down

0 comments on commit 45b18eb

Please sign in to comment.