[backport] Backport sweep for 7.2 - #4560
valkeyrie-ops[bot] wants to merge 5 commits into
Conversation
When a replica disconnects from its primary, replicationCachePrimary() calls unlinkClient(), which sets c->conn to NULL. freeClient() only rolled back the client's memory from stat_clients_type_memory[] when c->conn was non-NULL, so the cached primary's contribution leaked. It causes the replica side to see a high value for the `mem_clients_normal` INFO field. A client is only accounted while connected: updateClientMemoryUsage() (the only place that sets c->last_memory_usage) asserts c->conn. Use c->last_memory_usage as the rollback condition so a previously counted client is always subtracted, regardless of c->conn. Add a debug assert that either c->conn is set or we are releasing a cached_primary. Signed-off-by: Binbin <binloveplay1314@qq.com> Backport-Source-PR: 4395
d7dc484 to
c38fadd
Compare
AI backport resolution: source PR #4395Fix mem_clients_type_memory leak for cached primary client 2 AI-edited files Claude Summary
AI-edited files requiring review Full backport commit diff: commit c38faddcf164.
|
Debian 11 Bullseye has reached end of life, and package rotations are causing apt installs in the build-debian-old job to fail with 404 errors. Switch the job to Debian 12 Bookworm so it continues testing against the oldest supported Debian toolchain without relying on EOL package mirrors. Signed-off-by: Rain Valentine <rsg000@gmail.com> Backport-Source-PR: 4613
Fix missing `signalModifiedKey()` calls for stream commands that mutate stream metadata rather than stream entries themselves. Fixes #3429 A few stream commands already mutate consumer-group or PEL state, increment `server.dirty`, and propagate changes to AOF / replicas, but they do not always mark the key as modified for `WATCH` and client tracking invalidation. Affected command paths: - `XGROUP CREATE/SETID/DESTROY/CREATECONSUMER/DELCONSUMER` - `XSETID` - `XREADGROUP` - `XACK` - `XCLAIM` - `XAUTOCLAIM` Changes: - Added `signalModifiedKey()` to `XGROUP CREATE/SETID/DESTROY/CREATECONSUMER/DELCONSUMER` - Added `signalModifiedKey()` to `XSETID` - Updated `XREADGROUP` to signal key modification when synchronous group reads or consumer creation mutate stream metadata - Updated `XACK`, `XCLAIM`, and `XAUTOCLAIM` to signal key modification once per command when they actually mutate PEL or consumer-group state Additional change: - Don't emit xdel event for XDELEX DELREF, when removing an orphaned PEL ref without deleting the actual stream entry. --------- Signed-off-by: Tarte <emprimula@gmail.com> Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech> Co-authored-by: Ran Shidlansik <ranshid@amazon.com> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech> Backport-Source-PR: 3459
AI backport resolution: source PR #3459Fix missing signalModifiedKey calls for stream commands 3 AI-edited files Claude Summary
AI-edited files requiring review
Full backport commit diff: commit ed1dc7f37aee.
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
#4676) `ValkeyModule_FreeModuleUser`, `ValkeyModule_ACLAddLogEntry` and `ValkeyModule_ACLAddLogEntryByUserName` are declared in valkeymodule.h as returning void, but the implementations (`VM_FreeModuleUser`, `VM_ACLAddLogEntry`, `VM_ACLAddLogEntryByUserName`) return int, and the latter two document `VALKEYMODULE_OK` / `VALKEYMODULE_ERR`. Modules calling them through the API table therefore call an int function via a void function pointer, which is undefined behavior in C. On x86-64 and arm64 the discarded return register makes it harmless in practice; on a target with strict indirect-call signature checking (WebAssembly) the call traps. Declare them as int to match the implementation. Existing modules that ignore the return value are unaffected; modules can now check the result of the ACL log calls as documented. Also document that `FreeModuleUser` returns `VALKEYMODULE_OK`. Found by compiling the server with Emscripten, where `redis.acl_check_cmd` in a Lua script (which calls `FreeModuleUser` through the API table) trapped with 'null function or function signature mismatch'. Signed-off-by: Rain Valentine <rsg000@gmail.com> Backport-Source-PR: 4676
AI backport resolution: source PR #4676Fix return types of three module API declarations to match definitions 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 6b8cd8a5bd80.
|
|
Automatic follow-up for the current backport head. I did not push a fix: Cannot verify the 'test-almalinux8-jemalloc' job in a controlled environment (job 'test-almalinux8-jemalloc' not found in any workflow, or its environment is unsupported); refusing rather than pushing an unverified fix. Looked at the failure from this run. Other checks also failed in that run; re-invoke with the same command to address the next one:
|
|
Automatic follow-up for the current backport head. I did not push a fix: This is a timing-dependent flake, not a deterministic breakage: the same test passed in all other jobs of this run, and even the default branch's modern copy of the test (tests/unit/cluster/cluster-shards.tcl) uses the identical 5-second wait, so no upstream fix exists to port. Widening the timeout myself would just mask nondeterministic sanitizer slowness rather than fix mechanical scaffolding, and the failure cannot be deterministically reproduced to verify such a change. Looked at the failure from this run. Other checks also failed in that run; re-invoke with the same command to address the next one:
|
Pointed out by @zuiderkwast in [PR Valkey remembers that TLS was enabled between builds, but not which OpenSSL installation was selected. After building with a custom `OPENSSL_PREFIX`, running a plain `make` later may discover a different system OpenSSL. This changes the build flags, triggers an unexpected full rebuild, and links Valkey against an unintended OpenSSL installation. Signed-off-by: Sarthak Aggarwal <sarthagg@amazon.com> Backport-Source-PR: 4738
AI backport resolution: source PR #4738Persist OPENSSL_PREFIX across builds 1 AI-edited file Claude Summary
AI-edited files requiring review
Full backport commit diff: commit 75ed47314bc1.
|
Backport sweep for 7.2
Automated cherry-picks from PRs marked "To be backported".
Applied
AI resolution details are posted as comments on this PR when available.
Generated by valkey-ci-agent using Claude Code.