Repository navigation
[backport] Backport sweep for 8.1 - #5507
valkeyrie-ops[bot] wants to merge 43 commits into
Conversation
AI backport resolution: source PR #5417Abort dual-channel sync if the primary link breaks while streaming 2 AI-edited files Claude Summary
AI-edited files requiring review Full backport commit diff: commit 1e36d101a2d8.
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
AI backport resolution: source PR #5358Zero the module key handle so CloseKey is safe after a Call changes the key's type 3 AI-edited files Claude Summary
AI-edited files requiring review Full backport commit diff: commit 5a7dfe3dfa8c.
|
AI backport resolution: source PR #4675Fix cluster bus self-forget use-after-free 2 AI-edited files Claude Summary
AI-edited files requiring review Full backport commit diff: commit 78667bb34b19.
|
AI backport resolution: source PR #3245Fix assertion crash in processIOThreadsReadDone when DONT_PARSE client has stale argc 3 AI-edited files Claude Summary
AI-edited files requiring review Full backport commit diff: commit 18fc064665c2.
|
AI backport resolution: source PR #5452Ignore replica claims that would close a replicaof cycle 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 6c70b2cd3776.
|
AI backport resolution: source PR #5090Keep an IFEQ/IFNE value spelled GET when propagating SET GET 6 AI-edited files Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 8fb951209543.
|
|
Automatic follow-up on this backport's CI. No fix for |
…5417) During dual-channel sync, once the replica's local buffer is full it stops reading the main channel. If the primary drops that channel, the replica doesn't notice. It replays the rest of its local buffer, which can be gigabytes, into a sync that is already dead, reports success, and sends `REPLCONF ACK` on a broken link. This change checks the primary connection in `streamReplDataBufToDb()` before each buffered block is applied, and after each `replStreamProgressCallback()` call while a compressed block is decoded, since that callback is the only I/O in the loop. If the connection is broken, the replica aborts the sync and reconnects. The buffered writes that haven't been applied yet are discarded rather than applied. This matches the existing abort when the main channel is lost while buffering (`readIntoReplDataBlock`): without the link the replica can't complete or acknowledge the sync, and it resyncs once it reconnects. --------- Signed-off-by: Shoham Elias <shohame@amazon.com> Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com> Co-authored-by: Amit Nagler <58042354+naglera@users.noreply.github.com> Backport-Source-PR: 5417 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
#5358) VM_OpenKey allocates the ValkeyModuleKey with zmalloc, and moduleInitKeyTypeSpecific initializes only the union member for the value's type at open time. If a module then overwrites the same key through ValkeyModule_Call, dbSetValue keeps the old robj when it is RAW-encoded with refcount 1 and swaps the new value's type, encoding and pointer into it. The handle now sees a sorted set, so ValkeyModule_CloseKey calls VM_ZsetRangeStop, which reads key->u.zset.type from memory that was never written. Allocate the handle with zcalloc: zero is the "nothing active" state for every type, so cleanup on close is a no-op for state that was never set up. No compatibility impact. A new zset.close_after_call command in the zset test module opens a string key, turns it into a sorted set with ZUNIONSTORE through ValkeyModule_Call, and closes it; unit/moduleapi/zset.tcl runs it with listpack and B+tree configurations. Only a valgrind run detects the uninitialized read. Observed while checking PR 5080. --------- Signed-off-by: Bara' Hasheesh <bara.hasheesh@gmail.com> Backport-Source-PR: 5358 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
This PR fixes a use-after-free in the handling of `CLUSTERMSG_EXT_TYPE_FORGOTTEN_NODE` cluster-bus PING extensions. A cluster node can use this extension to tell its peers that another node has been forgotten. However, the receiver did not check whether the node named in the extension was also the sender of the message currently being processed. In that case, `clusterDelNode()` deleted the sender and freed its active cluster link and receive buffer. The extension handler then continued processing the same message and later accessed the now-freed sender and link. This could cause memory corruption and crash the server. ### How is it fixed? A node should not be able to legitimately announce that it has forgotten itself. The handler now treats this as an invalid cluster-bus message: - Logs a warning. - Closes the malformed connection. - Returns immediately without deleting the sender or continuing to process the packet. This preserves the existing behavior for valid forgotten-node extensions. Signed-off-by: Roshan Khatri <rvkhatri@amazon.com> Backport-Source-PR: 4675 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
Fixes #5439 #5458 A node can crash on `debugServerAssert(primary->replicaof == NULL)` in `clusterNodeGetPrimary()`, reached through `updateShardId()` from `clusterProcessPacket()`. A node that resumes after a long pause handles a backlog of old gossip: 1. An old packet from R12 says it replicates R15, so the node sets `R12->replicaof = R15`. The node never learns that R12 became a primary. 2. A newer packet from R15 says it replicates R12. R15 was last seen as a replica, so this goes through the unguarded "Primary node changed for this replica?" block, which sets `R15->replicaof = R12`. 3. Now R12 and R15 replicate each other, and the next `updateShardId()` asserts. Skip a replica claim, and log it at NOTICE, when the claimed primary's `replicaof` chain already reaches the sender. The claimed primary's own packet then corrects the view. - No node is promoted on another node's word, which was the objection to assertion from #651 is unchanged. - The check walks the whole chain, so it also catches longer loops such as A → B → C → A. The walk stops after as many steps as there are nodes, so it ends even if the chain already contains a loop. New `tests/unit/cluster/replicaof-cycle.tcl` sends forged replica-claim PINGs, as in `failover-nack.tcl`, to create 2-node and 3-node loops on an observer node. This PR stops new replicaof cycles from forming at runtime. It does not handle a cycle that is already saved in `nodes.conf`. A release build without debug asserts can save one, because this same bug goes unchecked there. The risk if such a file is loaded: `clusterLoadConfig()` restores the links without checking them. With A ↔ B loaded, a claim from another node C naming A links C under the cycle. `clusterNodeGetPrimary(C)` then never returns, and the node hangs at 100% CPU. This behaves the same on `unstable`, so this PR does not make it worse. 1. **Should it be handled in this PR or in a follow-up?** 2. **Repair or reject at load?** - **Repair:** unlink one node in each cycle, never `myself`, log a WARNING and save the config. That node stays a replica with no known primary until its own packets correct the view. Nodes that saved a cycle on an older build keep starting. This matches how the loader already fixes a mismatched replica shard_id instead of aborting. - **Reject:** fail to start with "corrupted cluster config file". This is stricter, since the file alone can't tell which link is stale. The cost is that an affected node needs its `nodes.conf` fixed by hand before it can restart, including after an upgrade. Signed-off-by: Bara' Hasheesh <bara.hasheesh@gmail.com> Backport-Source-PR: 5452 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
…t has stale argc (#3245) Found while reading the code — I have not yet been able to confirm whether this path can materialize in existing real-world scenarios. When an IO thread reads from a client with READ_FLAGS_DONT_PARSE set (because canParseCommand returns 0), processIOThreadsReadDone skips handleParseResults but still checks c->argc > 0 and sets pending_command = 1. However, argc may be stale from a previous incomplete pipelined command parse — it was set by consumeCommandQueue when handleParseResults returned PARSE_NEEDMORE, and was never cleared. This leads to processCommand being called with parsed_cmd == NULL and without READ_FLAGS_COMMAND_NOT_FOUND, triggering the assertion: ==> server.c:4177 'c->read_flags & READ_FLAGS_COMMAND_NOT_FOUND' is not true 1. IO thread parses pipelined commands; the last command is incomplete → cmd_queue entry has argc > 0, parsed_cmd = NULL 2. Main thread consumeCommandQueue pops the incomplete entry → c->argc > 0, c->parsed_cmd = NULL 3. handleParseResults returns PARSE_NEEDMORE → loop breaks, stale argc remains on the client 4. An external event makes canParseCommand return 0 for this client (e.g. close_after_reply, close_asap, or application-specific blocking flags) 5. New data arrives → trySendReadToIOThreads sets READ_FLAGS_DONT_PARSE 6. IO thread reads data, skips parsing 7. processIOThreadsReadDone: stale argc > 0 → pending_command = 1 8. processCommand: parsed_cmd == NULL, COMMAND_NOT_FOUND not set → assertion crash In processIOThreadsReadDone, when DONT_PARSE is set and argc > 0, skip the client. The argc is stale from a previous incomplete parse — the IO thread didn't parse anything new, so there is no valid command to execute. Added DEBUG SET-CLOSE-AFTER-REPLY <client-id> subcommand and a test that reproduces the crash deterministically: 1. Client sends a complete PING + incomplete SET (truncated value) in one pipeline 2. After PING reply confirms the incomplete parse was consumed (stale argc), DEBUG SET-CLOSE-AFTER-REPLY is called from another connection to simulate the external event 3. Client sends remaining data → triggers the DONT_PARSE path → crash on unfixed server --------- Signed-off-by: Arad Zilberstein <aradz@amazon.com> Signed-off-by: Ran Shidlansik <ranshid@amazon.com> Co-authored-by: Ran Shidlansik <ranshid@amazon.com> Backport-Source-PR: 3245 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
When SET has GET and no expiry, the primary propagates it with every argument after the value that spells GET removed. The IFEQ/IFNE comparison value is free-form, so a comparison value of `GET` was removed too, and replicas and the AOF then diverge from the primary. The fix keeps the argument that is the comparison value. Signed-off-by: Madelyn Olson <madelyneolson@gmail.com> Backport-Source-PR: 5090 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
…ue (#5476) In check mode, rdbLoadCheckModuleValue() walks a module value's opcodes until RDB_MODULE_OPCODE_EOF, but the opcode chain had no final branch. An RDB cut between two fields inside a module value made rdbLoadLen() return RDB_LENERR forever, so valkey-check-rdb, and server startup on a truncated RDB, hung at 100% CPU. Report a short read on RDB_LENERR and corruption on any other unknown opcode, and stop the loop. Backport-Source-PR: 5476 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
SWAPDB changes what clients read from both databases, but tracking clients get no invalidation and keep stale cached values. Send the same invalidation FLUSHDB does, to all tracking clients, since the tracking table doesn't store a key's database. --------- Signed-off-by: Kyuwon Jeong <jkw5033@gmail.com> Backport-Source-PR: 5690 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
…5611) Fixes #5608. `lookupStringForBitCommand()` creates or zero-pads the string before the BITFIELD ops run, but `dirty` was only turned into `changes` inside the branch that actually writes. If every write fails with `OVERFLOW FAIL`, `changes` stays 0, so nothing is propagated and the key exists on the primary but not on the replica or in the AOF. This counts the creation/growth as one change in that case, the same way SETBIT treats `dirty`. The command is propagated as is, and the replica ends up with the same zero-padded string. Side effects: a fully rejected BITFIELD that creates or grows the key now behaves like SETBIT does. It fires the `setbit` keyspace event, invalidates WATCH and client tracking on the key, and bumps `dirty`. Tests in `tests/unit/bitfield.tcl`: the replication block covers a new key and a grown key, plus a WATCH test (EXEC used to return PONG there, now nil), and a new `appendonly yes` block checks the created key survives `DEBUG LOADAOF`. All three fail without the bitops.c change and pass with it: ``` ./runtest --single unit/bitfield ``` `unit/bitops` and `unit/pubsub` also pass. --------- Signed-off-by: xhon-pelushi <xhon@pelushi.com> Backport-Source-PR: 5611 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
9aa793a to
69d8833
Compare
### Description User data logged when crash caused by moduleRDBLoadError. ### Change Redact user data when hide-user-data-from-log enabled. Signed-off-by: VanessaTang <yuetan@amazon.com> Backport-Source-PR: 2274 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
In script, client will be replaced with its caller, so commandlog needs to use the metrics of the client that currently executing the command. Signed-off-by: zhaozhao.zz <zhaozhao.zz@alibaba-inc.com> Backport-Source-PR: 2565 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
When using XREAD STREAMS <stream> + on an empty stream created with MKSTREAM, valkey returns an error instead of nil. This happens because is missing a check on the stream length. The fix adds the length check on the condition. Fixes #2728 Signed-off-by: diego-ciciani01 <diego.ciciani@gmail.com> Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech> Backport-Source-PR: 2742 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
`MurmurHash64A()` takes the element length as an `int`, but PFADD passes a `size_t`. For an element of 2^31 bytes or more, the length goes negative and the end pointer lands before the start of the element. The hash loop then reads past the element until the server segfaults. Taking the length as `size_t` fixes this. The hash is unchanged for every element shorter than 2^31 bytes, so existing HyperLogLogs keep their meaning. Signed-off-by: Madelyn Olson <madelyneolson@gmail.com> Backport-Source-PR: 5132 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
The first `hashtableNext` call on a safe iterator pauses rehashing before it checks whether the hashtable has a bucket array, and then stops with the iterator still in its initial position. `hashtableCleanupIterator` never resumes an iterator in that position, so every safe iteration of a table-less hashtable leaks one pause. `FLUSHDB SYNC` on a standalone server leaves the keyspace hashtable in that state, so one `KEYS` afterward stops rehashing that database for good, and 32768 of them wrap the `int16_t` counter and crash the server on the next delete. The fix checks for the missing table before pausing. Signed-off-by: Madelyn Olson <madelyneolson@gmail.com> Backport-Source-PR: 5166 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
While a forked `SCRIPT DEBUG` session is open, `serverCron()` never evaluates the `save` points or the automatic AOF rewrite, so a client that opens a debug session and goes idle stops automatic RDB snapshots and AOF compaction until it disconnects. The save-point checks sit in the `else` of the branch that reaps finished children, and that branch also fires whenever a debugging child is pending. This change still reaps debugging children, but no longer lets them on their own postpone the save points. Signed-off-by: Madelyn Olson <madelyneolson@gmail.com> Backport-Source-PR: 5153 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
…5379) Skip crash memory test under valgrind Signed-off-by: Jim Brunner <brunnerj@amazon.com> Backport-Source-PR: 5379 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
Fixes #5515 #5516 `Replica aborts streaming when the primary link breaks mid-stream` (both `repl-compression no` and `lz4`) fails in daily valgrind job The test holds the replica's RDB load with `key-load-delay 10000`, which is a fixed ~200 s of wall-clock time. During the hold, the primary buffers 4000 `SUNIONSTORE`s of a 10k-member set. Under valgrind those unions took 24-40 min, so: - the load ended on its own first, and the test failed at `assert_equal 1 [s 0 loading]`, or - the flood alone ran past the 2400 s test timeout (lz4), which ends the whole valgrind job. With lz4 there is a second problem. The replica checks the link once per 1 MB decoded (`REPL_DECODE_EVENT_BUDGET`). With a 4 KB key name, each round holds ~250 slow unions, so under valgrind the abort is logged after the 10 s wait has expired. Scale the flood (set size, command count, and key-name length) to the build the test runs on, valgrind or native, so it stays short on both. The assertions are unchanged. | | Native | Valgrind | |---|---|---| | Before | 11-14 s | fails (24-40 min flood on CI) | | After | ~12.5 s | ~25 s | Signed-off-by: Bara' Hasheesh <bara.hasheesh@gmail.com> Backport-Source-PR: 5526 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
Followup for #5452 An older version could save a replicaof cycle (A -> B -> A) to nodes.conf from stale gossip. A later replica claim naming a node in the cycle as its primary then makes clusterNodeGetPrimary() loop forever. The file alone can't tell which link is stale, so fail to start with a corrupted config error. Signed-off-by: Bara' Hasheesh <bara.hasheesh@gmail.com> Backport-Source-PR: 5556 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
Clamp used_memory_dataset (used_memory - used_memory_overhead) at 0 instead of letting the size_t subtraction wrap when the overhead is larger. Backport-Source-PR: 5644 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
…2933) The node ids returned by `ValkeyModule_GetClusterNodesList` are not null terminated, but fixed-length buffers. When these are passed to `ValkeyModule_GetClusterNodeInfo`, which until now required the node id to be null terminated, the node lookup failed or potentially caused undefined behavior when `strlen` read outside of allocated memory. This error can be seen in the example module hellocluster.c included in this repo. This commit changes `ValkeyModule_GetClusterNodeInfo` and `ValkeyModule_GetClusterNodeInfoForClient` to assumes the node id to be exactly 40 bytes long and does not require it to be null terminated. It's not a breaking change, since passing a valid null-terminated node id still works as expected. --------- Signed-off-by: Deepak Nandihalli <deepakrn@users.noreply.github.com> Signed-off-by: Deepak Nandihalli <deepak.nandihalli@gmail.com> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech> Backport-Source-PR: 2933 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
…OFF (#5682) On $ENDOFF, dualChannelReplHandleEndOffsetResponse() starts the PSYNC handshake on the main link with dualChannelSetupMainConnForPsync(). If a write on the main link fails there, that function calls cancelReplicationHandshake(), which aborts the whole dual channel sync: the RDB channel is closed, repl_rdb_transfer_s is NULL and repl_rdb_channel_state is NONE. The caller then set a read handler on the NULL repl_rdb_transfer_s and the replica crashed with SIGSEGV. Return C_RETRY when the RDB channel state is NONE after the main channel setup. C_ERR cannot be used: the error path would abort the sync a second time and replicationAbortDualChannelSyncTransfer() asserts that a sync is in progress. Add an integration test with a fake primary that resets the main link after +DUALCHANNELSYNC and then sends a valid $ENDOFF on the RDB channel. --------- Signed-off-by: Eran Liberty <eran.liberty@gmail.com> Co-authored-by: valkey-review-bot[bot] <282604435+valkey-review-bot[bot]@users.noreply.github.com> Co-authored-by: Ran Shidlansik <ranshid@amazon.com> Backport-Source-PR: 5682 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
Sanitize CR/LF in FUNCTION LIST's error reply for an invalid argument, so it can't break the RESP stream. Backport-Source-PR: 5369 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
Fixes #4935 - AOF rewrite and `CLUSTER MIGRATESLOTS` rebuild consumer-group PELs as `XCLAIM FORCE JUSTID`. That command skipped IDs whose stream entry was already `XDEL`'d / trimmed, so pending ownership and delivery counts diverged from the source. - Keep the live XCLAIM cleanup (`nack != NULL` still drops a dangling PEL entry). Only an obeyed `FORCE JUSTID` with an empty PEL (AOF client, slot import, replica) may recreate the NACK. Signed-off-by: quanyeyang <quanyemostima@gmail.com> Backport-Source-PR: 4973 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
AI backport resolution: source PR #4877Block DEBUG RELOAD and DEBUG LOADAOF in loading and async-loading 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 1bad913df1bc.
|
AI backport resolution: source PR #4973Fix AOF/slot-migration dropping deleted stream PEL entries 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 16dc13747c96.
|
AI backport resolution: source PR #5132Hash HyperLogLog elements with a size_t length 2 AI-edited files Claude Summary
AI-edited files requiring review Full backport commit diff: commit 4137247ec9af.
|
AI backport resolution: source PR #5141Don't block CLUSTER SETSLOT on replica acks when the client cannot block 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 6908bb31babe.
|
AI backport resolution: source PR #5145Ignore new nodes gossiped by a sender still in handshake 3 AI-edited files Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 2371134b08de.
|
AI backport resolution: source PR #5153Do not let forked script debug sessions postpone automatic saves 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit ef582f02c5b0.
|
AI backport resolution: source PR #5176Quote the replicaof host when rewriting the config file 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 0960fb6f0942.
|
AI backport resolution: source PR #5369Sanitize FUNCTION LIST error replies 2 AI-edited files Claude Summary
AI-edited files requiring review Full backport commit diff: commit b7ea7be81e98.
|
AI backport resolution: source PR #5526Fix flaky dual-channel mid-stream abort test under valgrind 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 67b78bc04b35.
|
AI backport resolution: source PR #5556Refuse to load a replicaof cycle from nodes.conf 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit a34ea8f81328.
|
AI backport resolution: source PR #5644Prevent size_t underflow in used_memory_dataset calculation 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 1f3b67ba1be9.
|
AI backport resolution: source PR #5682Abort dual channel sync cleanly when main link write fails after $ENDOFF 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit bc93356beb1f.
|
killAppendOnlyChild() waits with waitpid(-1, ...), which reaps any child that has exited, not just the AOF rewrite child, and drops its status. If a forked SCRIPT DEBUG session has ended but serverCron hasn't reaped it yet, stopping AOF during a rewrite reaps it there. Its pid then stays in the debugger children list, so serverCron logs "waitpid() returned an error" on every tick, and on shutdown the stale pid, which may belong to an unrelated process by then, gets a SIGKILL. This patch waits for server.child_pid only, like TerminateModuleForkChild() already does. serverCron doesn't reap children while a script is running, so the new test ends the debug session while the server is in a busy script, and starts and kills the rewrite right after the script. Once the debug session child is reaped, it checks that the server doesn't try to kill it on shutdown. This affects all versions. Signed-off-by: Sarthak Aggarwal <sarthagg@amazon.com> Backport-Source-PR: 5529 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
AI backport resolution: source PR #5529Fix killAppendOnlyChild reaping children other than the AOF rewrite child 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 5ec1e2f44049.
|
…5558) Followup for #5526 (Was missed when handling the valgrind failures) Fixes #5553 After the mid-stream abort, the replica partially resyncs and has to apply ~2500 buffered SUNIONSTORE commands. On slower CI runners (~3-4 ms per command) that takes 7-10 s, which overruns the fixed 5 s budget in wait_for_ofs_sync. `wait_for_ofs_sync` now takes optional maxtries/delay arguments (defaults unchanged), and this test uses 30s (3x largest observed delay). The failure message also prints both offsets, so a real stall can be told apart from a slow apply. Signed-off-by: Bara' Hasheesh <bara.hasheesh@gmail.com> Co-authored-by: Ran Shidlansik <ranshid@amazon.com> Backport-Source-PR: 5558 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
AI backport resolution: source PR #5558Extend offset-sync wait after mid-stream abort in dual-channel test 2 AI-edited files Claude Summary
AI-edited files requiring review Full backport commit diff: commit fc9f63458e7b.
|
Backport sweep for 8.1
Automated cherry-picks from PRs marked "To be backported".
Applied
AI resolution details are posted as comments on this PR when available.
Needs attention
These candidates could not be applied automatically and need a maintainer to follow up.
4 candidate(s)
Generated by valkey-ci-agent using Claude Code.