Skip to content

[CI] CI fix sweep for 9.0 - #5701

Open
valkeyrie-ops[bot] wants to merge 1 commit into
agent/backport/sweep/9.0from
agent/backport/ci-sweep/9.0
Open

valkeyrie-ops[bot] wants to merge 1 commit into
agent/backport/sweep/9.0from
agent/backport/ci-sweep/9.0

Conversation

@valkeyrie-ops

@valkeyrie-ops valkeyrie-ops Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

CI fix sweep for 9.0

Automated fixes for CI failures on #5498.

Applied

Commit Failing job Title Detail
a9bd437 test-ubuntu-tls-no-tls (run) Wait for R 8 to reconnect to the voters in the failover2 election test

Fix details are posted as comments on this PR.


Generated by valkey-ci-agent using Claude Code.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c62008bd-8f5b-4afd-af57-8162d9ff9112

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@valkeyrie-ops

valkeyrie-ops Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Pushed ff25a03 with a fix for test-ubuntu-tls-no-tls (run) on #5498.

R 8 lost its second election because it asked for votes while two of its cluster bus links were still down after the packet drop filter was lifted. The test now holds R 8 back with cluster-replica-no-failover until its links with all five voters are connected in both directions, then releases it.

The failing test passed 29 loops with the fix, and the bot's review approved it.

Diagnosis and checks

What failed: Primaries will not time out then they are elected in the same epoch in tests/unit/cluster/failover2.tcl (No failover detected on R 8)

Root cause: While R 8 drops every packet with CLOSE-CLUSTER-LINK-ON-PACKET-DROP on, each dropped packet closes its link. R 8 closed all six outbound links at 09:29:53.720, and the filter was lifted at 53.868. R 8 saw R 7's claim of epoch 11 at 53.871, reset its election and started a new one for epoch 12 at 54.426. clusterNodeCronHandleReconnect only retries a node with no inbound link after node_timeout/2/10, which is 750 ms with this test's 15000 ms node timeout, and 54.426 is 706 ms after the last attempt. Primaries 3 and 4 accepted a connection only at 54.527 and logged neither a grant nor a denial for epoch 12. The vote request is broadcast once, only over links that exist, so R 8 got 3 votes (primaries 5 and 6, and R 7) of the 4 it needed. It logged 'Failover attempt expired' at 09:30:24 and the test's 50 second wait ran out. The failure is flaky.

