Skip to content

[CI] CI fix sweep for 9.0 - #5396

Closed
valkeyrie-ops[bot] wants to merge 3 commits into
agent/backport/sweep/9.0from
agent/backport/ci-sweep/9.0
Closed

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

Conversation

@valkeyrie-ops

@valkeyrie-ops valkeyrie-ops Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

CI fix sweep for 9.0

Automated fixes for CI failures on #5073.

Applied

Commit Failing job Title Detail
cc488f7 test-alpine-32bit (run) Deflake replica selection test with a longer cluster-node-timeout
e57dea3 test-sanitizer-address (gcc) (run) Wait for the primary to exit in the shutdown after block test
4eb10ca test-sanitizer-address (clang) (run) Drive the replicas into the same epoch in the failover2 election test

Fix details are posted as comments on this PR.


Generated by valkey-ci-agent using Claude Code.

The election delay scales with cluster-node-timeout: delay =
min(node_timeout / 30, 500), plus a random 0..delay, plus rank * 2 *
delay. With the test's node timeout of 5000 the delay is 166 ms, so rank
1 starts only 167 to 497 ms after rank 0, before the 100 ms cron
granularity. In the log, node #5 (d3af1bb, rank 0, offset 1319) was
delayed 323 ms and node #10 (ae5ac, rank 1, offset 671) 523 ms. #5
started its election for epoch 16 at 10:08:34.498 and won at 34.618. #10
started its own election for epoch 17 at 34.629, before #5's new
configuration had reached the voters or #10 itself (they logged it at
34.654 to 34.660). The primaries granted epoch 17 to #10 at 34.635, #10
won with the higher config epoch and #5 was demoted to its replica. A
failover did happen, but to the replica the test does not expect, so
both tests timed out.

The server honoured the rank delay; rank ordering is a best-effort
delay, not a guarantee, so the test was relying on a margin the 5000 ms
node timeout does not provide on a slow runner. In this run #5's
election took about 120 ms plus about 40 ms to propagate, and it started
about 90 ms late. With the default node timeout of 15000 the delay is
500 ms and the rank step 1000 ms, so the gap is at least about 500 ms,
which is the server's default production timing. The test still lets
both replicas compete and still requires #5 to win and #10 to replicate
it, so nothing is weakened. The repository fixed the same class of flake
in failover2.tcl the same way, by raising cluster-node-timeout to 15000
(#2793, #3946). Only the first cluster is changed; the second cluster's
test accepts any replica as the new primary and passed.

CI-Fix-Job: test-alpine-32bit
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
@coderabbitai

coderabbitai Bot commented Nov 13, 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: f593687f-48c2-4106-8aa4-d902723ce5c3

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 Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

Pushed cc488f7 with a fix for test-alpine-32bit (run) on #5073.

The first cluster in tests/unit/cluster/slave-selection.tcl now uses cluster-node-timeout 15000 instead of 5000, so the stale replica #10 waits at least about 500 ms longer than replica #5 before starting its election.

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

Diagnosis and checks

What failed: test-alpine-32bit: 'Wait for instance #5 (and not #10) to turn into a master' and 'Node #10 should eventually replicate node #5' in tests/unit/cluster/slave-selection.tcl

Root cause: The election delay scales with cluster-node-timeout: delay = min(node_timeout / 30, 500), plus a random 0..delay, plus rank * 2 * delay. With the test's node timeout of 5000 the delay is 166 ms, so rank 1 starts only 167 to 497 ms after rank 0, before the 100 ms cron granularity. In the log, node #5 (d3af1bb, rank 0, offset 1319) was delayed 323 ms and node #10 (ae5ac, rank 1, offset 671) 523 ms. #5 started its election for epoch 16 at 10:08:34.498 and won at 34.618. #10 started its own election for epoch 17 at 34.629, before #5's new configuration had reached the voters or #10 itself (they logged it at 34.654 to 34.660). The primaries granted epoch 17 to #10 at 34.635, #10 won with the higher config epoch and #5 was demoted to its replica. A failover did happen, but to the replica the test does not expect, so both tests timed out. The failure is flaky.

The fix: The server honoured the rank delay; rank ordering is a best-effort delay, not a guarantee, so the test was relying on a margin the 5000 ms node timeout does not provide on a slow runner. In this run #5's election took about 120 ms plus about 40 ms to propagate, and it started about 90 ms late. With the default node timeout of 15000 the delay is 500 ms and the rank step 1000 ms, so the gap is at least about 500 ms, which is the server's default production timing. The test still lets both replicas compete and still requires #5 to win and #10 to replicate it, so nothing is weakened. The repository fixed the same class of flake in failover2.tcl the same way, by raising cluster-node-timeout to 15000 (#2793, #3946). Only the first cluster is changed; the second cluster's test accepts any replica as the new primary and passed.

What the bot checked

  • Existing fixes found: f598d11a4bd3 Deflake replica selection test by relaxing cluster configurations (Deflake replica selection test by relaxing cluster configurations #2672) (already ported as 6700272); fb655dbf5cfa Replace dict with thin wrapper around hashtable (Replace dict with thin wrapper around hashtable #3366) (port candidate); 0ee4234506ba Remove internal server object pointer overhead in small strings (Remove internal server object pointer overhead in small strings #2516) (port candidate); fab2a12c5103 Increase wait time condition for New Master down consecutively test (Increase wait time condition for New Master down consecutively test #2612) (already ported as ad4f09e); a47e8fa15055 Expand wait condition time for slave selection test (Expand wait condition time for slave selection test #2604) (already ported as a36c990)

  • Code checks your change: the build must pass and the failing test must run and pass, once and then looped (up to 40 loops, fewer when one loop is slow):

    make -j"$(getconf _NPROCESSORS_ONLN)" && ./runtest --dump-logs --single unit/cluster/slave-selection --only 'Wait for instance #5 (and not #10) to turn into a master' --only 'Node #10 should eventually replicate node #5' --fastfail --loops 40 --timeout 600

    The failed job could not host the fix, so plain make and runtest stand in for it.

  • 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.

  • With the fix, this command passed 40 loops:

    make -j"$(getconf _NPROCESSORS_ONLN)" && ./runtest --dump-logs --single unit/cluster/slave-selection.ci-fix-isolated --fastfail --loops 40 --timeout 600
  • Review: The log matches the diagnosis: node Update CODE_OF_CONDUCT.md #5 (rank 0, offset 1319) started its election for epoch 16 at 34.498 and won at 34.618, node Adds discord link for discussions. #10 (rank 1, offset 671) started epoch 17 at 34.629, and all four primaries granted both votes before Update CODE_OF_CONDUCT.md #5's new configuration reached them, so Adds discord link for discussions. #10 won with the higher config epoch and Update CODE_OF_CONDUCT.md #5 was demoted. The code confirms the delay is min(node_timeout / 30, 500) plus a random part plus rank * 2 * delay, so the 5000 ms override left a rank gap of only 167 to 497 ms, which this run's roughly 120 ms election and 90 ms late start consumed. The server behaved as designed, since rank ordering is a best-effort delay and the cluster converged, so this is a test margin problem and not a product defect. Raising the first cluster to 15000 gives the server's default 500 ms delay and 1000 ms rank step, and the author shows why the old value was wrong instead of just waiting longer. The test still requires Update CODE_OF_CONDUCT.md #5 to win and Adds discord link for discussions. #10 to replicate it, the explicit override is needed because start_cluster defaults to 3000, the extra detection time stays inside the existing 50 s and 100 s waits, and the change is one line plus a comment that explains why without history. The author states openly that this widens the margin without making the outcome a hard guarantee, and that nothing was reproduced before the fix. The fix passed 40 loops, and failover2.tcl already uses the same 15000 setting.

The agent's own notes

Nothing was run here. No upstream commit fixes this: the default branch's copy of the test has the same 5000 ms override, and its only later change to the file is the unrelated pause_process_persistent harness change (#4871). The listed port candidates (#3366, #2516) are unrelated refactors, and the 9.1 bot commit listed for other release branches touches only src/server.h. The default branch does not have this change. It has #2227 (the best ranked replica fails over immediately), which by its description should widen the gap between rank 0 and rank 1; I did not have its source to confirm, so whether the default branch needs the same change is not established. I did not port #2227 because it is a product feature, not a fix for this test. The change makes the first cluster's failure detection about 10 seconds slower per run, which stays well inside the existing 50 s and 100 s waits. The larger margin makes the race much less likely but is not a hard guarantee, since the server does not promise that the best ranked replica wins. Replica #10's 10 second DEBUG SLEEP is now shorter than the node timeout, so it is no longer briefly marked FAIL during the write phase; the test does not depend on that.

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

The test sends SHUTDOWN to the primary, resumes the replica and ends its
block without waiting for the shutdown to finish. In the log the primary
(pid 56270) prints "Valkey is now ready to exit, bye bye..." at
10:09:03.797 and the next line is "signal-handler Received SIGTERM
scheduling shutdown...". The process was still alive running
LeakSanitizer's exit-time check when kill_server in
tests/support/server.tcl found it alive and sent SIGTERM. The
interrupted leak check wrote the LeakSanitizer warning to stderr, and
check_sanitizer_errors reported it as a failure. The test itself passed.

The test asks the primary to shut down, so the process exiting is the
state it depends on. The primary always exits on its own here:
serverCron finishes the shutdown once the replica is in sync or gone, or
when the default 10 second shutdown-timeout expires. The patch waits up
to 50 seconds for the pid to disappear, using the same is_alive check
kill_server uses, so kill_server takes its already-dead path and sends
no signal. The existing crash-log assertion now runs after the shutdown
has completed instead of possibly before it, which makes the test
stricter, not weaker. No report is ignored and no product source is
touched.

CI-Fix-Job: test-sanitizer-address (gcc)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
@valkeyrie-ops

valkeyrie-ops Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

Pushed e57dea3 with a fix for test-sanitizer-address (gcc) (run) on #5073.

The last test in tests/integration/shutdown.tcl now waits for the primary to exit before its server block ends, so the harness no longer sends SIGTERM to a primary that is in its exit-time leak check.

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

Diagnosis and checks

What failed: test-sanitizer-address (gcc): "Sanitizer error: ==56270==WARNING: ptrace appears to be blocked (is seccomp enabled?). LeakSanitizer may hang. ==56270==Child exited with signal 96." reported for the primary of "Shutting down primary wait for replica after previous block" in tests/integration/shutdow…

Root cause: The test sends SHUTDOWN to the primary, resumes the replica and ends its block without waiting for the shutdown to finish. In the log the primary (pid 56270) prints "Valkey is now ready to exit, bye bye..." at 10:09:03.797 and the next line is "signal-handler Received SIGTERM scheduling shutdown...". The process was still alive running LeakSanitizer's exit-time check when kill_server in tests/support/server.tcl found it alive and sent SIGTERM. The interrupted leak check wrote the LeakSanitizer warning to stderr, and check_sanitizer_errors reported it as a failure. The test itself passed. The failure is flaky.

The fix: The test asks the primary to shut down, so the process exiting is the state it depends on. The primary always exits on its own here: serverCron finishes the shutdown once the replica is in sync or gone, or when the default 10 second shutdown-timeout expires. The patch waits up to 50 seconds for the pid to disappear, using the same is_alive check kill_server uses, so kill_server takes its already-dead path and sends no signal. The existing crash-log assertion now runs after the shutdown has completed instead of possibly before it, which makes the test stricter, not weaker. No report is ignored and no product source is touched.

What the bot checked

  • Existing fixes found: 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); 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); be52d8b81a82 Fix trivial double-free issue in rdbLoadObject (Fix trivial double-free issue in rdbLoadObject #3453) (port candidate); 2585f60ebc93 Fix RDB expiry write length and leak when loading zipmap (Fix RDB expiry write length and leak when loading zipmap #3422) (port candidate)

  • Code could not tell from the log which test failed, so it ran the one the author named: Shutting down primary wait for replica after previous block in tests/integration/shutdown.tcl. Check against the log that it is the test that failed.

  • 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.

  • With the fix, this command passed 40 loops:

    export CC='gcc' && make -j"$(getconf _NPROCESSORS_ONLN)" all-with-unit-tests OPT=-O3 SANITIZER=address SERVER_CFLAGS='-Werror' && ./runtest --accurate --verbose --dump-logs --single integration/shutdown --only 'Shutting down primary wait for replica after previous block' --fastfail --loops 40 --timeout 600
  • Review: The log confirms the diagnosis: the only error is the sanitizer report for pid 56270, the primary of 'Shutting down primary wait for replica after previous block', whose log shows 'ready to exit, bye bye' at 10:09:03.797 immediately followed by 'Received SIGTERM scheduling shutdown', while the test itself reported ok. kill_server in tests/support/server.tcl sends that SIGTERM whenever is_alive is still true, so the test leaving its block without waiting for the shutdown it requested is the root cause, and the test guide names waiting for the server to exit as the right fix for exactly this case. The patch waits for that state with the existing is_alive helper in the same wait_for_condition idiom used in tests/integration/aof.tcl, so kill_server takes its already-dead path and nothing is ignored or loosened. The crash-log assertion is kept and now runs after the full shutdown, which is stricter. The 50 second bound is a new wait rather than a lengthened one and comfortably covers the default 10 second shutdown-timeout; the comment and failure message state what is waited for without narrating history. The change is eight lines in one test, and the author disclosed what is not established, including the same window in the earlier tests and the unread harness commit on the default branch. I did not run anything myself; the 40 passing loops are the author's report.

The agent's own notes

Nothing was run; the diagnosis comes from the job log and the code. The five listed prior fixes all change src/rdb.c RDB loading and are unrelated to this failure, and the pending slave-selection fix does not cover it. I could not read the diff of 8afe238 (Fix several test-harness issues that can cause flaky failures, #4805), which changes tests/support/server.tcl on the default branch, nor the default branch's copy of this test, so I did not name a port. A maintainer should check whether that commit already makes kill_server wait for a server that is exiting on its own. If it does not and the default branch has the same test body, the default branch needs this same fix. The log does not show whether the primary's shutdown was released by the replica's ACK or by the replica being killed at 10:09:03.735; the wait is correct in both cases. The earlier tests in this file wait only for the "ready to exit, bye bye" log line, which leaves the same window open in principle. They did not fail in this job and I left them unchanged.

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

All three FAIL messages reached every node within about 65 ms, and the
replica of the third primary won epoch 11 at 10:06:20.101. That win
lowered the failed primary rank of the other two replicas by one, which
moved both of their election times 500 ms earlier and into the past.
Both started an election for epoch 12 within the same millisecond
(10:06:20.198 and .199). The five voters split 3 to 2 and the quorum is
4, so neither won. On 9.0 a replica restarts its election early only
when it sees a primary claim an equal or higher epoch
(cluster_legacy.c:3785). With no winner there was no such claim, so both
waited for the 30 second timeout ("Failover attempt expired" from
10:06:50) and the 60 second retry, past the test's 50 second wait. The
random part of the delay (0 to 500 ms) is as large as the 500 ms spacing
per rank, so a rank decrement can always cancel the spacing.

The default branch removes split votes in product code with the
FAILOVER_AUTH_NACK message (f2c1c5e).
That is a new cluster bus message type and new DEBUG subcommands, not
something to backport to a release branch, so the fix here has to be in
the test. The property 9.0 does guarantee is that a replica whose
election epoch is won by another replica restarts as soon as it sees the
winner. The test now forces exactly that. All replicas start with
cluster-replica-no-failover yes and the test waits until nodes 3 to 9
see the three paused primaries as fail. R 8 then drops all cluster bus
packets while R 7 is released and wins. R 8 is released next and, still
on the old epoch, starts its election in the epoch R 7 won, where the
four healthy primaries have already voted. Once the filter is removed, R
8 sees R 7's claim, resets, and must become primary within the existing
wait. R 9 is released last. The original checks for no "Failover attempt
expired" and no "epoch 0" message are unchanged, so a regression in the
reset logic still fails the test. Because there is always exactly one
winner per epoch, the no-winner split cannot occur. The packet filter
and link-close DEBUG switches are the ones
test_replica_config_epoch_failover already uses in this file.

CI-Fix-Job: test-sanitizer-address (clang)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
@valkeyrie-ops

valkeyrie-ops Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 4eb10ca with a fix for test-sanitizer-address (clang) (run) on #5073.

The same-epoch failover test in tests/unit/cluster/failover2.tcl failed because two replicas split the votes 3 to 2 in one epoch, which 9.0 only recovers from after the 30 second failover timeout. The patch makes the test build the same-epoch case it is named for deterministically, with one replica always winning first, instead of leaving it to the random election delays.

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

Diagnosis and checks

What failed: test-sanitizer-address (clang): "Primaries will not time out then they are elected in the same epoch" in tests/unit/cluster/failover2.tcl failed with "No failover detected"

Root cause: All three FAIL messages reached every node within about 65 ms, and the replica of the third primary won epoch 11 at 10:06:20.101. That win lowered the failed primary rank of the other two replicas by one, which moved both of their election times 500 ms earlier and into the past. Both started an election for epoch 12 within the same millisecond (10:06:20.198 and .199). The five voters split 3 to 2 and the quorum is 4, so neither won. On 9.0 a replica restarts its election early only when it sees a primary claim an equal or higher epoch (cluster_legacy.c:3785). With no winner there was no such claim, so both waited for the 30 second timeout ("Failover attempt expired" from 10:06:50) and the 60 second retry, past the test's 50 second wait. The random part of the delay (0 to 500 ms) is as large as the 500 ms spacing per rank, so a rank decrement can always cancel the spacing. The failure is flaky.

The fix: The default branch removes split votes in product code with the FAILOVER_AUTH_NACK message (f2c1c5e). That is a new cluster bus message type and new DEBUG subcommands, not something to backport to a release branch, so the fix here has to be in the test. The property 9.0 does guarantee is that a replica whose election epoch is won by another replica restarts as soon as it sees the winner. The test now forces exactly that. All replicas start with cluster-replica-no-failover yes and the test waits until nodes 3 to 9 see the three paused primaries as fail. R 8 then drops all cluster bus packets while R 7 is released and wins. R 8 is released next and, still on the old epoch, starts its election in the epoch R 7 won, where the four healthy primaries have already voted. Once the filter is removed, R 8 sees R 7's claim, resets, and must become primary within the existing wait. R 9 is released last. The original checks for no "Failover attempt expired" and no "epoch 0" message are unchanged, so a regression in the reset logic still fails the test. Because there is always exactly one winner per epoch, the no-winner split cannot occur. The packet filter and link-close DEBUG switches are the ones test_replica_config_epoch_failover already uses in this file.

What the bot checked

  • Existing fixes found: 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); be52d8b81a82 Fix trivial double-free issue in rdbLoadObject (Fix trivial double-free issue in rdbLoadObject #3453) (port candidate)

  • Code checks your change: the build must pass and the failing test must run and pass, once and then looped (up to 40 loops, fewer when one loop is slow):

    export CC='clang' && make -j"$(getconf _NPROCESSORS_ONLN)" all-with-unit-tests OPT=-O3 SANITIZER=address SERVER_CFLAGS='-Werror' && ./runtest --accurate --verbose --dump-logs --single unit/cluster/failover2 --only 'Primaries will not time out then they are elected in the same epoch' --fastfail --loops 40 --timeout 600 --clients 1

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

  • 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.

  • With the fix, this command passed 29 loops:

    export CC='clang' && make -j"$(getconf _NPROCESSORS_ONLN)" all-with-unit-tests OPT=-O3 SANITIZER=address SERVER_CFLAGS='-Werror' && ./runtest --accurate --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 92s, so 29 loops ran, not 40.

  • Review: The diagnosis matches the log: the third replica won epoch 11 at 10:06:20.101, the win lowered the failed primary rank of the other two by one and moved both election times into the past, both asked for epoch 12 at 20.198 and 20.199, the five voters split 3 to 2 against a quorum of 4, and both then sat until Failover attempt expired at 10:06:50. In cluster_legacy.c the only early restart on this branch is the claim check at line 3785, so a split with no winner legitimately waits out the 30 second timeout and 60 second retry; the test assumed a vote ordering the server does not guarantee, and the author flags the rank arithmetic for maintainers instead of hiding it. The patch does not loosen any check or wait. It holds the moving part still: replicas are released one at a time so a no-winner split cannot occur, and the packet filter on R 8 forces the same-epoch case the test is named for. I traced that path: R 8 asks for the epoch R 7 already won, cannot get votes, and can only become primary inside the 50 second wait through the line 3785 reset, so a regression there still fails the test, and the expired and epoch 0 checks are unchanged. A plain sequential release without the filter would be smaller but would never exercise the same-epoch case, so the size is justified; it uses only existing helpers and DEBUG switches already used in this file, the comments describe the test and not the fix, and it passed 29 loops. I could not check the claims about the 9.1 and 8.1 fixes, but the approval does not depend on them. The free three-way race is no longer exercised here, which the author states.

The agent's own notes

I did not run the build or the test. The patch keeps the gating lines of the 9.1 fix baf141d and the 8.1 fix fc5180e (the override, paused_ids, and wait_node_marked_fail for nodes 3 to 9) but does not release the three replicas together as they do. That fix alone does not fit this failure: here every node had all FAIL messages about a second before any election, and the split came from the rank decrement after the first win, which gating with a simultaneous release still allows. If 9.1 and 8.1 share this election code they need the same extension. The default branch does not have this change and does not need it, since it resolves split votes with FAILOVER_AUTH_NACK (#3833) and rewrote this test around that. The pending fixes e57dea3 (shutdown.tcl) and cc488f7 (slave-selection.tcl) do not touch this test. The log does not establish how often the split occurs; a few percent per run at most is my estimate from the delay arithmetic. A maintainer should know two things. The replicas are now elected one after another, so three replicas racing freely on random delays is no longer exercised here; the rank-based spacing stays covered by the "Multiple primary nodes are down" test in the same file. And the new sequence assumes all nodes share one currentEpoch before the elections, which holds after the roughly 15 seconds of gossip needed to mark the primaries as fail.

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

@sarthakaggarwal97
sarthakaggarwal97 deleted the agent/backport/ci-sweep/9.0 branch November 13, 2026 23:24
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
…lkey-io#5396)

The election delay scales with cluster-node-timeout: delay =
min(node_timeout / 30, 500), plus a random 0..delay, plus rank * 2 *
delay. With the test's node timeout of 5000 the delay is 166 ms, so rank
1 starts only 167 to 497 ms after rank 0, before the 100 ms cron
granularity. In the log, node #5 (d3af1bb, rank 0, offset 1319) was
delayed 323 ms and node #10 (ae5ac, rank 1, offset 671) 523 ms. #5
started its election for epoch 16 at 10:08:34.498 and won at 34.618. #10
started its own election for epoch 17 at 34.629, before #5's new
configuration had reached the voters or #10 itself (they logged it at
34.654 to 34.660). The primaries granted epoch 17 to #10 at 34.635, #10
won with the higher config epoch and #5 was demoted to its replica. A
failover did happen, but to the replica the test does not expect, so
both tests timed out.

The server honoured the rank delay; rank ordering is a best-effort
delay, not a guarantee, so the test was relying on a margin the 5000 ms
node timeout does not provide on a slow runner. In this run #5's
election took about 120 ms plus about 40 ms to propagate, and it started
about 90 ms late. With the default node timeout of 15000 the delay is
500 ms and the rank step 1000 ms, so the gap is at least about 500 ms,
which is the server's default production timing. The test still lets
both replicas compete and still requires #5 to win and #10 to replicate
it, so nothing is weakened. The repository fixed the same class of flake
in failover2.tcl the same way, by raising cluster-node-timeout to 15000
(valkey-io#2793, valkey-io#3946). Only the first cluster is changed; the second cluster's
test accepts any replica as the new primary and passed.

CI-Fix-Job: test-alpine-32bit
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728

Backport-Source-PR: 5396
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
…lkey-io#5396)

The election delay scales with cluster-node-timeout: delay =
min(node_timeout / 30, 500), plus a random 0..delay, plus rank * 2 *
delay. With the test's node timeout of 5000 the delay is 166 ms, so rank
1 starts only 167 to 497 ms after rank 0, before the 100 ms cron
granularity. In the log, node #5 (d3af1bb, rank 0, offset 1319) was
delayed 323 ms and node #10 (ae5ac, rank 1, offset 671) 523 ms. #5
started its election for epoch 16 at 10:08:34.498 and won at 34.618. #10
started its own election for epoch 17 at 34.629, before #5's new
configuration had reached the voters or #10 itself (they logged it at
34.654 to 34.660). The primaries granted epoch 17 to #10 at 34.635, #10
won with the higher config epoch and #5 was demoted to its replica. A
failover did happen, but to the replica the test does not expect, so
both tests timed out.

The server honoured the rank delay; rank ordering is a best-effort
delay, not a guarantee, so the test was relying on a margin the 5000 ms
node timeout does not provide on a slow runner. In this run #5's
election took about 120 ms plus about 40 ms to propagate, and it started
about 90 ms late. With the default node timeout of 15000 the delay is
500 ms and the rank step 1000 ms, so the gap is at least about 500 ms,
which is the server's default production timing. The test still lets
both replicas compete and still requires #5 to win and #10 to replicate
it, so nothing is weakened. The repository fixed the same class of flake
in failover2.tcl the same way, by raising cluster-node-timeout to 15000
(valkey-io#2793, valkey-io#3946). Only the first cluster is changed; the second cluster's
test accepts any replica as the new primary and passed.

CI-Fix-Job: test-alpine-32bit
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728

Backport-Source-PR: 5396
sarthakaggarwal97 added a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
The previous BLPOP can still be blocked when the test checks the generic
blocked-client count. In the failing run the client was closed with BLPOP
still active and SHUTDOWN queued in its input buffer, so the primary never
received a shutdown request and the exit wait correctly failed.

Require cmd=shutdown as well as the existing client and blocked-client
counts before resuming the replica and closing the deferring client. This
keeps the timeout-then-reblock regression and verifies an actual shutdown;
the exit wait and crash check are unchanged. No server code is modified.

Backport-Source-PR: 5396
CI-Fix-Job: test-ubuntu-no-malloc-usable-size
CI-Fix-Run: https://github.com/sarthakaggarwal97/valkey/actions/runs/44048440217
sarthakaggarwal97 added a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
The previous BLPOP can still be blocked when the test checks the generic
blocked-client count. In the failing run the client was closed with BLPOP
still active and SHUTDOWN queued in its input buffer, so the primary never
received a shutdown request and the exit wait correctly failed.

Require cmd=shutdown as well as the existing client and blocked-client
counts before resuming the replica and closing the deferring client. This
keeps the timeout-then-reblock regression and verifies an actual shutdown;
the exit wait and crash check are unchanged. No server code is modified.

Backport-Source-PR: 5396
CI-Fix-Job: test-ubuntu-no-malloc-usable-size
CI-Fix-Run: https://github.com/sarthakaggarwal97/valkey/actions/runs/44048440217
sarthakaggarwal97 added a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
The previous BLPOP can still be blocked when the test checks the generic
blocked-client count. In the failing run the client was closed with BLPOP
still active and SHUTDOWN queued in its input buffer, so the primary never
received a shutdown request and the exit wait correctly failed.

Require cmd=shutdown as well as the existing client and blocked-client
counts before resuming the replica and closing the deferring client. This
keeps the timeout-then-reblock regression and verifies an actual shutdown;
the exit wait and crash check are unchanged. No server code is modified.

Backport-Source-PR: 5396
CI-Fix-Job: test-ubuntu-no-malloc-usable-size
CI-Fix-Run: https://github.com/sarthakaggarwal97/valkey/actions/runs/44048440217
sarthakaggarwal97 added a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
The previous BLPOP can still be blocked when the test checks the generic
blocked-client count. In the failing run the client was closed with BLPOP
still active and SHUTDOWN queued in its input buffer, so the primary never
received a shutdown request and the exit wait correctly failed.

Require cmd=shutdown as well as the existing client and blocked-client
counts before resuming the replica and closing the deferring client. This
keeps the timeout-then-reblock regression and verifies an actual shutdown;
the exit wait and crash check are unchanged. No server code is modified.

Backport-Source-PR: 5396
CI-Fix-Job: test-ubuntu-no-malloc-usable-size
CI-Fix-Run: https://github.com/sarthakaggarwal97/valkey/actions/runs/44048440217
sarthakaggarwal97 added a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
The previous BLPOP can still be blocked when the test checks the generic
blocked-client count. In the failing run the client was closed with BLPOP
still active and SHUTDOWN queued in its input buffer, so the primary never
received a shutdown request and the exit wait correctly failed.

Require cmd=shutdown as well as the existing client and blocked-client
counts before resuming the replica and closing the deferring client. This
keeps the timeout-then-reblock regression and verifies an actual shutdown;
the exit wait and crash check are unchanged. No server code is modified.

Backport-Source-PR: 5396
CI-Fix-Job: test-ubuntu-no-malloc-usable-size
CI-Fix-Run: https://github.com/sarthakaggarwal97/valkey/actions/runs/44048440217
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
…-io#5396)

The test sends SHUTDOWN to the primary, resumes the replica and ends its
block without waiting for the shutdown to finish. In the log the primary
(pid 56270) prints "Valkey is now ready to exit, bye bye..." at
10:09:03.797 and the next line is "signal-handler Received SIGTERM
scheduling shutdown...". The process was still alive running
LeakSanitizer's exit-time check when kill_server in
tests/support/server.tcl found it alive and sent SIGTERM. The
interrupted leak check wrote the LeakSanitizer warning to stderr, and
check_sanitizer_errors reported it as a failure. The test itself passed.

The test asks the primary to shut down, so the process exiting is the
state it depends on. The primary always exits on its own here:
serverCron finishes the shutdown once the replica is in sync or gone, or
when the default 10 second shutdown-timeout expires. The patch waits up
to 50 seconds for the pid to disappear, using the same is_alive check
kill_server uses, so kill_server takes its already-dead path and sends
no signal. The existing crash-log assertion now runs after the shutdown
has completed instead of possibly before it, which makes the test
stricter, not weaker. No report is ignored and no product source is
touched.

CI-Fix-Job: test-sanitizer-address (gcc)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
Backport-Source-PR: 5396
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
…lkey-io#5396)

The election delay scales with cluster-node-timeout: delay =
min(node_timeout / 30, 500), plus a random 0..delay, plus rank * 2 *
delay. With the test's node timeout of 5000 the delay is 166 ms, so rank
1 starts only 167 to 497 ms after rank 0, before the 100 ms cron
granularity. In the log, node #5 (d3af1bb, rank 0, offset 1319) was
delayed 323 ms and node #10 (ae5ac, rank 1, offset 671) 523 ms. #5
started its election for epoch 16 at 10:08:34.498 and won at 34.618. #10
started its own election for epoch 17 at 34.629, before #5's new
configuration had reached the voters or #10 itself (they logged it at
34.654 to 34.660). The primaries granted epoch 17 to #10 at 34.635, #10
won with the higher config epoch and #5 was demoted to its replica. A
failover did happen, but to the replica the test does not expect, so
both tests timed out.

The server honoured the rank delay; rank ordering is a best-effort
delay, not a guarantee, so the test was relying on a margin the 5000 ms
node timeout does not provide on a slow runner. In this run #5's
election took about 120 ms plus about 40 ms to propagate, and it started
about 90 ms late. With the default node timeout of 15000 the delay is
500 ms and the rank step 1000 ms, so the gap is at least about 500 ms,
which is the server's default production timing. The test still lets
both replicas compete and still requires #5 to win and #10 to replicate
it, so nothing is weakened. The repository fixed the same class of flake
in failover2.tcl the same way, by raising cluster-node-timeout to 15000
(valkey-io#2793, valkey-io#3946). Only the first cluster is changed; the second cluster's
test accepts any replica as the new primary and passed.

CI-Fix-Job: test-alpine-32bit
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728

Backport-Source-PR: 5396
sarthakaggarwal97 added a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
The previous BLPOP can still be blocked when the test checks the generic
blocked-client count. In the failing run the client was closed with BLPOP
still active and SHUTDOWN queued in its input buffer, so the primary never
received a shutdown request and the exit wait correctly failed.

Require cmd=shutdown as well as the existing client and blocked-client
counts before resuming the replica and closing the deferring client. This
keeps the timeout-then-reblock regression and verifies an actual shutdown;
the exit wait and crash check are unchanged. No server code is modified.

Backport-Source-PR: 5396
CI-Fix-Job: test-ubuntu-no-malloc-usable-size
CI-Fix-Run: https://github.com/sarthakaggarwal97/valkey/actions/runs/44048440217
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
…-io#5396)

The test sends SHUTDOWN to the primary, resumes the replica and ends its
block without waiting for the shutdown to finish. In the log the primary
(pid 56270) prints "Valkey is now ready to exit, bye bye..." at
10:09:03.797 and the next line is "signal-handler Received SIGTERM
scheduling shutdown...". The process was still alive running
LeakSanitizer's exit-time check when kill_server in
tests/support/server.tcl found it alive and sent SIGTERM. The
interrupted leak check wrote the LeakSanitizer warning to stderr, and
check_sanitizer_errors reported it as a failure. The test itself passed.

The test asks the primary to shut down, so the process exiting is the
state it depends on. The primary always exits on its own here:
serverCron finishes the shutdown once the replica is in sync or gone, or
when the default 10 second shutdown-timeout expires. The patch waits up
to 50 seconds for the pid to disappear, using the same is_alive check
kill_server uses, so kill_server takes its already-dead path and sends
no signal. The existing crash-log assertion now runs after the shutdown
has completed instead of possibly before it, which makes the test
stricter, not weaker. No report is ignored and no product source is
touched.

CI-Fix-Job: test-sanitizer-address (gcc)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
Backport-Source-PR: 5396
sarthakaggarwal97 added a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
The previous BLPOP can still be blocked when the test checks the generic
blocked-client count. In the failing run the client was closed with BLPOP
still active and SHUTDOWN queued in its input buffer, so the primary never
received a shutdown request and the exit wait correctly failed.

Require cmd=shutdown as well as the existing client and blocked-client
counts before resuming the replica and closing the deferring client. This
keeps the timeout-then-reblock regression and verifies an actual shutdown;
the exit wait and crash check are unchanged. No server code is modified.

Backport-Source-PR: 5396
CI-Fix-Job: test-ubuntu-no-malloc-usable-size
CI-Fix-Run: https://github.com/sarthakaggarwal97/valkey/actions/runs/44048440217
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
…-io#5396)

The test sends SHUTDOWN to the primary, resumes the replica and ends its
block without waiting for the shutdown to finish. In the log the primary
(pid 56270) prints "Valkey is now ready to exit, bye bye..." at
10:09:03.797 and the next line is "signal-handler Received SIGTERM
scheduling shutdown...". The process was still alive running
LeakSanitizer's exit-time check when kill_server in
tests/support/server.tcl found it alive and sent SIGTERM. The
interrupted leak check wrote the LeakSanitizer warning to stderr, and
check_sanitizer_errors reported it as a failure. The test itself passed.

The test asks the primary to shut down, so the process exiting is the
state it depends on. The primary always exits on its own here:
serverCron finishes the shutdown once the replica is in sync or gone, or
when the default 10 second shutdown-timeout expires. The patch waits up
to 50 seconds for the pid to disappear, using the same is_alive check
kill_server uses, so kill_server takes its already-dead path and sends
no signal. The existing crash-log assertion now runs after the shutdown
has completed instead of possibly before it, which makes the test
stricter, not weaker. No report is ignored and no product source is
touched.

CI-Fix-Job: test-sanitizer-address (gcc)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
Backport-Source-PR: 5396
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
…valkey-io#5396)

All three FAIL messages reached every node within about 65 ms, and the
replica of the third primary won epoch 11 at 10:06:20.101. That win
lowered the failed primary rank of the other two replicas by one, which
moved both of their election times 500 ms earlier and into the past.
Both started an election for epoch 12 within the same millisecond
(10:06:20.198 and .199). The five voters split 3 to 2 and the quorum is
4, so neither won. On 9.0 a replica restarts its election early only
when it sees a primary claim an equal or higher epoch
(cluster_legacy.c:3785). With no winner there was no such claim, so both
waited for the 30 second timeout ("Failover attempt expired" from
10:06:50) and the 60 second retry, past the test's 50 second wait. The
random part of the delay (0 to 500 ms) is as large as the 500 ms spacing
per rank, so a rank decrement can always cancel the spacing.

The default branch removes split votes in product code with the
FAILOVER_AUTH_NACK message (f2c1c5e).
That is a new cluster bus message type and new DEBUG subcommands, not
something to backport to a release branch, so the fix here has to be in
the test. The property 9.0 does guarantee is that a replica whose
election epoch is won by another replica restarts as soon as it sees the
winner. The test now forces exactly that. All replicas start with
cluster-replica-no-failover yes and the test waits until nodes 3 to 9
see the three paused primaries as fail. R 8 then drops all cluster bus
packets while R 7 is released and wins. R 8 is released next and, still
on the old epoch, starts its election in the epoch R 7 won, where the
four healthy primaries have already voted. Once the filter is removed, R
8 sees R 7's claim, resets, and must become primary within the existing
wait. R 9 is released last. The original checks for no "Failover attempt
expired" and no "epoch 0" message are unchanged, so a regression in the
reset logic still fails the test. Because there is always exactly one
winner per epoch, the no-winner split cannot occur. The packet filter
and link-close DEBUG switches are the ones
test_replica_config_epoch_failover already uses in this file.

CI-Fix-Job: test-sanitizer-address (clang)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
Backport-Source-PR: 5396
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
…lkey-io#5396)

The election delay scales with cluster-node-timeout: delay =
min(node_timeout / 30, 500), plus a random 0..delay, plus rank * 2 *
delay. With the test's node timeout of 5000 the delay is 166 ms, so rank
1 starts only 167 to 497 ms after rank 0, before the 100 ms cron
granularity. In the log, node #5 (d3af1bb, rank 0, offset 1319) was
delayed 323 ms and node #10 (ae5ac, rank 1, offset 671) 523 ms. #5
started its election for epoch 16 at 10:08:34.498 and won at 34.618. #10
started its own election for epoch 17 at 34.629, before #5's new
configuration had reached the voters or #10 itself (they logged it at
34.654 to 34.660). The primaries granted epoch 17 to #10 at 34.635, #10
won with the higher config epoch and #5 was demoted to its replica. A
failover did happen, but to the replica the test does not expect, so
both tests timed out.

The server honoured the rank delay; rank ordering is a best-effort
delay, not a guarantee, so the test was relying on a margin the 5000 ms
node timeout does not provide on a slow runner. In this run #5's
election took about 120 ms plus about 40 ms to propagate, and it started
about 90 ms late. With the default node timeout of 15000 the delay is
500 ms and the rank step 1000 ms, so the gap is at least about 500 ms,
which is the server's default production timing. The test still lets
both replicas compete and still requires #5 to win and #10 to replicate
it, so nothing is weakened. The repository fixed the same class of flake
in failover2.tcl the same way, by raising cluster-node-timeout to 15000
(valkey-io#2793, valkey-io#3946). Only the first cluster is changed; the second cluster's
test accepts any replica as the new primary and passed.

CI-Fix-Job: test-alpine-32bit
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728

Backport-Source-PR: 5396
sarthakaggarwal97 added a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
The previous BLPOP can still be blocked when the test checks the generic
blocked-client count. In the failing run the client was closed with BLPOP
still active and SHUTDOWN queued in its input buffer, so the primary never
received a shutdown request and the exit wait correctly failed.

Require cmd=shutdown as well as the existing client and blocked-client
counts before resuming the replica and closing the deferring client. This
keeps the timeout-then-reblock regression and verifies an actual shutdown;
the exit wait and crash check are unchanged. No server code is modified.

Backport-Source-PR: 5396
CI-Fix-Job: test-ubuntu-no-malloc-usable-size
CI-Fix-Run: https://github.com/sarthakaggarwal97/valkey/actions/runs/44048440217
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
…-io#5396)

The test sends SHUTDOWN to the primary, resumes the replica and ends its
block without waiting for the shutdown to finish. In the log the primary
(pid 56270) prints "Valkey is now ready to exit, bye bye..." at
10:09:03.797 and the next line is "signal-handler Received SIGTERM
scheduling shutdown...". The process was still alive running
LeakSanitizer's exit-time check when kill_server in
tests/support/server.tcl found it alive and sent SIGTERM. The
interrupted leak check wrote the LeakSanitizer warning to stderr, and
check_sanitizer_errors reported it as a failure. The test itself passed.

The test asks the primary to shut down, so the process exiting is the
state it depends on. The primary always exits on its own here:
serverCron finishes the shutdown once the replica is in sync or gone, or
when the default 10 second shutdown-timeout expires. The patch waits up
to 50 seconds for the pid to disappear, using the same is_alive check
kill_server uses, so kill_server takes its already-dead path and sends
no signal. The existing crash-log assertion now runs after the shutdown
has completed instead of possibly before it, which makes the test
stricter, not weaker. No report is ignored and no product source is
touched.

CI-Fix-Job: test-sanitizer-address (gcc)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
Backport-Source-PR: 5396
sarthakaggarwal97 added a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
The previous BLPOP can still be blocked when the test checks the generic
blocked-client count. In the failing run the client was closed with BLPOP
still active and SHUTDOWN queued in its input buffer, so the primary never
received a shutdown request and the exit wait correctly failed.

Require cmd=shutdown as well as the existing client and blocked-client
counts before resuming the replica and closing the deferring client. This
keeps the timeout-then-reblock regression and verifies an actual shutdown;
the exit wait and crash check are unchanged. No server code is modified.

Backport-Source-PR: 5396
CI-Fix-Job: test-ubuntu-no-malloc-usable-size
CI-Fix-Run: https://github.com/sarthakaggarwal97/valkey/actions/runs/44048440217
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
…-io#5396)

The test sends SHUTDOWN to the primary, resumes the replica and ends its
block without waiting for the shutdown to finish. In the log the primary
(pid 56270) prints "Valkey is now ready to exit, bye bye..." at
10:09:03.797 and the next line is "signal-handler Received SIGTERM
scheduling shutdown...". The process was still alive running
LeakSanitizer's exit-time check when kill_server in
tests/support/server.tcl found it alive and sent SIGTERM. The
interrupted leak check wrote the LeakSanitizer warning to stderr, and
check_sanitizer_errors reported it as a failure. The test itself passed.

The test asks the primary to shut down, so the process exiting is the
state it depends on. The primary always exits on its own here:
serverCron finishes the shutdown once the replica is in sync or gone, or
when the default 10 second shutdown-timeout expires. The patch waits up
to 50 seconds for the pid to disappear, using the same is_alive check
kill_server uses, so kill_server takes its already-dead path and sends
no signal. The existing crash-log assertion now runs after the shutdown
has completed instead of possibly before it, which makes the test
stricter, not weaker. No report is ignored and no product source is
touched.

CI-Fix-Job: test-sanitizer-address (gcc)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
Backport-Source-PR: 5396
sarthakaggarwal97 added a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
The previous BLPOP can still be blocked when the test checks the generic
blocked-client count. In the failing run the client was closed with BLPOP
still active and SHUTDOWN queued in its input buffer, so the primary never
received a shutdown request and the exit wait correctly failed.

Require cmd=shutdown as well as the existing client and blocked-client
counts before resuming the replica and closing the deferring client. This
keeps the timeout-then-reblock regression and verifies an actual shutdown;
the exit wait and crash check are unchanged. No server code is modified.

Backport-Source-PR: 5396
CI-Fix-Job: test-ubuntu-no-malloc-usable-size
CI-Fix-Run: https://github.com/sarthakaggarwal97/valkey/actions/runs/44048440217
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
The test sends SHUTDOWN to the primary, resumes the replica and ends its
block without waiting for the shutdown to finish. In the log the primary
(pid 56270) prints "Valkey is now ready to exit, bye bye..." at
10:09:03.797 and the next line is "signal-handler Received SIGTERM
scheduling shutdown...". The process was still alive running
LeakSanitizer's exit-time check when kill_server in
tests/support/server.tcl found it alive and sent SIGTERM. The
interrupted leak check wrote the LeakSanitizer warning to stderr, and
check_sanitizer_errors reported it as a failure. The test itself passed.

The test asks the primary to shut down, so the process exiting is the
state it depends on. The primary always exits on its own here:
serverCron finishes the shutdown once the replica is in sync or gone, or
when the default 10 second shutdown-timeout expires. The patch waits up
to 50 seconds for the pid to disappear, using the same is_alive check
kill_server uses, so kill_server takes its already-dead path and sends
no signal. The existing crash-log assertion now runs after the shutdown
has completed instead of possibly before it, which makes the test
stricter, not weaker. No report is ignored and no product source is
touched.

CI-Fix-Job: test-sanitizer-address (gcc)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
Backport-Source-PR: 5396
sarthakaggarwal97 added a commit that referenced this pull request Nov 18, 2026
The previous BLPOP can still be blocked when the test checks the generic
blocked-client count. In the failing run the client was closed with BLPOP
still active and SHUTDOWN queued in its input buffer, so the primary never
received a shutdown request and the exit wait correctly failed.

Require cmd=shutdown as well as the existing client and blocked-client
counts before resuming the replica and closing the deferring client. This
keeps the timeout-then-reblock regression and verifies an actual shutdown;
the exit wait and crash check are unchanged. No server code is modified.

Backport-Source-PR: 5396
CI-Fix-Job: test-ubuntu-no-malloc-usable-size
CI-Fix-Run: https://github.com/sarthakaggarwal97/valkey/actions/runs/44048440217
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
The test sends SHUTDOWN to the primary, resumes the replica and ends its
block without waiting for the shutdown to finish. In the log the primary
(pid 56270) prints "Valkey is now ready to exit, bye bye..." at
10:09:03.797 and the next line is "signal-handler Received SIGTERM
scheduling shutdown...". The process was still alive running
LeakSanitizer's exit-time check when kill_server in
tests/support/server.tcl found it alive and sent SIGTERM. The
interrupted leak check wrote the LeakSanitizer warning to stderr, and
check_sanitizer_errors reported it as a failure. The test itself passed.

The test asks the primary to shut down, so the process exiting is the
state it depends on. The primary always exits on its own here:
serverCron finishes the shutdown once the replica is in sync or gone, or
when the default 10 second shutdown-timeout expires. The patch waits up
to 50 seconds for the pid to disappear, using the same is_alive check
kill_server uses, so kill_server takes its already-dead path and sends
no signal. The existing crash-log assertion now runs after the shutdown
has completed instead of possibly before it, which makes the test
stricter, not weaker. No report is ignored and no product source is
touched.

Release-branch adaptations contributed by Sarthak Aggarwal <[email protected]>.

CI-Fix-Job: test-sanitizer-address (gcc)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
Backport-Source-PR: 5396
Backport-Adaptation: Wait for SHUTDOWN itself to block before closing the deferring client, then wait for the primary to exit before checking its crash log.
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
)

The election delay scales with cluster-node-timeout: delay =
min(node_timeout / 30, 500), plus a random 0..delay, plus rank * 2 *
delay. With the test's node timeout of 5000 the delay is 166 ms, so rank
1 starts only 167 to 497 ms after rank 0, before the 100 ms cron
granularity. In the log, node #5 (d3af1bb, rank 0, offset 1319) was
delayed 323 ms and node #10 (ae5ac, rank 1, offset 671) 523 ms. #5
started its election for epoch 16 at 10:08:34.498 and won at 34.618. #10
started its own election for epoch 17 at 34.629, before #5's new
configuration had reached the voters or #10 itself (they logged it at
34.654 to 34.660). The primaries granted epoch 17 to #10 at 34.635, #10
won with the higher config epoch and #5 was demoted to its replica. A
failover did happen, but to the replica the test does not expect, so
both tests timed out.

The server honoured the rank delay; rank ordering is a best-effort
delay, not a guarantee, so the test was relying on a margin the 5000 ms
node timeout does not provide on a slow runner. In this run #5's
election took about 120 ms plus about 40 ms to propagate, and it started
about 90 ms late. With the default node timeout of 15000 the delay is
500 ms and the rank step 1000 ms, so the gap is at least about 500 ms,
which is the server's default production timing. The test still lets
both replicas compete and still requires #5 to win and #10 to replicate
it, so nothing is weakened. The repository fixed the same class of flake
in failover2.tcl the same way, by raising cluster-node-timeout to 15000
(#2793, #3946). Only the first cluster is changed; the second cluster's
test accepts any replica as the new primary and passed.

CI-Fix-Job: test-alpine-32bit
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728

Backport-Source-PR: 5396
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
The test sends SHUTDOWN to the primary, resumes the replica and ends its
block without waiting for the shutdown to finish. In the log the primary
(pid 56270) prints "Valkey is now ready to exit, bye bye..." at
10:09:03.797 and the next line is "signal-handler Received SIGTERM
scheduling shutdown...". The process was still alive running
LeakSanitizer's exit-time check when kill_server in
tests/support/server.tcl found it alive and sent SIGTERM. The
interrupted leak check wrote the LeakSanitizer warning to stderr, and
check_sanitizer_errors reported it as a failure. The test itself passed.

The test asks the primary to shut down, so the process exiting is the
state it depends on. The primary always exits on its own here:
serverCron finishes the shutdown once the replica is in sync or gone, or
when the default 10 second shutdown-timeout expires. The patch waits up
to 50 seconds for the pid to disappear, using the same is_alive check
kill_server uses, so kill_server takes its already-dead path and sends
no signal. The existing crash-log assertion now runs after the shutdown
has completed instead of possibly before it, which makes the test
stricter, not weaker. No report is ignored and no product source is
touched.

Release-branch adaptations contributed by Sarthak Aggarwal <[email protected]>.

CI-Fix-Job: test-sanitizer-address (gcc)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
Backport-Source-PR: 5396
Backport-Adaptation: Wait for SHUTDOWN itself to block before closing the deferring client, then wait for the primary to exit before checking its crash log.
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
…#5396)

All three FAIL messages reached every node within about 65 ms, and the
replica of the third primary won epoch 11 at 10:06:20.101. That win
lowered the failed primary rank of the other two replicas by one, which
moved both of their election times 500 ms earlier and into the past.
Both started an election for epoch 12 within the same millisecond
(10:06:20.198 and .199). The five voters split 3 to 2 and the quorum is
4, so neither won. On 9.0 a replica restarts its election early only
when it sees a primary claim an equal or higher epoch
(cluster_legacy.c:3785). With no winner there was no such claim, so both
waited for the 30 second timeout ("Failover attempt expired" from
10:06:50) and the 60 second retry, past the test's 50 second wait. The
random part of the delay (0 to 500 ms) is as large as the 500 ms spacing
per rank, so a rank decrement can always cancel the spacing.

The default branch removes split votes in product code with the
FAILOVER_AUTH_NACK message (f2c1c5e).
That is a new cluster bus message type and new DEBUG subcommands, not
something to backport to a release branch, so the fix here has to be in
the test. The property 9.0 does guarantee is that a replica whose
election epoch is won by another replica restarts as soon as it sees the
winner. The test now forces exactly that. All replicas start with
cluster-replica-no-failover yes and the test waits until nodes 3 to 9
see the three paused primaries as fail. R 8 then drops all cluster bus
packets while R 7 is released and wins. R 8 is released next and, still
on the old epoch, starts its election in the epoch R 7 won, where the
four healthy primaries have already voted. Once the filter is removed, R
8 sees R 7's claim, resets, and must become primary within the existing
wait. R 9 is released last. The original checks for no "Failover attempt
expired" and no "epoch 0" message are unchanged, so a regression in the
reset logic still fails the test. Because there is always exactly one
winner per epoch, the no-winner split cannot occur. The packet filter
and link-close DEBUG switches are the ones
test_replica_config_epoch_failover already uses in this file.

CI-Fix-Job: test-sanitizer-address (clang)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
Backport-Source-PR: 5396
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
)

The election delay scales with cluster-node-timeout: delay =
min(node_timeout / 30, 500), plus a random 0..delay, plus rank * 2 *
delay. With the test's node timeout of 5000 the delay is 166 ms, so rank
1 starts only 167 to 497 ms after rank 0, before the 100 ms cron
granularity. In the log, node #5 (d3af1bb, rank 0, offset 1319) was
delayed 323 ms and node #10 (ae5ac, rank 1, offset 671) 523 ms. #5
started its election for epoch 16 at 10:08:34.498 and won at 34.618. #10
started its own election for epoch 17 at 34.629, before #5's new
configuration had reached the voters or #10 itself (they logged it at
34.654 to 34.660). The primaries granted epoch 17 to #10 at 34.635, #10
won with the higher config epoch and #5 was demoted to its replica. A
failover did happen, but to the replica the test does not expect, so
both tests timed out.

The server honoured the rank delay; rank ordering is a best-effort
delay, not a guarantee, so the test was relying on a margin the 5000 ms
node timeout does not provide on a slow runner. In this run #5's
election took about 120 ms plus about 40 ms to propagate, and it started
about 90 ms late. With the default node timeout of 15000 the delay is
500 ms and the rank step 1000 ms, so the gap is at least about 500 ms,
which is the server's default production timing. The test still lets
both replicas compete and still requires #5 to win and #10 to replicate
it, so nothing is weakened. The repository fixed the same class of flake
in failover2.tcl the same way, by raising cluster-node-timeout to 15000
(#2793, #3946). Only the first cluster is changed; the second cluster's
test accepts any replica as the new primary and passed.

CI-Fix-Job: test-alpine-32bit
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728

Backport-Source-PR: 5396
sarthakaggarwal97 added a commit that referenced this pull request Nov 18, 2026
> [!NOTE]
> **Opened ready despite 6 flagged items** (`force_ready` was set):
notes flagged low-confidence; release-safety guardrail overrode AI
triage; AI triaged PRs without release-notes (confirm include/exclude);
release lines contradict each other about a note; commits whose PR could
not be fetched; a distinct commit was dropped by a reused PR number.
Review the sections below and confirm before merging.

Cuts **7.2.16** onto release line `7.2`.

- Promotes the release notes into a dated section, bumps
`src/version.h`, and refreshes the running contributor list.
- Release notes computed over the range below
(`7.2.15..8991aee`):

```
mode: ga
source_ref: 7.2
target_branch: 7.2
base: 7.2.15 @ 20e068c
head: 8991aee @ 8991aee
```

### ⚠️ Notes to double-check

The generator flagged these notes low-confidence; confirm category and
wording before merging:

| PR | Category | Why flagged |
|----|----------|-------------|
| #5046 | Bug Fixes | explicit impact scope omitted: macOS |
| #4775 | Bug Fixes | could be Performance and Efficiency Improvements |
| #5246 | Bug Fixes | Schema-only change, server reply unchanged, so may
not be user-facing; PR also covers GET-PRIMARY-ADDR-BY-NAME, omitted
because the 7.2 commit title names only the MASTER command |

### Release-impact review

Code detected release-impact terms (availability, memory safety, data
integrity, access control, protocol, compatibility) in these PRs; this
forces review, it is not a severity classification.

The requested urgency is **SECURITY**. Confirm it and decide whether any
change needs a hand-authored **Security Fixes** entry:

⚠️ [#5178](#5178) names
**CVE-2021-32627**;
[#5163](#5163) names
**CVE-2021-32627**. A named CVE normally ships with `SECURITY` urgency
and a hand-authored **Security Fixes** entry; this holds the cut at any
other urgency.

<details>
<summary>26 PR(s) with impact signals</summary>

| PR | Title | Signal |
|----|-------|--------|
| [#5133](#5133) | Keep sds
lengths in size_t when comparing and caching keys | server crash,
assertion, or availability failure |
| [#5128](#5128) | Propagate
PFADD elements applied before an INVALIDOBJ error | data or
persisted-state corruption risk |
| [#5159](#5159) | Fill
unmatched postponed reply lengths left by a module | server crash,
assertion, or availability failure |
| [#4351](#4351) | Fix NULL
deref in usUntilEarliestTimer when all time events are deleted | server
crash, assertion, or availability failure |
| [#4665](#4665) | Check the
SORT destination that is actually written | security, access-control, or
injection hardening |
| [#5178](#5178) | Check XADD
element size before creating the stream | server crash, assertion, or
availability failure |
| [#5180](#5180) | Redact HELLO,
AUTH and MIGRATE credentials before validating arguments | security,
access-control, or injection hardening |
| [#4929](#4929) | Guard NULL
replica_primary_host in Sentinel INFO handling | server crash,
assertion, or availability failure |
| [#5087](#5087) | Treat key
specs that start past the last argument as matching no keys |
memory-safety risk |
| [#5187](#5187) | Defer freeing
the client that runs a replication role change | server crash,
assertion, or availability failure |
| [#5163](#5163) | Fix integer
overflow in _quicklistNodeAllowMerge size check | server crash,
assertion, or availability failure |
| [#5146](#5146) | Fix integer
overflow in SORT BY/GET pattern key substitution | undefined behavior or
unsafe arithmetic |
| [#5155](#5155) | Reject
ValkeyModule_Calloc requests whose nmemb * size overflows | server
crash, assertion, or availability failure |
| [#5124](#5124) | Reject sparse
HLLs that end in a truncated XZERO opcode | data or persisted-state
corruption risk |
| [#5138](#5138) | Fix
hllSparseSet aborting on SDS_TYPE_5 strings when deltalen is zero |
server crash, assertion, or availability failure |
| [#5184](#5184) | Treat a
replica with no known primary as owning no slots | server crash,
assertion, or availability failure |
| [#5126](#5126) | Reject a
+CONTINUE reply to PSYNC when there is no cached primary | server crash,
assertion, or availability failure |
| [#5137](#5137) | Ignore ping
extension values that nodes.conf cannot load | data or persisted-state
corruption risk |
| [#5065](#5065) | Cap the
length of inbound cluster bus packets | security, access-control, or
injection hardening |
| [#3848](#3848) | Fix cluster
AUX-field control-character and delimiter injection | data or
persisted-state corruption risk |
| [#3229](#3229) | Converge
divergent shard-id persisted in nodes.conf to master's shard… | data or
persisted-state corruption risk |
| [#5085](#5085) | Disconnect
default user subscribers to revoked channels on ACL LOAD | security,
access-control, or injection hardening |
| [#5349](#5349) | Treat a torn
annotation at the end of an AOF file as a short read | server crash,
assertion, or availability failure |
| [#5435](#5435) | Don't free
the client that is executing a command when a blocked client's
re-executed command evicts clients | memory-safety risk |
| [#5134](#5134) | Do not adopt
the MYSELF flag from a gossip entry | server crash, assertion, or
availability failure |
| [#5246](#5246) | Allow null in
SENTINEL GET-PRIMARY-ADDR-BY-NAME reply schema | wire-protocol or reply
correctness |

</details>

### Excluded from generated notes (listed under Security Fixes)

#5435 was supplied as a `--security-fix`, so the generated bullet(s) in
the normal categories were dropped to avoid double-listing. To keep the
notes consistent, it appears only under **Security Fixes**, where each
is reviewed as a factual security entry.

### ⚠️ Release-safety guardrail overrode AI triage

AI excluded these PRs (or gave no verdict) but their text names a
release-impact signal, so code forced them into the notes; confirm each
bullet, category, urgency, and security treatment:

| PR | Title | Guardrail reason |
|----|-------|------------------|
| [#5246](#5246) | Allow null in
SENTINEL GET-PRIMARY-ADDR-BY-NAME reply schema | ⚠️ release-safety
guardrail (wire-protocol or reply correctness; AI exclusion) |

### Triage summary

- 27 PR(s) triaged into the notes
- 16 PR(s) triaged out

Per-PR verdicts (with reasons) are in the run's `triage-verdicts`
artifact. To include a wrongly-dropped PR, label it `release-notes` and
re-cut.

### ⚠️ Commits whose PR could not be fetched

These range commits name a PR that could not be fetched and are
**absent** from the notes; note any user-facing change by hand:

| Commit | PR referenced |
|--------|---------------|
| `525e89e1b6b6` | #13071 |
| `e1c52f05a9fe` | #12930 |

### ⚠️ Commits dropped by a reused PR number

Two commits resolved to the same `(#N)`; the one below was **dropped**
and is absent from the notes, so note it by hand if it is a separate
user-facing change:

| Dropped commit | Subject | Reused # | Kept commit |
|----------------|---------|----------|-------------|
| `01d9ab7c7668` | Wait for SHUTDOWN to block before closing its client
(#5396) | #5396 | `8445a35ed8ab` |
| `2ae815571c82` | Run cluster packet regressions in the default suite
(#5065) | #5065 | `d8b0f7252d38` |
| `2a2f72749182` | Run replica-detach regressions in the default suite
(#5184) | #5184 | `d62ccbcc9b3b` |

### ⚠️ Release lines disagree about a note

Another release line already published a note for these PRs, but this
cut kept its own wording, so the entries will not read identically:

⚠️ #5133: the two lines contradict each other about the change itself,
not just its wording, which code must not resolve on its own. Read the
note on each line and settle which one is right before merging.

<details>
<summary>3 note(s) not reusing published wording</summary>

| PR | Other line | Why the wording was not reused |
|----|------------|--------------------------------|
| #5133 | `9.2` (Valkey 9.2.0-rc2) | ⚠️ `9.2` limits the change to
32-bit but this cut's note says no environment limit, so the lines
disagree about how far the change reaches |
| #5178 | `9.2` (Valkey 9.2.0-rc2) | the PR names a CVE, so its wording
is authored per release line by a human |
| #5163 | `9.2` (Valkey 9.2.0-rc2) | the PR names a CVE, so its wording
is authored per release line by a human |

</details>

### Wording carried from other release lines

A backported change is cut once per release line, and each cut words its
notes independently. To keep one commit from being described differently
per branch, a note whose source PR another line already published takes
that published wording verbatim (joined on the trailing `(#N)`, which
always names the original source PR). Only the text is reused; the
category, the `by @handle` credit, and the `(#N)` are this cut's own.

- Release lines consulted: `9.2`, `9.1`, `9.0`, `8.1`, `8.0`, `7.0`,
`6.2`, `6.0`, `5.0`, `4.0`, `3.2`, `3.0`, `2.8`, `2.6`, `2.4`, `2.2`
- Reused published wording for 22 note(s)

<details>
<summary>22 note(s) reusing published wording</summary>

| PR | Wording from | Carried wording | This cut generated |
|----|--------------|-----------------|--------------------|
| #5210 | `9.2` (Valkey 9.2.0-rc2) | Correct command metadata to
describe the `ZINCRBY` increment and
`ZINTER`/`ZINTERSTORE`/`ZUNION`/`ZUNIONSTORE` weights as doubles instead
of integers | Fix command metadata to describe the `ZINCRBY` increment
and the `ZINTER`, `ZINTERSTORE`, `ZUNION` and `ZUNIONSTORE` weights as
doubles instead of integers |
| #5128 | `9.2` (Valkey 9.2.0-rc2) | Propagate `PFADD` elements applied
before a corrupted-HLL INVALIDOBJ error so replicas and the AOF stay
consistent with the primary | Fix `PFADD` on a corrupted sparse
HyperLogLog not propagating elements applied before the `INVALIDOBJ`
error to replicas, the AOF, `WATCH` and client tracking |
| #5159 | `9.2` (Valkey 9.2.0-rc2) | Fix a server crash when a module
never sets a postponed reply length; the leftover placeholder is now
filled with an empty array | Fix a server crash when a module replies
with a postponed-length array, map, set or attribute and never sets its
length |
| #5212 | `9.2` (Valkey 9.2.0-rc2) | Mark the `RESTORE` and
`RESTORE-ASKING` `IDLETIME` and `FREQ` options as mutually exclusive in
command metadata | Fix `RESTORE` and `RESTORE-ASKING` command metadata
to mark `IDLETIME` and `FREQ` as mutually exclusive |
| #5118 | `9.2` (Valkey 9.2.0-rc2) | Fix a server panic when a Lua
script returns or raises an error table whose metatable has an `__index`
metamethod that raises an error | Fix the server exiting when a Lua
script returns or raises an error table whose metatable has a raising
`__index` |
| #5120 | `9.2` (Valkey 9.2.0-rc2) | Fix a memory leak when
`server.register_function` named arguments are repeated in a different
letter case | Fix a memory leak in `server.register_function` when a
named argument is repeated with different letter case |
| #5213 | `9.2` (Valkey 9.2.0-rc2) | Correct expiry command metadata to
show that `XX` can be combined with `GT` or `LT`, rather than all four
conditions being mutually exclusive | Fix command metadata for the
`EXPIRE` and `HEXPIRE` command families to show that `XX` can be
combined with `GT` or `LT` |
| #5046 | `9.2` (Valkey 9.2.0-rc2) | Fix a memory leak in
`ValkeyModule_GetCommandKeysWithFlags` when introspecting commands with
large key lists | Fix a memory leak in
`ValkeyModule_GetCommandKeysWithFlags` for commands with large key lists
|
| #4775 | `9.2` (Valkey 9.2.0-rc2) | Bound the time spent per cycle
evicting keys from the client tracking table, avoiding long stalls after
lowering `tracking-table-max-keys` | Fix long server stalls after
lowering `tracking-table-max-keys` by bounding the time spent evicting
keys from the client tracking table per call |
| #5208 | `9.2` (Valkey 9.2.0-rc2) | Correct `SENTINEL SIMULATE-FAILURE`
metadata so `COMMAND DOCS` shows the required mode argument and its
tokens | Fix `SENTINEL SIMULATE-FAILURE` argument metadata so `COMMAND
DOCS` reports the mode as required and includes its tokens |
| #3510 | `9.2` (Valkey 9.2.0-rc1) | Fix a TLS busy loop that consumed
100% CPU when a connection's read or write handler was removed while
OpenSSL was waiting for the opposite event | Fix a TLS busy loop
consuming 100% CPU when a connection's read or write handler is removed
while OpenSSL is waiting on the opposite event |
| #4351 | `9.2` (Valkey 9.2.0-rc1) | Fix a crash caused by a NULL
pointer dereference when all timer events in an event loop are pending
deletion | Fix a NULL dereference crash in the event loop when all time
events are pending deletion |
| #4665 | `9.2` (Valkey 9.2.0-rc1) | Fix `SORT` key extraction so a
`STORE` destination named like an option can no longer bypass ACL checks
and write to an unauthorized key | Fix `SORT` checking ACL key
permissions against the wrong key when a `STORE` destination is named
like an option, which allowed writes to keys outside the user's allowed
patterns |
| #4777 | `9.2` (Valkey 9.2.0-rc2) | Fix `GEOSEARCH` returning empty
results for exact zero-distance matches on builds where floating-point
contraction breaks the latitude distance calculation | Fix `GEOSEARCH`
with a zero radius or box missing the exact-position member on some
builds due to floating-point precision |
| #5180 | `9.2` (Valkey 9.2.0-rc2) | Redact credentials of rejected
`HELLO`, `AUTH` and `MIGRATE` commands so passwords no longer leak to
MONITOR and the commandlog | Redact `HELLO`, `AUTH` and `MIGRATE`
credentials in `MONITOR` and the commandlog even when the command is
rejected for invalid arguments |
| #5244 | `9.2` (Valkey 9.2.0-rc2) | Correct `ZADD` and `LCS` metadata
so `COMMAND DOCS` and valkey-cli hints no longer present `NX` with
`GT`/`LT` or `LEN` with `IDX` as valid combinations | Fix `ZADD` and
`LCS` command metadata so `COMMAND DOCS` and valkey-cli hints mark
mutually exclusive options (`NX` with `GT`/`LT`, `LEN` with `IDX`) |
| #5187 | `9.2` (Valkey 9.2.0-rc2) | Fix a crash when a replication role
change command such as `REPLICAOF` or `CLUSTER REPLICATE` arrives over a
replication link | Fix a crash when a replication role change command
such as `REPLICAOF`, `CLUSTER REPLICATE`, `CLUSTER RESET` or `CLUSTER
FAILOVER TAKEOVER` arrives over a replication link |
| #5126 | `9.2` (Valkey 9.2.0-rc2) | Prevent a replica crash when the
primary wrongly replies +CONTINUE to a full resync request; the replica
now drops the link and retries | Fix a replica crash when the primary
replies `+CONTINUE` to a full resync `PSYNC` request and there is no
cached primary |
| #4171 | `9.2` (Valkey 9.2.0-rc1) | Fix a node staying stuck in PFAIL
when its PING is lost while the peer's own traffic keeps the cluster
link alive | Fix a cluster node staying stuck in PFAIL state when its
PING is lost but the peer's own PINGs keep the link alive |
| #5137 | `9.2` (Valkey 9.2.0-rc2) | Ignore invalid ping extension
values from cluster peers that would corrupt nodes.conf and prevent the
node from restarting | Ignore invalid cluster bus ping extension values
(hostname, node name, client IPs, availability zone) that would corrupt
nodes.conf and prevent the node from restarting |
| #5161 | `9.2` (Valkey 9.2.0-rc2) | Bound the bytes the cluster bus
reads per event so a peer with a constant read backlog cannot starve
clients, cron and heartbeats | Limit the bytes read per event from a
cluster bus link so a peer that keeps sending cannot starve clients,
cron and heartbeats |
| #4190 | `9.2` (Valkey 9.2.0-rc2) | Reclaim client-side caching
tracking table entries left by disconnected clients, fixing a memory
leak under read-heavy workloads, and include the tracking table in
active defrag | Fix a memory leak in client-side caching where IDs of
disconnected clients stayed in the tracking table for keys that are
never modified |

</details>

*Generated by valkey-ci-agent. Review before merging into the release
line.*

---------

Signed-off-by: valkeyrie-bot[bot] <3692572+valkeyrie-bot[bot]@users.noreply.github.com>
Signed-off-by: Sarthak Aggarwal <[email protected]>
Co-authored-by: valkeyrie-bot[bot] <3692572+valkeyrie-bot[bot]@users.noreply.github.com>
Co-authored-by: Sarthak Aggarwal <[email protected]>
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
The test sends SHUTDOWN to the primary, resumes the replica and ends its
block without waiting for the shutdown to finish. In the log the primary
(pid 56270) prints "Valkey is now ready to exit, bye bye..." at
10:09:03.797 and the next line is "signal-handler Received SIGTERM
scheduling shutdown...". The process was still alive running
LeakSanitizer's exit-time check when kill_server in
tests/support/server.tcl found it alive and sent SIGTERM. The
interrupted leak check wrote the LeakSanitizer warning to stderr, and
check_sanitizer_errors reported it as a failure. The test itself passed.

The test asks the primary to shut down, so the process exiting is the
state it depends on. The primary always exits on its own here:
serverCron finishes the shutdown once the replica is in sync or gone, or
when the default 10 second shutdown-timeout expires. The patch waits up
to 50 seconds for the pid to disappear, using the same is_alive check
kill_server uses, so kill_server takes its already-dead path and sends
no signal. The existing crash-log assertion now runs after the shutdown
has completed instead of possibly before it, which makes the test
stricter, not weaker. No report is ignored and no product source is
touched.

Release-branch adaptations contributed by Sarthak Aggarwal <[email protected]>.

CI-Fix-Job: test-sanitizer-address (gcc)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
Backport-Source-PR: 5396
Backport-Adaptation: Wait for SHUTDOWN itself to block before closing the deferring client, then wait for the primary to exit before checking its crash log.
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
)

The election delay scales with cluster-node-timeout: delay =
min(node_timeout / 30, 500), plus a random 0..delay, plus rank * 2 *
delay. With the test's node timeout of 5000 the delay is 166 ms, so rank
1 starts only 167 to 497 ms after rank 0, before the 100 ms cron
granularity. In the log, node #5 (d3af1bb, rank 0, offset 1319) was
delayed 323 ms and node #10 (ae5ac, rank 1, offset 671) 523 ms. #5
started its election for epoch 16 at 10:08:34.498 and won at 34.618. #10
started its own election for epoch 17 at 34.629, before #5's new
configuration had reached the voters or #10 itself (they logged it at
34.654 to 34.660). The primaries granted epoch 17 to #10 at 34.635, #10
won with the higher config epoch and #5 was demoted to its replica. A
failover did happen, but to the replica the test does not expect, so
both tests timed out.

The server honoured the rank delay; rank ordering is a best-effort
delay, not a guarantee, so the test was relying on a margin the 5000 ms
node timeout does not provide on a slow runner. In this run #5's
election took about 120 ms plus about 40 ms to propagate, and it started
about 90 ms late. With the default node timeout of 15000 the delay is
500 ms and the rank step 1000 ms, so the gap is at least about 500 ms,
which is the server's default production timing. The test still lets
both replicas compete and still requires #5 to win and #10 to replicate
it, so nothing is weakened. The repository fixed the same class of flake
in failover2.tcl the same way, by raising cluster-node-timeout to 15000
(#2793, #3946). Only the first cluster is changed; the second cluster's
test accepts any replica as the new primary and passed.

CI-Fix-Job: test-alpine-32bit
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728

Backport-Source-PR: 5396
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
> [!NOTE]
> **Opened ready despite 6 flagged items** (`force_ready` was set):
notes flagged low-confidence; release-safety guardrail overrode AI
triage; AI triaged PRs without release-notes (confirm include/exclude);
release lines contradict each other about a note; notes credited to a
backport; a distinct commit was dropped by a reused PR number. Review
the sections below and confirm before merging.

Cuts **9.1.4** onto release line `9.1`.

- Promotes the release notes into a dated section, bumps
`src/version.h`, and refreshes the running contributor list.
- Release notes computed over the range below
(`9.1.3..2bc716e`):

```
mode: ga
source_ref: 9.1
target_branch: 9.1
base: 9.1.3 @ 29173b6
head: 2bc716e @ 2bc716e
```

### ⚠️ Notes to double-check

The generator flagged these notes low-confidence; confirm category and
wording before merging:

| PR | Category | Why flagged |
|----|----------|-------------|
| #5170 | Bug Fixes | could be Bug Fixes or Performance and Efficiency
Improvements |
| #4775 | Bug Fixes | could be Bug Fixes or Performance and Efficiency
Improvements |
| #4190 | Bug Fixes | adds new sweep and defrag mechanisms in a patch
release; could be a feature or performance change |
| #3683 | Build and Tooling | build-only fix; release-notes label not
confirmed; non-fix category on a patch release needs explicit maintainer
confirmation |
| #5046 | Bug Fixes | explicit impact scope omitted: macOS |
| #5246 | Bug Fixes | schema-only fix; may not be user-facing |
| #4913 | Bug Fixes | explicit impact scope omitted: macOS |

### Release-impact review

Code detected release-impact terms (availability, memory safety, data
integrity, access control, protocol, compatibility) in these PRs; this
forces review, it is not a severity classification.

The requested urgency is **SECURITY**. Confirm it and decide whether any
change needs a hand-authored **Security Fixes** entry:

⚠️ [#5127](#5127) names
**CVE-2021-32672**;
[#5178](#5178) names
**CVE-2021-32627**;
[#5163](#5163) names
**CVE-2021-32627**. A named CVE normally ships with `SECURITY` urgency
and a hand-authored **Security Fixes** entry; this holds the cut at any
other urgency.

<details>
<summary>38 PR(s) with impact signals</summary>

| PR | Title | Signal |
|----|-------|--------|
| [#4968](#4968) | Fix crash
when a database's keyspace is replaced mid-stage during defrag |
memory-safety risk |
| [#5091](#5091) | Fix VM_Call
crash on script-mode validation errors | server crash, assertion, or
availability failure |
| [#5133](#5133) | Keep sds
lengths in size_t when comparing and caching keys | server crash,
assertion, or availability failure |
| [#5128](#5128) | Propagate
PFADD elements applied before an INVALIDOBJ error | data or
persisted-state corruption risk |
| [#5127](#5127) | Script
debugger: reset *argc on partial-read exit to fix server crash in SYNC
mode | server crash, assertion, or availability failure |
| [#5159](#5159) | Fill
unmatched postponed reply lengths left by a module | server crash,
assertion, or availability failure |
| [#4091](#4091) | Fix crash
when processing heartbeat from a node with no local role | server crash,
assertion, or availability failure |
| [#4351](#4351) | Fix NULL
deref in usUntilEarliestTimer when all time events are deleted | server
crash, assertion, or availability failure |
| [#4670](#4670) | Reject
repeated CLUSTER SYNCSLOTS ESTABLISH on the same connection |
memory-safety risk |
| [#4665](#4665) | Check the
SORT destination that is actually written | security, access-control, or
injection hardening |
| [#5187](#5187) | Defer freeing
the client that runs a replication role change | server crash,
assertion, or availability failure |
| [#5182](#5182) | Exempt slot
import SYNCSLOTS FINISH from the write pause assertion | server crash,
assertion, or availability failure |
| [#5178](#5178) | Check XADD
element size before creating the stream | server crash, assertion, or
availability failure |
| [#5180](#5180) | Redact HELLO,
AUTH and MIGRATE credentials before validating arguments | security,
access-control, or injection hardening |
| [#5126](#5126) | Reject a
+CONTINUE reply to PSYNC when there is no cached primary | server crash,
assertion, or availability failure |
| [#5114](#5114) | Allow
server.log() during FUNCTION LOAD | server crash, assertion, or
availability failure |
| [#5163](#5163) | Fix integer
overflow in _quicklistNodeAllowMerge size check | server crash,
assertion, or availability failure |
| [#5151](#5151) | Fix
writevToClient stack overflow for empty bulk strings with copy avoidance
| data or persisted-state corruption risk |
| [#5137](#5137) | Ignore ping
extension values that nodes.conf cannot load | data or persisted-state
corruption risk |
| [#5184](#5184) | Treat a
replica with no known primary as owning no slots | server crash,
assertion, or availability failure |
| [#5124](#5124) | Reject sparse
HLLs that end in a truncated XZERO opcode | data or persisted-state
corruption risk |
| [#5138](#5138) | Fix
hllSparseSet aborting on SDS_TYPE_5 strings when deltalen is zero |
server crash, assertion, or availability failure |
| [#5146](#5146) | Fix integer
overflow in SORT BY/GET pattern key substitution | undefined behavior or
unsafe arithmetic |
| [#5155](#5155) | Reject
ValkeyModule_Calloc requests whose nmemb * size overflows | server
crash, assertion, or availability failure |
| [#4929](#4929) | Guard NULL
replica_primary_host in Sentinel INFO handling | server crash,
assertion, or availability failure |
| [#5087](#5087) | Treat key
specs that start past the last argument as matching no keys |
memory-safety risk |
| [#5162](#5162) | Free the ACL
log object when the ACL log is disabled | security, access-control, or
injection hardening |
| [#5115](#5115) | functions:
key per-engine stats by registered name, not shebang text | server
crash, assertion, or availability failure |
| [#5164](#5164) | Only resume a
hash defrag scan from the hash scanner's own cursor | server crash,
assertion, or availability failure |
| [#5065](#5065) | Cap the
length of inbound cluster bus packets | security, access-control, or
injection hardening |
| [#5117](#5117) | Allow the Lua
debugger to start on an empty script | server crash, assertion, or
availability failure |
| [#5134](#5134) | Do not adopt
the MYSELF flag from a gossip entry | server crash, assertion, or
availability failure |
| [#5033](#5033) | Respect
NOFAILOVER during shutdown failover | security, access-control, or
injection hardening |
| [#5085](#5085) | Disconnect
default user subscribers to revoked channels on ACL LOAD | security,
access-control, or injection hardening |
| [#5349](#5349) | Treat a torn
annotation at the end of an AOF file as a short read | server crash,
assertion, or availability failure |
| [#5246](#5246) | Allow null in
SENTINEL GET-PRIMARY-ADDR-BY-NAME reply schema | wire-protocol or reply
correctness |
| [#4913](#4913) | Expire stale
Sentinel primary-down reports before quorum checks | security,
access-control, or injection hardening |
| [#5435](#5435) | Don't free
the client that is executing a command when a blocked client's
re-executed command evicts clients | memory-safety risk |

</details>

### Excluded from generated notes (listed under Security Fixes)

#5435 was supplied as a `--security-fix`, so the generated bullet(s) in
the normal categories were dropped to avoid double-listing. To keep the
notes consistent, it appears only under **Security Fixes**, where each
is reviewed as a factual security entry.

### ⚠️ Release-safety guardrail overrode AI triage

AI excluded these PRs (or gave no verdict) but their text names a
release-impact signal, so code forced them into the notes; confirm each
bullet, category, urgency, and security treatment:

| PR | Title | Guardrail reason |
|----|-------|------------------|
| [#5246](#5246) | Allow null in
SENTINEL GET-PRIMARY-ADDR-BY-NAME reply schema | ⚠️ release-safety
guardrail (wire-protocol or reply correctness; AI exclusion) |

### Triage summary

- 44 PR(s) triaged into the notes
- 18 PR(s) triaged out

Per-PR verdicts (with reasons) are in the run's `triage-verdicts`
artifact. To include a wrongly-dropped PR, label it `release-notes` and
re-cut.

### ⚠️ Notes credited to a backport (original PR not recovered)

These notes credit the backport PR, not the change's author; confirm the
original PR and correct the credit before merging:

| Backport PR | Title |
|-------------|-------|
| [#4968](#4968) | Fix crash
when a database's keyspace is replaced mid-stage during defrag |

### ⚠️ Commits dropped by a reused PR number

Two commits resolved to the same `(#N)`; the one below was **dropped**
and is absent from the notes, so note it by hand if it is a separate
user-facing change:

| Dropped commit | Subject | Reused # | Kept commit |
|----------------|---------|----------|-------------|
| `88fd9d32ef74` | Deflake replica selection test with a longer
cluster-node-timeout (#5396) | #5396 | `2a3cf2dd6b09` |

### ⚠️ Release lines disagree about a note

Another release line already published a note for these PRs, but this
cut kept its own wording, so the entries will not read identically:

⚠️ #5133: the two lines contradict each other about the change itself,
not just its wording, which code must not resolve on its own. Read the
note on each line and settle which one is right before merging.

<details>
<summary>5 note(s) not reusing published wording</summary>

| PR | Other line | Why the wording was not reused |
|----|------------|--------------------------------|
| #5133 | `9.2` (Valkey 9.2.0-rc2) | ⚠️ `9.2` limits the change to
32-bit but this cut's note says no environment limit, so the lines
disagree about how far the change reaches |
| #5127 | `9.2` (Valkey 9.2.0-rc2) | the PR names a CVE, so its wording
is authored per release line by a human |
| #4968 | `9.2` (Valkey 9.2.0-rc2) | this cut could not confirm the PR
the note credits (unresolved backport, cherry-pick, or reused PR
number), and that credit is the only thing joining the two notes |
| #5178 | `9.2` (Valkey 9.2.0-rc2) | the PR names a CVE, so its wording
is authored per release line by a human |
| #5163 | `9.2` (Valkey 9.2.0-rc2) | the PR names a CVE, so its wording
is authored per release line by a human |

</details>

### Wording carried from other release lines

A backported change is cut once per release line, and each cut words its
notes independently. To keep one commit from being described differently
per branch, a note whose source PR another line already published takes
that published wording verbatim (joined on the trailing `(#N)`, which
always names the original source PR). Only the text is reused; the
category, the `by @handle` credit, and the `(#N)` are this cut's own.

- Release lines consulted: `9.2`, `9.0`, `8.1`, `8.0`, `7.2`, `7.0`,
`6.2`, `6.0`, `5.0`, `4.0`, `3.2`, `3.0`, `2.8`, `2.6`, `2.4`, `2.2`
- 3 generated note(s) already match the published wording: #5138, #5155,
#5169
- Reused published wording for 55 note(s)

<details>
<summary>55 note(s) reusing published wording</summary>

| PR | Wording from | Carried wording | This cut generated |
|----|--------------|-----------------|--------------------|
| #5210 | `9.2` (Valkey 9.2.0-rc2) | Correct command metadata to
describe the `ZINCRBY` increment and
`ZINTER`/`ZINTERSTORE`/`ZUNION`/`ZUNIONSTORE` weights as doubles instead
of integers | Fix command metadata to describe the `ZINCRBY` increment
and the `ZINTER`, `ZINTERSTORE`, `ZUNION` and `ZUNIONSTORE` weights as
doubles instead of integers |
| #5128 | `9.2` (Valkey 9.2.0-rc2) | Propagate `PFADD` elements applied
before a corrupted-HLL INVALIDOBJ error so replicas and the AOF stay
consistent with the primary | Fix `PFADD` not propagating to replicas
and the AOF the elements it applied before a later element fails with
INVALIDOBJ on a corrupted sparse HyperLogLog |
| #5211 | `9.2` (Valkey 9.2.0-rc2) | Correct command metadata so the
`numfields` count argument of hash field commands is no longer
associated with a key specification | Fix command metadata that
incorrectly marked the `numfields` argument of hash field commands such
as `HGETEX`, `HSETEX` and `HPEXPIRE` as a key |
| #5213 | `9.2` (Valkey 9.2.0-rc2) | Correct expiry command metadata to
show that `XX` can be combined with `GT` or `LT`, rather than all four
conditions being mutually exclusive | Fix command metadata for `EXPIRE`,
`PEXPIRE`, `HEXPIRE` and related commands to show that `XX` can be
combined with `GT` or `LT` |
| #5118 | `9.2` (Valkey 9.2.0-rc2) | Fix a server panic when a Lua
script returns or raises an error table whose metatable has an `__index`
metamethod that raises an error | Fix the server exiting when a Lua
script returns or raises an error table whose metatable has a raising
`__index` |
| #5159 | `9.2` (Valkey 9.2.0-rc2) | Fix a server crash when a module
never sets a postponed reply length; the leftover placeholder is now
filled with an empty array | Fix a crash when a module replies with
`VALKEYMODULE_POSTPONED_LEN` and never sets the reply length |
| #4091 | `9.2` (Valkey 9.2.0-rc1) | Fix a crash when processing a
heartbeat from a cluster node whose role is locally unknown, such as
after loading an incomplete nodes.conf | Fix a crash when processing a
heartbeat from a cluster node that has no role locally, such as a
primary implicitly created while loading nodes.conf |
| #5212 | `9.2` (Valkey 9.2.0-rc2) | Mark the `RESTORE` and
`RESTORE-ASKING` `IDLETIME` and `FREQ` options as mutually exclusive in
command metadata | Fix command metadata to mark the `RESTORE` and
`RESTORE-ASKING` options `IDLETIME` and `FREQ` as mutually exclusive |
| #5184 | `7.2` (Valkey 7.2.16) | Fix a crash in a cluster replica whose
primary was removed from the nodes table when another primary claims an
unassigned slot | Fix a crash on a cluster replica with no known primary
when another primary claims an unassigned slot |
| #5108 | `7.2` (Valkey 7.2.16) | Fix `SCRIPT KILL` and `FUNCTION KILL`
not stopping Lua scripts that loop inside nested coroutines, and script
timeouts not being detected when work is spread across coroutines | Fix
`SCRIPT KILL` and `FUNCTION KILL` failing to stop Lua scripts that loop
inside nested coroutines, and script timeouts going undetected across
coroutines |
| #5124 | `7.2` (Valkey 7.2.16) | Fix an out-of-bounds write in `PFADD`
and `PFMERGE` on a corrupted sparse HyperLogLog ending in a truncated
XZERO opcode by rejecting it as invalid | Reject corrupted sparse
HyperLogLogs that end in a truncated XZERO opcode, preventing an
out-of-bounds write in `PFADD` and `PFMERGE` |
| #5146 | `7.2` (Valkey 7.2.16) | Fix a server crash in `SORT` and
`SORT_RO` with `BY` or `GET` patterns when an element is 2 GiB or larger
| Fix a crash in `SORT` and `SORT_RO` with `BY` or `GET` patterns when
an element is 2 GiB or larger |
| #5157 | `7.2` (Valkey 7.2.16) | Fix
`ValkeyModule_CallReplyAttributeElement` always returning an error on
RESP3 attribute replies | Fix `ValkeyModule_CallReplyAttributeElement`
always failing on RESP3 attribute replies |
| #5120 | `9.2` (Valkey 9.2.0-rc2) | Fix a memory leak when
`server.register_function` named arguments are repeated in a different
letter case | Fix a memory leak when `server.register_function` receives
the same named argument more than once in different letter case |
| #5167 | `9.2` (Valkey 9.2.0-rc2) | Fix quadratic slowdown in
`HRANDFIELD` and `SRANDMEMBER` with counts on collections whose elements
differ only in letter case | Fix `HRANDFIELD` and `SRANDMEMBER` with a
count blocking the server on hashes or sets whose elements differ only
in letter case |
| #5087 | `7.2` (Valkey 7.2.16) | Fix `PFMERGE` with no source keys
bypassing ACL key permissions and failing in `COMMAND GETKEYS`, and a
crash in module commands whose keynum key spec starts past the last
argument | Fix `PFMERGE` with no source keys bypassing ACL key
permission checks and failing in `COMMAND GETKEYS`, and fix a crash on
module commands whose keynum key spec starts past the last argument |
| #5199 | `7.2` (Valkey 7.2.16) | Fix `notify-keyspace-events` dropping
the `n` (new key) flag from `CONFIG GET` and `CONFIG REWRITE` when `A`
is also set | Fix `CONFIG GET` and `CONFIG REWRITE` dropping the `n`
flag of `notify-keyspace-events` when `A` is set, which silently
disabled new key events after a restart |
| #5134 | `7.2` (Valkey 7.2.16) | Fix a cluster node failing to restart
with an assertion after a gossip entry carrying the MYSELF flag adds a
second myself node to nodes.conf | Fix a cluster node failing to restart
after a gossip entry carrying the MYSELF flag adds a second myself node
to `nodes.conf` |
| #5085 | `7.2` (Valkey 7.2.16) | Fix `ACL LOAD` not disconnecting
default user clients subscribed to channels the reloaded rules no longer
allow | Fix `ACL LOAD` not disconnecting default user clients subscribed
to channels that the reloaded ACL file no longer allows |
| #4863 | `9.2` (Valkey 9.2.0-rc2) | Allow modules to block RESP3
clients that are subscribed to Pub/Sub channels instead of failing
`ValkeyModule_BlockClient` with ENOTSUP | Fix module commands being
unable to block RESP3 clients that are subscribed to Pub/Sub channels |
| #4775 | `9.2` (Valkey 9.2.0-rc2) | Bound the time spent per cycle
evicting keys from the client tracking table, avoiding long stalls after
lowering `tracking-table-max-keys` | Fix server stalls while evicting
keys from the client tracking table after `tracking-table-max-keys` is
lowered, by bounding the time spent per eviction call |
| #4190 | `9.2` (Valkey 9.2.0-rc2) | Reclaim client-side caching
tracking table entries left by disconnected clients, fixing a memory
leak under read-heavy workloads, and include the tracking table in
active defrag | Fix unbounded memory growth in the client tracking table
from disconnected clients' IDs on keys that are never modified, and
include the table in active defrag |
| #3683 | `9.2` (Valkey 9.2.0-rc1) | Fix clean or highly parallel builds
failing with a missing release.h for valkey-cli, valkey-benchmark, and
unit tests | Fix CMake builds of `valkey-cli`, `valkey-benchmark` and
unit tests failing with a missing `release.h` on clean or highly
parallel builds |
| #4995 | `9.2` (Valkey 9.2.0-rc2) | Fix a memory leak when `GEOSEARCH`
or `GEOSEARCHSTORE` is given repeated `BYPOLYGON` options | Fix a memory
leak in `GEOSEARCH` and `GEOSEARCHSTORE` when the `BYPOLYGON` option is
repeated |
| #5046 | `9.2` (Valkey 9.2.0-rc2) | Fix a memory leak in
`ValkeyModule_GetCommandKeysWithFlags` when introspecting commands with
large key lists | Fix a memory leak in the
`ValkeyModule_GetCommandKeysWithFlags` module API for commands with
large key lists |
| #5092 | `9.2` (Valkey 9.2.0-rc2) | `MEMORY USAGE` now counts hash
fields that have expired but not yet been reaped, fixing under-reported
sizes | Fix `MEMORY USAGE` under-reporting hashes that hold expired
fields not yet reclaimed |
| #5091 | `9.2` (Valkey 9.2.0-rc2) | Fix a crash in `ValkeyModule_Call`
when script-mode validation fails and error replies were not requested |
Fix a crash when a module calls `ValkeyModule_Call` in script mode (`S`)
without the error-reply flag (`E`) and the command fails validation |
| #5191 | `9.2` (Valkey 9.2.0-rc2) | In cluster mode, one cross-slot
command in a script no longer makes every later script and function call
fail until restart | Fix all later script and function calls failing
with "Attempted to access a non local key in a cluster node" after one
script runs a cross-slot command in cluster mode |
| #3510 | `9.2` (Valkey 9.2.0-rc1) | Fix a TLS busy loop that consumed
100% CPU when a connection's read or write handler was removed while
OpenSSL was waiting for the opposite event | Fix an infinite busy loop
consuming 100% CPU on TLS connections after a read or write handler is
removed |
| #4351 | `9.2` (Valkey 9.2.0-rc1) | Fix a crash caused by a NULL
pointer dereference when all timer events in an event loop are pending
deletion | Fix a NULL dereference crash in the event loop when all time
events are pending deletion |
| #4171 | `9.2` (Valkey 9.2.0-rc1) | Fix a node staying stuck in PFAIL
when its PING is lost while the peer's own traffic keeps the cluster
link alive | Fix a cluster node staying stuck in PFAIL when its PING is
lost while the peer's own PINGs keep the link alive |
| #4330 | `9.2` (Valkey 9.2.0-rc1) | `CLUSTER SYNCSLOTS FINISH` now
rejects clients outside the slot migration stream, preventing misuse of
the import state machine | Reject `CLUSTER SYNCSLOTS FINISH` from
clients that are not part of the slot migration replication stream,
preventing them from terminating a slot import |
| #4670 | `9.2` (Valkey 9.2.0-rc1) | Reject a repeated `CLUSTER
SYNCSLOTS ESTABLISH` on the same connection, which could lead to a
use-after-free crash on disconnect | Fix a use-after-free crash when
`CLUSTER SYNCSLOTS ESTABLISH` is sent twice on the same connection |
| #4665 | `9.2` (Valkey 9.2.0-rc1) | Fix `SORT` key extraction so a
`STORE` destination named like an option can no longer bypass ACL checks
and write to an unauthorized key | Fix `SORT` checking ACL key
permissions against the wrong key when a `STORE` destination is named
like an option (`by`, `get`, `limit`, `store`), which allowed writes
outside a user's allowed key patterns |
| #4777 | `9.2` (Valkey 9.2.0-rc2) | Fix `GEOSEARCH` returning empty
results for exact zero-distance matches on builds where floating-point
contraction breaks the latitude distance calculation | Fix `GEOSEARCH`
with a zero radius or box returning no results on some builds due to
floating-point precision when latitudes are equal |
| #5109 | `9.2` (Valkey 9.2.0-rc2) | Fix a memory leak when deleting or
replacing Lua functions with long names or descriptions | Fix a memory
leak when deleting or replacing Lua functions that have a long name or
description |
| #5187 | `9.2` (Valkey 9.2.0-rc2) | Fix a crash when a replication role
change command such as `REPLICAOF` or `CLUSTER REPLICATE` arrives over a
replication link | Fix a crash when `REPLICAOF`, `CLUSTER REPLICATE`,
`CLUSTER RESET` or `CLUSTER FAILOVER TAKEOVER` is received over a
replication link |
| #5182 | `9.2` (Valkey 9.2.0-rc2) | Fix a crash on the importing
primary when an atomic slot migration fails while its writes are paused
| Fix an assertion crash on a primary when an atomic slot migration
import fails while its writes are paused |
| #5180 | `9.2` (Valkey 9.2.0-rc2) | Redact credentials of rejected
`HELLO`, `AUTH` and `MIGRATE` commands so passwords no longer leak to
MONITOR and the commandlog | Fix credentials of rejected `HELLO`, `AUTH`
and `MIGRATE` commands being shown in clear text in `MONITOR` and the
commandlog |
| #5126 | `9.2` (Valkey 9.2.0-rc2) | Prevent a replica crash when the
primary wrongly replies +CONTINUE to a full resync request; the replica
now drops the link and retries | Fix a replica crash when the primary
replies `+CONTINUE` to a `PSYNC` full resync request and there is no
cached primary |
| #5114 | `9.2` (Valkey 9.2.0-rc2) | FUNCTION LOAD no longer aborts the
server when a library calls `server.log()` at its top level, including
when loading from RDB or AOF | Fix a crash when a Lua function library
calls `server.log()` at its top level during `FUNCTION LOAD` or when
loaded from RDB or AOF at startup |
| #5151 | `9.2` (Valkey 9.2.0-rc2) | Fix a stack buffer overflow when
replying with hundreds of empty strings (e.g. MGET) while reply copy
avoidance is active | Fix a stack buffer overflow when a reply such as
`MGET` contains hundreds of empty strings while reply copy avoidance is
active |
| #5137 | `9.2` (Valkey 9.2.0-rc2) | Ignore invalid ping extension
values from cluster peers that would corrupt nodes.conf and prevent the
node from restarting | Ignore invalid hostname, nodename, client IP and
availability zone values announced by cluster bus peers, which corrupted
nodes.conf and made the node panic on restart |
| #5161 | `9.2` (Valkey 9.2.0-rc2) | Bound the bytes the cluster bus
reads per event so a peer with a constant read backlog cannot starve
clients, cron and heartbeats | Limit the bytes read per event from a
cluster bus link so a peer that keeps sending cannot block the main
thread and starve clients |
| #5208 | `9.2` (Valkey 9.2.0-rc2) | Correct `SENTINEL SIMULATE-FAILURE`
metadata so `COMMAND DOCS` shows the required mode argument and its
tokens | Fix `SENTINEL SIMULATE-FAILURE` argument metadata so `COMMAND
DOCS` reports the mode as required and includes the option tokens |
| #5158 | `7.2` (Valkey 7.2.16) | Fail `CONFIG REWRITE` when the old
config file reads short instead of writing uninitialized memory into the
new config file | Fix `CONFIG REWRITE` writing uninitialized memory into
the config file when the old config file reads short; the rewrite now
fails with an error |
| #5245 | `9.2` (Valkey 9.2.0-rc2) | Mark the absolute timestamp
arguments of `HEXPIREAT` and `HPEXPIREAT` as `unix-time` in `COMMAND
DOCS`, matching `EXPIREAT` and `PEXPIREAT` | Fix `COMMAND DOCS`
reporting the `HEXPIREAT` and `HPEXPIREAT` timestamp arguments as
`integer` instead of `unix-time` |
| #5129 | `9.2` (Valkey 9.2.0-rc2) | Clear the script debugger input
buffer after a "max client buffer reached" error so later debugger
commands in the same session do not keep failing | Fix the script
debugger failing every further command after its 1 MB input limit is hit
and the script catches the error with `pcall` |
| #4929 | `7.2` (Valkey 7.2.16) | Fix a Sentinel crash when a monitored
replica's `INFO` reply contains no `master_host` | Fix a Sentinel crash
when a monitored replica's INFO reply has a matching primary port but no
primary host |
| #4711 | `7.2` (Valkey 7.2.16) | Fix a use-after-free in streams when
`XADD` creates a new node, which could leave a dangling pointer hit by
later reads such as `XRANGE` | Fix a use-after-free in streams where
`XADD` creating a new node can leave a dangling pointer later read by
`XRANGE`, `XREVRANGE` or `XINFO STREAM ... FULL` |
| #5065 | `7.2` (Valkey 7.2.16) | Reject inbound cluster bus packets
larger than 16MB, except Pub/Sub and module messages, so a peer cannot
make a node buffer up to 4GB from a single header | Reject inbound
cluster bus packets over 16MB, except Pub/Sub and module messages, so a
peer can no longer make a node buffer up to 4GB |
| #4983 | `7.2` (Valkey 7.2.16) | Fix `XINFO GROUPS` and `XINFO STREAM
... FULL` reporting too-high consumer group lag after `XTRIM` or a
trimming `XADD` removes unread entries | Fix `XINFO GROUPS` and `XINFO
STREAM ... FULL` reporting a too-high consumer group lag after `XTRIM`
or a trimming `XADD` removes unread entries |
| #5349 | `7.2` (Valkey 7.2.16) | Fix AOF load failure after a crash
leaves a torn annotation at the end of the file; it is now treated as a
short read and can be truncated by `aof-load-truncated` or
`valkey-check-aof --fix` | Fix AOF load failure after a torn annotation
at the end of the file by treating it as a short read, which
`valkey-check-aof --fix` can now truncate |
| #5246 | `7.2` (Valkey 7.2.16) | Correct the `SENTINEL
GET-MASTER-ADDR-BY-NAME` reply schema to allow the null reply returned
for an unknown primary name | Fix the reply schemas of `SENTINEL
GET-PRIMARY-ADDR-BY-NAME` and `SENTINEL GET-MASTER-ADDR-BY-NAME` to
include the null reply for an unknown primary |
| #5244 | `9.2` (Valkey 9.2.0-rc2) | Correct `ZADD` and `LCS` metadata
so `COMMAND DOCS` and valkey-cli hints no longer present `NX` with
`GT`/`LT` or `LEN` with `IDX` as valid combinations | Fix `COMMAND DOCS`
and `valkey-cli` hints presenting `ZADD` NX with GT or LT and `LCS` LEN
with IDX as valid combinations |

</details>

*Generated by valkey-ci-agent. Review before merging into the release
line.*

Signed-off-by: valkeyrie-bot[bot] <3692572+valkeyrie-bot[bot]@users.noreply.github.com>
Co-authored-by: valkeyrie-bot[bot] <3692572+valkeyrie-bot[bot]@users.noreply.github.com>
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
The test sends SHUTDOWN to the primary, resumes the replica and ends its
block without waiting for the shutdown to finish. In the log the primary
(pid 56270) prints "Valkey is now ready to exit, bye bye..." at
10:09:03.797 and the next line is "signal-handler Received SIGTERM
scheduling shutdown...". The process was still alive running
LeakSanitizer's exit-time check when kill_server in
tests/support/server.tcl found it alive and sent SIGTERM. The
interrupted leak check wrote the LeakSanitizer warning to stderr, and
check_sanitizer_errors reported it as a failure. The test itself passed.

The test asks the primary to shut down, so the process exiting is the
state it depends on. The primary always exits on its own here:
serverCron finishes the shutdown once the replica is in sync or gone, or
when the default 10 second shutdown-timeout expires. The patch waits up
to 50 seconds for the pid to disappear, using the same is_alive check
kill_server uses, so kill_server takes its already-dead path and sends
no signal. The existing crash-log assertion now runs after the shutdown
has completed instead of possibly before it, which makes the test
stricter, not weaker. No report is ignored and no product source is
touched.

CI-Fix-Job: test-sanitizer-address (gcc)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
Backport-Source-PR: 5396
sarthakaggarwal97 added a commit that referenced this pull request Nov 18, 2026
The previous BLPOP can still be blocked when the test checks the generic
blocked-client count. In the failing run the client was closed with BLPOP
still active and SHUTDOWN queued in its input buffer, so the primary never
received a shutdown request and the exit wait correctly failed.

Require cmd=shutdown as well as the existing client and blocked-client
counts before resuming the replica and closing the deferring client. This
keeps the timeout-then-reblock regression and verifies an actual shutdown;
the exit wait and crash check are unchanged. No server code is modified.

Backport-Source-PR: 5396
CI-Fix-Job: test-ubuntu-no-malloc-usable-size
CI-Fix-Run: https://github.com/sarthakaggarwal97/valkey/actions/runs/44048440217
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
The test sends SHUTDOWN to the primary, resumes the replica and ends its
block without waiting for the shutdown to finish. In the log the primary
(pid 56270) prints "Valkey is now ready to exit, bye bye..." at
10:09:03.797 and the next line is "signal-handler Received SIGTERM
scheduling shutdown...". The process was still alive running
LeakSanitizer's exit-time check when kill_server in
tests/support/server.tcl found it alive and sent SIGTERM. The
interrupted leak check wrote the LeakSanitizer warning to stderr, and
check_sanitizer_errors reported it as a failure. The test itself passed.

The test asks the primary to shut down, so the process exiting is the
state it depends on. The primary always exits on its own here:
serverCron finishes the shutdown once the replica is in sync or gone, or
when the default 10 second shutdown-timeout expires. The patch waits up
to 50 seconds for the pid to disappear, using the same is_alive check
kill_server uses, so kill_server takes its already-dead path and sends
no signal. The existing crash-log assertion now runs after the shutdown
has completed instead of possibly before it, which makes the test
stricter, not weaker. No report is ignored and no product source is
touched.

CI-Fix-Job: test-sanitizer-address (gcc)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
Backport-Source-PR: 5396
sarthakaggarwal97 added a commit that referenced this pull request Nov 18, 2026
The previous BLPOP can still be blocked when the test checks the generic
blocked-client count. In the failing run the client was closed with BLPOP
still active and SHUTDOWN queued in its input buffer, so the primary never
received a shutdown request and the exit wait correctly failed.

Require cmd=shutdown as well as the existing client and blocked-client
counts before resuming the replica and closing the deferring client. This
keeps the timeout-then-reblock regression and verifies an actual shutdown;
the exit wait and crash check are unchanged. No server code is modified.

Backport-Source-PR: 5396
CI-Fix-Job: test-ubuntu-no-malloc-usable-size
CI-Fix-Run: https://github.com/sarthakaggarwal97/valkey/actions/runs/44048440217
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
The test sends SHUTDOWN to the primary, resumes the replica and ends its
block without waiting for the shutdown to finish. In the log the primary
(pid 56270) prints "Valkey is now ready to exit, bye bye..." at
10:09:03.797 and the next line is "signal-handler Received SIGTERM
scheduling shutdown...". The process was still alive running
LeakSanitizer's exit-time check when kill_server in
tests/support/server.tcl found it alive and sent SIGTERM. The
interrupted leak check wrote the LeakSanitizer warning to stderr, and
check_sanitizer_errors reported it as a failure. The test itself passed.

The test asks the primary to shut down, so the process exiting is the
state it depends on. The primary always exits on its own here:
serverCron finishes the shutdown once the replica is in sync or gone, or
when the default 10 second shutdown-timeout expires. The patch waits up
to 50 seconds for the pid to disappear, using the same is_alive check
kill_server uses, so kill_server takes its already-dead path and sends
no signal. The existing crash-log assertion now runs after the shutdown
has completed instead of possibly before it, which makes the test
stricter, not weaker. No report is ignored and no product source is
touched.

Release-branch adaptations contributed by Sarthak Aggarwal <[email protected]>.

CI-Fix-Job: test-sanitizer-address (gcc)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
Backport-Source-PR: 5396
Backport-Adaptation: Wait for SHUTDOWN itself to block before closing the deferring client, then wait for the primary to exit before checking its crash log.
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
…#5396)

All three FAIL messages reached every node within about 65 ms, and the
replica of the third primary won epoch 11 at 10:06:20.101. That win
lowered the failed primary rank of the other two replicas by one, which
moved both of their election times 500 ms earlier and into the past.
Both started an election for epoch 12 within the same millisecond
(10:06:20.198 and .199). The five voters split 3 to 2 and the quorum is
4, so neither won. On 9.0 a replica restarts its election early only
when it sees a primary claim an equal or higher epoch
(cluster_legacy.c:3785). With no winner there was no such claim, so both
waited for the 30 second timeout ("Failover attempt expired" from
10:06:50) and the 60 second retry, past the test's 50 second wait. The
random part of the delay (0 to 500 ms) is as large as the 500 ms spacing
per rank, so a rank decrement can always cancel the spacing.

The default branch removes split votes in product code with the
FAILOVER_AUTH_NACK message (f2c1c5e).
That is a new cluster bus message type and new DEBUG subcommands, not
something to backport to a release branch, so the fix here has to be in
the test. The property 9.0 does guarantee is that a replica whose
election epoch is won by another replica restarts as soon as it sees the
winner. The test now forces exactly that. All replicas start with
cluster-replica-no-failover yes and the test waits until nodes 3 to 9
see the three paused primaries as fail. R 8 then drops all cluster bus
packets while R 7 is released and wins. R 8 is released next and, still
on the old epoch, starts its election in the epoch R 7 won, where the
four healthy primaries have already voted. Once the filter is removed, R
8 sees R 7's claim, resets, and must become primary within the existing
wait. R 9 is released last. The original checks for no "Failover attempt
expired" and no "epoch 0" message are unchanged, so a regression in the
reset logic still fails the test. Because there is always exactly one
winner per epoch, the no-winner split cannot occur. The packet filter
and link-close DEBUG switches are the ones
test_replica_config_epoch_failover already uses in this file.

CI-Fix-Job: test-sanitizer-address (clang)
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728
Backport-Source-PR: 5396
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
)

The election delay scales with cluster-node-timeout: delay =
min(node_timeout / 30, 500), plus a random 0..delay, plus rank * 2 *
delay. With the test's node timeout of 5000 the delay is 166 ms, so rank
1 starts only 167 to 497 ms after rank 0, before the 100 ms cron
granularity. In the log, node #5 (d3af1bb, rank 0, offset 1319) was
delayed 323 ms and node #10 (ae5ac, rank 1, offset 671) 523 ms. #5
started its election for epoch 16 at 10:08:34.498 and won at 34.618. #10
started its own election for epoch 17 at 34.629, before #5's new
configuration had reached the voters or #10 itself (they logged it at
34.654 to 34.660). The primaries granted epoch 17 to #10 at 34.635, #10
won with the higher config epoch and #5 was demoted to its replica. A
failover did happen, but to the replica the test does not expect, so
both tests timed out.

The server honoured the rank delay; rank ordering is a best-effort
delay, not a guarantee, so the test was relying on a margin the 5000 ms
node timeout does not provide on a slow runner. In this run #5's
election took about 120 ms plus about 40 ms to propagate, and it started
about 90 ms late. With the default node timeout of 15000 the delay is
500 ms and the rank step 1000 ms, so the gap is at least about 500 ms,
which is the server's default production timing. The test still lets
both replicas compete and still requires #5 to win and #10 to replicate
it, so nothing is weakened. The repository fixed the same class of flake
in failover2.tcl the same way, by raising cluster-node-timeout to 15000
(#2793, #3946). Only the first cluster is changed; the second cluster's
test accepts any replica as the new primary and passed.

CI-Fix-Job: test-alpine-32bit
CI-Fix-Run: https://github.com/valkey-io/valkey/actions/runs/43405857728

Backport-Source-PR: 5396
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.

1 participant