Skip to content

[8.4] [MOD-11817] FT.AGGREGATE show Background Indexing OOM warning#7153

Merged
lerman25 merged 1 commit into8.4from
backport-7141-to-8.4
Oct 27, 2025
Merged

[8.4] [MOD-11817] FT.AGGREGATE show Background Indexing OOM warning#7153
lerman25 merged 1 commit into8.4from
backport-7141-to-8.4

Conversation

@redisearch-backport-pull-request
Copy link
Contributor

@redisearch-backport-pull-request redisearch-backport-pull-request bot commented Oct 26, 2025

Description

Backport of #7141 to 8.4.


Note

Shows background indexing OOM warnings in FT.AGGREGATE RESP3 replies and propagates them through the coordinator, with tests and minor infra tweaks.

  • Aggregate (RESP3):
    • Adds warning entries to FT.AGGREGATE replies for background indexing OOM: checks qctx->bgScanOOM (coordinator) or sctx->spec->scan_failed_OOM (shards).
  • Coordinator:
    • In rpnet, parses shard warning and sets AREQ_QueryProcessingCtx(...)->bgScanOOM on QUERY_WINDEXING_FAILURE to propagate OOM status to the client.
  • Core API:
    • Extends QueryProcessingCtx with bool bgScanOOM.
  • Tests:
    • Update OOM tests to assert RESP3 warnings for FT.SEARCH, FT.PROFILE, and FT.AGGREGATE.
    • Add TimeLimit guards to wait helpers and use shared info_modules_oom_count_str key.
    • Adjust cluster tests to self-init env and verify warnings across shards.

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

* Check aggregate in verbosity test

* check verbosity in tests

* Check bg scan warning and raise accordingly

* Refractor tests

* Add comment

* fix comment

(cherry picked from commit 49a986c)
Copy link

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

Bug: Inconsistent OOM Handling Across Response Types

In sendChunk_Resp2, the ProfilePrinterCtx is initialized with bgScanOOM from sctx->spec->scan_failed_OOM, but qctx->bgScanOOM is not checked. This is inconsistent with sendChunk_Resp3 (line 589) which checks both qctx->bgScanOOM (for coordinator) and sctx->spec->scan_failed_OOM (for shards). In a coordinator scenario using RESP2, the background indexing OOM warning will not be propagated even if qctx->bgScanOOM is true.

src/aggregate/aggregate_exec.c#L455-L476

}
done_2:
RedisModule_Reply_ArrayEnd(reply); // </results>
cursor_done = (rc != RS_RESULT_OK
&& !(rc == RS_RESULT_TIMEDOUT
&& req->reqConfig.timeoutPolicy == TimeoutPolicy_Return));
bool has_timedout = (rc == RS_RESULT_TIMEDOUT) || hasTimeoutError(qctx->err);
// Prepare profile printer context
RedisSearchCtx *sctx = AREQ_SearchCtx(req);
ProfilePrinterCtx profileCtx = {
.req = req,
.timedout = has_timedout,
.reachedMaxPrefixExpansions = QueryError_HasReachedMaxPrefixExpansionsWarning(qctx->err),
.bgScanOOM = sctx->spec && sctx->spec->scan_failed_OOM,
.queryOOM = QueryError_HasQueryOOMWarning(qctx->err),
};
if (AREQ_RequestFlags(req) & QEXEC_F_IS_CURSOR) {

Fix in Cursor Fix in Web


@codecov
Copy link

codecov bot commented Oct 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.62%. Comparing base (48ee400) to head (40b7030).
⚠️ Report is 10 commits behind head on 8.4.

Additional details and impacted files
@@            Coverage Diff             @@
##              8.4    #7153      +/-   ##
==========================================
- Coverage   85.67%   85.62%   -0.05%     
==========================================
  Files         327      326       -1     
  Lines       51945    50902    -1043     
  Branches    10921    10921              
==========================================
- Hits        44503    43585     -918     
+ Misses       7276     7151     -125     
  Partials      166      166              
Flag Coverage Δ
flow 84.24% <100.00%> (-0.08%) ⬇️
unit 51.72% <0.00%> (+0.13%) ⬆️

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 Oct 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 27, 2025
@lerman25 lerman25 added this pull request to the merge queue Oct 27, 2025
Merged via the queue into 8.4 with commit edf2d2a Oct 27, 2025
22 checks passed
@lerman25 lerman25 deleted the backport-7141-to-8.4 branch October 27, 2025 13:18
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