The fix: The test assumed R 8's links were back by the time its new election started, which the server does not guarantee: the new election starts 500 to 1000 ms after the reset and a reconnect can take up to 750 ms plus a cron tick. The fix holds the moving part still instead of waiting longer. It sets cluster-replica-no-failover yes on R 8 just before lifting the filter, waits until R 8 and each voter (R 3 to R 7) report each other's linkstate as connected, then sets it back to no. Both directions matter because the request goes over the candidate's outbound link and the vote comes back over the voter's outbound link. The hold does not weaken the test: the election reset happens in packet processing regardless of the config, and if it did not happen R 8 would still sit in its epoch 11 election after release and fail both the role wait and the 'Failover attempt expired' check. The same linkstate wait is what the default branch uses for the same kind of race in the config epoch test of this file (from #3833).

What the bot checked

  • Existing fixes found: 1eaf118fdfe2 Fix RDB checker infinite loop on an RDB truncated inside a module value (Fix RDB checker infinite loop on an RDB truncated inside a module value #5476) (already ported as d461628); 9c4c8739da2e Apply the library load timeout to FUNCTION RESTORE (Apply the library load timeout to FUNCTION RESTORE #5181) (port candidate); eefa8927dc2b fix: Reject corrupt stream RDB with shared NACK across consumers (Reject corrupt stream RDB with shared NACK across consumers (CVE-2026-63639) #4073) (already ported as 06bc776); f7690377fba2 Increase the cluster-node-timeout to have longer delay between failover of each shard (Increase the cluster-node-timeout to have longer delay between failover of each shard #3946) (already ported as f19842f); c403eecd5b7d Fix double free in stream consumer PEL loading with corrupt RDB data (Fix double free in stream consumer PEL loading with corrupt RDB data #3498) (already ported as 22dadf8)

  • No change on the default branch was found to fix this failure, so this fix was written for this branch: the default branch does not have it.

  • A planned file uses run_solo, so its loops run one at a time.

  • With the fix, this command passed 29 loops:

    make -j"$(getconf _NPROCESSORS_ONLN)" BUILD_TLS=yes SERVER_CFLAGS='-Werror' USE_FAST_FLOAT=yes && ./runtest --verbose --dump-logs --single unit/cluster/failover2 --only 'Primaries will not time out then they are elected in the same epoch' --fastfail --loops 29 --timeout 600 --clients 1
  • One loop takes 91s, so 29 loops ran, not 40.

  • Review: The log supports the diagnosis: R 8 closed its six outbound links at 09:29:53.720, the filter was lifted at 53.868, the election was reset at 53.871 and the epoch 12 election started at 54.426. Primaries 5 and 6 and R 7 granted the vote, while primaries 3 and 4 accepted a connection only at 54.527 and logged neither a grant nor a denial, so R 8 stayed at 3 of 4 votes until 'Failover attempt expired' at 09:30:24. The code agrees: the vote request is broadcast once over node->link only, the ack is skipped when the voter has no link, and a node with no inbound link is retried only after node_timeout/2/10 (750 ms), which can exceed the 500 to 1000 ms election delay. This is a test race caused by the test's own debug link closing, not a broken server promise, and the author reports the server behaviour for maintainers. The fix holds the moving part still rather than waiting longer: cluster-replica-no-failover only makes clusterHandleReplicaFailover return early and does not touch election state, and the reset on R 7's claim happens in packet processing regardless of it. So if the reset were ever lost, R 8 would still sit in its epoch 11 election after release and fail both the role wait and the expiry check, meaning the test is not weakened. The linkstate field is exactly node->link, the condition both the request and the ack depend on, and waiting in both directions is needed because the log shows the voters' links back to R 8 also came up only at 54.538 and 54.609. The change is test-only and small, reuses cluster_get_node_by_id, prints the waited state on failure, and its comments explain why without narrating history. The default branch's DEBUG CLUSTER-FAILOVER-EPOCH approach does not exist on this branch, so a branch-specific fix is appropriate. I could not check the author's remark about the default branch's linkstate wait from this checkout, but nothing depends on it.

  • On unstable, which has the failing test, the agent made no fix: No change is made on unstable: the race fixed on 9.0 cannot occur in this branch's version of the test, because it never drops cluster packets or closes links on the candidate replica. Nothing was built or run.

The agent's own notes

I did not build or run anything; the verification command is the only check. No merged upstream commit fixes this. In the diffs I was given, the default branch drives this test with DEBUG CLUSTER-FAILOVER-EPOCH and CLUSTER-FAILOVER-DELAY from #3833 and does not close R 8's links, so it does not have this race and does not need this fix; I could not read the default branch's current file directly. No other release branch PR touched this test, and open PR #4296 only moves run_solo tests to another CI job. Not established by the log: that the connections primaries 3 and 4 accepted at 54.527 came from R 8. I inferred it from R 8's cron tick times and from those two primaries logging nothing about epoch 12. Residual: a voter's linkstate is its own view, so it could in principle still read connected for a link R 8 closed just before the filter was lifted, if the voter handled the test's query before that close. I judged this negligible because the close reaches the voter first. Server behaviour a maintainer may want to look at separately: a vote request is sent once per election and only over links that are up, so an election that starts within the reconnect backoff after link loss can miss voters and then waits out the full failover timeout.

#5498's CI decides whether the fix holds once this is merged, and the bot never merges.

@valkeyrie-ops
valkeyrie-ops Bot force-pushed the agent/backport/sweep/9.0 branch from a662c9c to 15fe05f Compare December 2, 2026 09:27
@valkeyrie-ops
valkeyrie-ops Bot force-pushed the agent/backport/ci-sweep/9.0 branch 6 times, most recently from dba8733 to 62978cd Compare December 5, 2026 02:52
While R 8 drops every packet with CLOSE-CLUSTER-LINK-ON-PACKET-DROP on,
each dropped packet closes its link. R 8 closed all six outbound links
at 09:29:53.720, and the filter was lifted at 53.868. R 8 saw R 7's
claim of epoch 11 at 53.871, reset its election and started a new one
for epoch 12 at 54.426. clusterNodeCronHandleReconnect only retries a
node with no inbound link after node_timeout/2/10, which is 750 ms with
this test's 15000 ms node timeout, and 54.426 is 706 ms after the last
attempt. Primaries 3 and 4 accepted a connection only at 54.527 and
logged neither a grant nor a denial for epoch 12. The vote request is
broadcast once, only over links that exist, so R 8 got 3 votes
(primaries 5 and 6, and R 7) of the 4 it needed. It logged 'Failover
attempt expired' at 09:30:24 and the test's 50 second wait ran out.

The test assumed R 8's links were back by the time its new election
started, which the server does not guarantee: the new election starts
500 to 1000 ms after the reset and a reconnect can take up to 750 ms
plus a cron tick. The fix holds the moving part still instead of waiting
longer. It sets cluster-replica-no-failover yes on R 8 just before
lifting the filter, waits until R 8 and each voter (R 3 to R 7) report
each other's linkstate as connected, then sets it back to no. Both
directions matter because the request goes over the candidate's outbound
link and the vote comes back over the voter's outbound link. The hold
does not weaken the test: the election reset happens in packet
processing regardless of the config, and if it did not happen R 8 would
still sit in its epoch 11 election after release and fail both the role
wait and the 'Failover attempt expired' check. The same linkstate wait
is what the default branch uses for the same kind of race in the config
epoch test of this file (from #3833).

CI-Fix-Job: test-ubuntu-tls-no-tls
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/46616296383
Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
@valkeyrie-ops
valkeyrie-ops Bot force-pushed the agent/backport/ci-sweep/9.0 branch from 62978cd to a9bd437 Compare December 5, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants