Repository navigation
Fix flaky test_keeper_4lw_reconfiguration when the node receiving rcfg briefly has no live leader - #122495
Merged
alexey-milovidov merged 1 commit intoSep 27, 2026
Conversation
…g briefly has no live leader The test sends `rcfg` and assumes the receiving node sees a live leader at that moment. A leader heartbeat gap longer than the election timeout makes a follower clear its leader. The next heartbeat makes it a follower again without marking the leader alive (NuRaft's same-term candidate branch calls only become_follower(), and only update_target_priority() sets hb_alive_), so for about one more heartbeat interval KeeperDispatcher refuses the command with "Cannot reconfigure cluster because there is no active leader". Seen in Integration tests (amd_tsan, 4/6) on PR ClickHouse#122464. Both no-live-leader refusals (the entry check and the `leaders` precondition) are raised before any action is applied, so add a helper that resends the command on exactly these two messages, every 0.5 s for up to 30 s, and then fails with the last refusal instead of returning it. All five rcfg calls use it; the assertions are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding; 1 full pass).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20260927-013200 |
Contributor
|
Workflow [PR], commit [421502d] Summary: ✅ AI ReviewSummaryThis PR wraps the Final Verdict
|
alexey-milovidov
approved these changes
Sep 27, 2026
Merged
via the queue into
ClickHouse:master
with commit Sep 27, 2026
6ae1e3a
172 of 173 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #113988
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
test_no_remove_itselffailed in Integration tests (amd_tsan, 4/6) (report) on #122464, which does not touch Keeper:The test sends
rcfgand assumes the receiving node sees a live leader at that moment. Here the leader's heartbeats to node3 paused for 1.64 s, longer than node3's election timeout. node3 cleared its leader and, because of its low priority, did not start an election. The next heartbeat made it a follower again, but NuRaft marks the leader alive only on the heartbeat after that (become_followerdoes not sethb_alive_,update_target_prioritydoes), so for about one more heartbeat interval node3 reported no live leader, andrcfgrefuses to run then. The cluster itself was healthy: the next test saw leader 7 and all 5 members.Both no-live-leader refusals (the entry check of
KeeperDispatcher::reconfigureClusterFromReconfigureCommandand theleadersprecondition) are raised before any action is applied, so the command can be sent again. The new helpersend_rcfgresends only on those two messages, every 0.5 s for up to 30 s, then fails with the last refusal. All fivercfgcalls use it, and every assertion is unchanged. A NuRaft fix forhb_alive_would only shorten this window: until the first heartbeat after the gap, node3 has no leader at all.Validated by blocking node3 <-> leader with iptables for 3 s while the two tests send
rcfg: without the change both fail with the CI message, with it both pass (3 of 3 runs, 11-12 resends each). Disabling the retry match, or setting the deadline to 0, turns both red again. The module passes 5 of 5 fresh-cluster runs without the fault.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/122495]
Version info
26.10.1.847-master(included in26.10and later)