[8.6] [MOD-14066] fix handling GC Out of Mem on replica#8462
[8.6] [MOD-14066] fix handling GC Out of Mem on replica#8462redisearch-backport-pull-request[bot] merged 1 commit into8.6from
Conversation
* fix handling GC Out of Mem on replica * simplify * add OOM test on slave (cherry picked from commit 8b9502e)
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
| RedisModule_FreeServerInfo(ctx, info); | ||
|
|
||
| used_memory_ratio = max_process_mem ? (float)used_memory / (float)max_process_mem : 0; | ||
| } |
There was a problem hiding this comment.
Missing release note for user-impacting GC fix
Low Severity
This PR fixes a significant user-facing issue — GC cycles being skipped on replicas due to maxmemory-based OOM checks, causing memory growth — but does not include a release note. A suggested release note: "Fixed an issue where garbage collection cycles on replicas were frequently skipped due to maxmemory OOM checks, leading to increased memory usage. Replicas now only consider max_process_mem for GC OOM decisions."
Triggered by project rule: Please assist in writing a GitHub release note for this PR, which is concise and focused on the user impact.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.6 #8462 +/- ##
=======================================
Coverage 83.85% 83.85%
=======================================
Files 367 367
Lines 55641 55649 +8
Branches 14319 14319
=======================================
+ Hits 46660 46667 +7
- Misses 8820 8821 +1
Partials 161 161
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|





Description
Backport of #8439 to
8.6.On replica side, only max_process_mem will be taken into account to decide cancelling a GC run.
This avoid many skips of the GC cycles in replicas which avoids memory increase
Note
Medium Risk
Changes when GC will run under memory pressure on replicas, which could affect stability/performance if the new heuristic is wrong or server info fields behave differently across Redis versions.
Overview
Fork GC no longer cancels runs on replicas just because
maxmemoryis exceeded; on replicas it now bases the OOM decision onmax_process_memonly (while masters keep the existing unified memory-ratio check).Adds a regression test that starts a master/replica setup, constrains the replica’s
maxmemory, and verifiesGC_FORCEINVOKEstill collects bytes on the replica.Written by Cursor Bugbot for commit e311c8e. This will update automatically on new commits. Configure here.