Skip to content

Commit

Permalink
router: skip failover health check during initial configuration
Browse files Browse the repository at this point in the history
This commit fixes the flakiness of the failover/cluster_changes
test, which was caused by the commit 9fc976d ("router: calls
affect temporary prioritized replica"). It started to check
`replica.net_sequential_ok` during `up_replica_priority`. However,
during the configuration of the instance, `net_sequential_ok` is 0,
so when failover fiber didn't manage to ping the instance
(e.g. connection have not been created yet) router throwed
SUBOPTIMAL_REPLICA alert.

Let's disable health checkers during router configuration
(when prioritized replica is not set at all).

Closes #495

NO_DOC=bugfix
NO_TEST=<covered by failover/cluster_changes>
  • Loading branch information
Serpentian authored and Gerold103 committed Dec 3, 2024
1 parent 60a7089 commit 64b5273
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vshard/replicaset.lua
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,8 @@ local function replicaset_up_replica_priority(replicaset)
-- Failed to up priority.
return
end
if replica:is_connected() and replica.net_sequential_ok > 0 then
local is_healthy = replica.net_sequential_ok > 0
if replica:is_connected() and (is_healthy or not old_replica) then
assert(replica.net_sequential_fail == 0)
replicaset.replica = replica
assert(not old_replica or
Expand Down

0 comments on commit 64b5273

Please sign in to comment.