Skip to content

[8.6] [MOD-14066] fix handling GC Out of Mem on replica#8462

Merged
redisearch-backport-pull-request[bot] merged 1 commit into8.6from
backport-8439-to-8.6
Feb 24, 2026
Merged

[8.6] [MOD-14066] fix handling GC Out of Mem on replica#8462
redisearch-backport-pull-request[bot] merged 1 commit into8.6from
backport-8439-to-8.6

Conversation

@redisearch-backport-pull-request
Copy link
Copy Markdown
Contributor

@redisearch-backport-pull-request redisearch-backport-pull-request Bot commented Feb 24, 2026

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 maxmemory is exceeded; on replicas it now bases the OOM decision on max_process_mem only (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 verifies GC_FORCEINVOKE still collects bytes on the replica.

Written by Cursor Bugbot for commit e311c8e. This will update automatically on new commits. Configure here.

* fix handling GC Out of Mem on replica

* simplify

* add OOM test on slave

(cherry picked from commit 8b9502e)
@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented Feb 24, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Comment thread src/fork_gc.c
RedisModule_FreeServerInfo(ctx, info);

used_memory_ratio = max_process_mem ? (float)used_memory / (float)max_process_mem : 0;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix in Cursor Fix in Web

Triggered by project rule: Please assist in writing a GitHub release note for this PR, which is concise and focused on the user impact.

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.85%. Comparing base (5e30b8a) to head (e311c8e).
⚠️ Report is 1 commits behind head on 8.6.

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           
Flag Coverage Δ
flow 84.78% <100.00%> (+<0.01%) ⬆️
unit 50.59% <44.44%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@redisearch-backport-pull-request redisearch-backport-pull-request Bot added this pull request to the merge queue Feb 24, 2026
Merged via the queue into 8.6 with commit 459d67d Feb 24, 2026
50 of 52 checks passed
@redisearch-backport-pull-request redisearch-backport-pull-request Bot deleted the backport-8439-to-8.6 branch February 24, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant