Skip to content

[MOD-18502] Restore background reply serialization for coordinator SEARCH with FAIL and RETURN - #11534

Merged
lerman25 merged 1 commit into
8.10from
omerl-fail-bg-serialization-8.10
Sep 23, 2026
Merged

lerman25 merged 1 commit into
8.10from
omerl-fail-bg-serialization-8.10

Conversation

@lerman25

@lerman25 lerman25 commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Describe the changes in the pull request

  1. Current: Coordinator FT.SEARCH serializes replies on the Redis main thread under FAIL and RETURN, limiting concurrency for large replies. FAIL timeout handling also waits for an active reducer.
  2. Change: Serialize coordinator SEARCH/PROFILE results and execution errors on the background worker for FAIL/RETURN. A FAIL timeout replies immediately and Redis discards the worker's reply buffer; worker-owned completion preserves its lifetime.
  3. Outcome: Removes coordinator reply serialization from the main thread for FAIL/RETURN while preserving RETURN_STRICT's existing main-thread serialization and synchronization. This is a partial fix for MOD-18502, limited to coordinator SEARCH.

Zero-send fanout retains its existing direct unblock and main-thread error reply. No Redis API, reply format, standalone/shard query path, or other query type is changed. Deterministic RESP2/RESP3 tests cover timeout/disconnect during and after serialization, successful flushing with TIMEOUT 0 and a non-expired timeout, and preparation/shard/zero-send errors. Timeout races use CLIENT UNBLOCK TIMEOUT.

Which additional issues this PR fixes

Contributes to MOD-18502; remaining query paths are separate work.

Main objects this PR modified

  • Coordinator SEARCH request, reducer, reply and timeout callbacks in src/module.c and src/module.h.
  • Coordinator timeout and reply cleanup tests in tests/pytests/test_coord_timeout_cleanup.py.

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

Release Notes

  • This PR requires release notes
  • This PR does not require release notes

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-23T12:43:42.113419Z e6ab6b6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Comment thread src/module.c
return;
}
if (MRCtx_GetNumReplied(mrctx) == 0) {
RedisModule_ReplyWithError(ctx, "Could not send query to cluster");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't we have a definition for that message?

@lerman25
lerman25 added this pull request to the merge queue Sep 23, 2026
Merged via the queue into 8.10 with commit c99147f Sep 23, 2026
45 of 47 checks passed
@lerman25
lerman25 deleted the omerl-fail-bg-serialization-8.10 branch September 23, 2026 15:34
@redisearch-backport-pull-request

redisearch-backport-pull-request Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Auto-backport summary

Target Status Backport PR
8.6-rse conflicts(1) #11540
8.8 conflicts(1) #11538
8.8-rse conflicts(1) #11539

(PR #11534, c99147fc2 — generated by the auto-backport workflow.)

Workflow run · Retry unfinished targets with /backport <branches>.

lerman25 added a commit that referenced this pull request Nov 25, 2026
…main thread

Port the FAIL path from OSS 8.10 pull request #11534 to master.
lerman25 added a commit that referenced this pull request Nov 25, 2026
…ARCH with FAIL

Use a reducer-local reply context and follow the same lifetime in the preparation error path. Serialize context setup with cancellation using the request mutex. Cover cancellation during and after reply serialization.

Port the FAIL path from OSS 8.10 pull request #11534.
lerman25 added a commit that referenced this pull request Nov 25, 2026
…ARCH with FAIL

Create the reply context on the worker. Synchronize coordinator SEARCH cancellation with context creation in the reducer.

Port the FAIL path from OSS 8.10 pull request #11534.
lerman25 added a commit that referenced this pull request Nov 29, 2026
…ARCH with FAIL

Use the same worker reply context and direct error replies as OSS 8.10.

Port the FAIL path from OSS 8.10 pull request #11534.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants