Repository navigation
[backport] Backport sweep for 9.0 - #5498
valkeyrie-ops[bot] wants to merge 51 commits into
Conversation
AI backport resolution: source PR #5366Fix double mutex unlock when shrinking IO threads 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit ac78eb4759de.
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
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 0e5440f03d60.
|
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 3f55eed52039.
|
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 d5e1244a3a98.
|
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 cb5aac5c30b4.
|
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 bc2f29121056.
|
AI backport resolution: source PR #5090Keep an IFEQ/IFNE value spelled GET when propagating SET GET 7 AI-edited files Claude Summary
AI-edited files requiring review
Full backport commit diff: commit f8b3f231618d.
|
AI backport resolution: source PR #4971Skip pubsub channel defrag while a pending reply holds a reference 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 7673e6cb375d.
|
AI backport resolution: source PR #5476Fix RDB checker infinite loop on an RDB truncated inside a module value 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 1e9d5af8f952.
|
AI backport resolution: source PR #5143Keep slot imports loaded during a swapdb full sync 3 AI-edited files Claude Summary
AI-edited files requiring review
Full backport commit diff: commit a662c9c7924c.
|
When the IO threads pool shrinks, updateIOThreads unlocks each removed thread's mutex and then calls shutdownIOThread, which unlocks the same mutex again. Unlocking a mutex that is not locked is undefined behavior. The unlock in shutdownIOThread was added in #2898, but the older one in updateIOThreads was never removed. This PR removes it, so shutdownIOThread is the single owner of the unlock, as it already is for killIOThreads. No behavior change on Linux or macOS, where the second unlock on a default mutex returns 0; the existing io-threads.tcl shrink tests cover the path. Signed-off-by: Sarthak Aggarwal <sarthagg@amazon.com> Backport-Source-PR: 5366 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
…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>
…4971) With reply copy avoidance, a queued SUBSCRIBE/UNSUBSCRIBE reply keeps a reference to a RAW channel object until it is written. A subscriber that stops reading keeps that reference, so the next pubsub defrag pass aborts on the refcount assert in defragPubsubScanCallback. Only move the channel when its refcount is exactly subscribers + 1, and skip it for this cycle otherwise. The assert becomes >=, so a missing reference still aborts. This also makes channel name defrag work again. Since the switch to hashtable, the callback used activeDefragStringOb(), which skips any object with refcount != 1, so channels were never moved. The old object is now freed only after every client's reference points at the new one, because the loop looks clients up by the old pointer. --------- Signed-off-by: Yechiel Merzbach <yechielm@amazon.com> Co-authored-by: Ran Shidlansik <ranshid@amazon.com> Backport-Source-PR: 4971 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>
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>
…B IDs (#5471) `valkey-check-rdb` starts with `selected_dbid = -1`. With `--stats`, a key that comes before any `SELECTDB` opcode makes `computeDatasetProfile()` index `rdbstate.stats[type + (-1) * OBJ_TYPE_MAX]`, before the start of the array, and crash. The server loads such keys into DB 0, so the checker now starts from DB 0 too. The DB ID read from `SELECTDB` is a 64-bit length stored in an `int`, and `(databases + 1) * OBJ_TYPE_MAX` is computed as an `int`. `SELECTDB 4294967295` sets `selected_dbid` back to -1, and IDs near `INT_MAX` overflow the size computation. IDs above `INT_MAX` are now reported as "Invalid DB ID", and with `--stats`, IDs from `INT_MAX / OBJ_TYPE_MAX` on are reported as too large for `--stats`. Both problems came with the RDB analysis reports (#1743), so they are in every release since 9.0.0. Backport-Source-PR: 5471 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>
If a module blocks a client on keys whose slots differ from the command's slot, the blocked client is later checked by clientsCronHandleTimeout(), which calls clusterRedirectBlockedClientIfNeeded(). There it hits the slot == c->slot assertion (added in #2165), since we do not allow cross-slot commands, and the server aborts. A module can reach this through incorrect use of the API. Even though it is a misuse, it should not be able to crash the server, so reject it in moduleBlockClient() by checking each key against c->slot and reply with an error instead of blocking. Modules that set VALKEYMODULE_CLUSTER_FLAG_NO_REDIRECTION manage key distribution themselves, so skip the validation for them, including the redirect check in clusterRedirectBlockedClientIfNeeded(). This adds one more error path that aborts after the blocked handle has been allocated. Such paths must reset bc->client to NULL, otherwise a later VM_UnblockClient() dereferences will crash the server. Only the Lua/MULTI path did this; apply the same to the other paths as well. Detached handles from key-blocking calls must also be releasable with VM_UnblockClient() even when no timeout callback was provided; otherwise they leak. Signed-off-by: Binbin <binloveplay1314@qq.com> Backport-Source-PR: 4541 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
…5713) A module command that asks for information about its own caller crashes the server when it runs from a script, a function or `VM_Call`. A typical case is an audit or rate-limiting module that logs or limits by the caller's address: ```c int AuditSet(ValkeyModuleCtx *ctx, ValkeyModuleString **argv, int argc) { ValkeyModuleClientInfo ci = VALKEYMODULE_CLIENTINFO_INITIALIZER_V1; ValkeyModule_GetClientInfoById(&ci, ValkeyModule_GetClientId(ctx)); log_access(ci.addr, ci.port, argv[1]); ... } ``` `AUDIT.SET k v` from a normal client works, but the following crashes with SIGSEGV: ``` EVAL "return server.call('AUDIT.SET', KEYS[1], ARGV[1])" 1 k v ``` Inside the script the command runs through the script's fake client, which has no connection, and `call()` makes it `server.executing_client`. `VM_GetClientInfoById()` returns `server.executing_client` when the id matches, and `modulePopulateClientInfoStructure()` then dereferences `client->conn` for the TLS flag and the peer address. `modulePopulateClientInfoStructure()` skips the TLS flag and the peer address and port when the client has no connection. The structure is zeroed first, so such clients report an empty address and port 0, and still report their other flags (including `fake`), db and id. New test in `tests/unit/moduleapi/misc.tcl`, "test module clientinfo api - called from a script", runs `test.clientinfo` through `EVAL` and checks the returned info. Without the fix the server crashes with signal 11. --------- Signed-off-by: Eran Liberty <eran.liberty@gmail.com> Co-authored-by: Bara' Hasheesh <bara.hasheesh@gmail.com> Backport-Source-PR: 5713 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
AI backport resolution: source PR #4541Reject module cross-slot BlockClientOnKeys in cluster mode 2 AI-edited files Claude Summary
AI-edited files requiring review Full backport commit diff: commit f61377dad6aa.
|
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 2927dc1221eb.
|
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 339b8cbb5073.
|
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 0544e77a4850.
|
AI backport resolution: source PR #5359Reset slot migration snapshot pipes when the snapshot fork fails 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 50b969b07b08.
|
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 8a615b87299e.
|
AI backport resolution: source PR #5471Fix valkey-check-rdb --stats crash on keys before SELECTDB and huge DB IDs 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit ba9554742b18.
|
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 1e00d07bec13.
|
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 462d6e985881.
|
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 9c68120b55a0.
|
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 2c6bfaccb9a8.
|
AI backport resolution: source PR #5713Fix crash in VM_GetClientInfoById for a client without a connection 2 AI-edited files Claude Summary
AI-edited files requiring review Full backport commit diff: commit 5e50cb324e5b.
|
Apple ARM64 uses 53-bit precision for long doble. Formatting the integer result through long double can round large integers on a platform with insufficient precision. Signed-off-by: Masahiro Ide <masahiro.ide@lycorp.co.jp> Backport-Source-PR: 5511 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
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 9ce634b59aad.
|
…#5144) A replica loading a disk-based full sync processes events from inside `rdbLoad()`. If a cluster bus message handled there moves it to a new primary (an ordinary failover, or `CLUSTER FAILOVER TAKEOVER` on another replica), the sync being loaded is cancelled and a new handshake starts. When the load returns, the replica finalizes the cancelled sync anyway. It closes the new sync's temp file, reports the link as up with the new primary's replication ID, and keeps the old primary's dataset with no further resync. This patch treats a load that spans a `cancelReplicationHandshake()` call as failed and leaves the newer sync's state alone. Signed-off-by: Madelyn Olson <madelyneolson@gmail.com> Backport-Source-PR: 5144 Signed-off-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>
AI backport resolution: source PR #5144Don't finalize a full sync that was cancelled while loading from disk 2 AI-edited files Claude Summary
AI-edited files requiring review Full backport commit diff: commit b33410bb602e.
|
…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>
The Daily reply-schemas-validator job fails since the test "Active Defrag pubsub with a pending channel reply" was added in #4971: Reply schema validation failed for CONFIG SET min-io-threads-avoid-copy-reply: 'OK' was expected (response: null) The test runs "config set min-io-threads-avoid-copy-reply 1" on a server without IO threads. After that, isCopyAvoidPreferred() returns 1 for every reply, so each reply buffer starts with a binary payload header (and holds object pointers for bulk strings) instead of plain RESP. The req-res logger (reqresAppendResponse() in src/logreqres.c) copies the reply buffer as is, so the .reqres file holds the header before "+OK" and the validator cannot parse the reply. The test needs copy avoidance for its whole body, so it cannot run in log-req-res mode. Tag it with logreqres:skip, like the other tests that set min-io-threads-avoid-copy-reply to 1 (tests/unit/networking.tcl and tests/unit/obuf-limits.tcl). It still runs in all other jobs. The {0} result pattern is the value that "$listener close" returns. Fixes #5642 Signed-off-by: Eran Ifrah <eifrah@amazon.com> Backport-Source-PR: 5655 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 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 77c3363a1825.
|
Backport sweep for 9.0
Automated cherry-picks from PRs marked "To be backported".
CI fixes for this sweep are in #5701.
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.
7 candidate(s)
Generated by valkey-ci-agent using Claude Code.