Skip to content

[MOD-18502] Move shard and standalone FAIL reply serialization off the main thread - #11541

Merged
lerman25 merged 2 commits into
8.10from
omerl-fail-bg-shard-search-agg-8.10
Sep 24, 2026
Merged

lerman25 merged 2 commits into
8.10from
omerl-fail-bg-shard-search-agg-8.10

Conversation

@lerman25

@lerman25 lerman25 commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Describe the changes in the pull request

Shard and standalone SEARCH/AGGREGATE under ON_TIMEOUT FAIL currently serialize buffered results on the main thread. This moves reply serialization to the worker while preserving complete-chunk collection, so late APPLY/FILTER errors still replace the entire chunk.

Selected FAIL requests use the existing direct serialization path with no reply callback. The blocked-client deadline remains active through encoding; Redis discards the private reply buffer when timeout wins. Cursor completion runs in blocked-client free-data cleanup, freeing timed-out or exhausted cursors and pausing other nonterminal cursors.

This covers RESP2/RESP3, PROFILE, internal shard commands, initial cursors, and cursor READ. RETURN, RETURN_STRICT, coordinator execution, HYBRID, and inline dispatch retain their existing behavior. Serialization uses RETURN's existing spec-lock lifecycle.

Worker metrics count serialization attempts even when timeout discards the reply. When both the timeout callback and worker report a timeout, both increment the module timeout counter.

Validation:

  • Debug build and 988 C/C++ unit tests passed.
  • Consolidated test_blocked_client_timeout standalone suite: 67 passed, 5 skipped, no failures.
  • Coverage includes reply parity, late errors, cursor policy/protocol/worker transitions, queued cleanup, and timeout before/during/after encoding.

Follows #11534, merged into 8.10.

Which additional issues this PR fixes

MOD-18502

Main objects this PR modified

  • AREQ dispatch, worker completion, and cursor cleanup.
  • Blocked-client assertions allowing a timeout callback without a reply callback.
  • Debug sync points and consolidated blocked-client timeout tests.

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-24T13:18:42.695741Z ee21817 New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7bb18a877b

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

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/aggregate/aggregate_exec.c Resolved
Comment thread src/aggregate/aggregate_exec.c Resolved
Comment thread src/aggregate/aggregate_exec.c Resolved
@github-actions github-actions Bot added size:L and removed size:M labels Sep 24, 2026
@lerman25
lerman25 enabled auto-merge September 24, 2026 13:53
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
5.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@lerman25
lerman25 added this pull request to the merge queue Sep 24, 2026
Merged via the queue into 8.10 with commit 4b9a582 Sep 24, 2026
28 of 31 checks passed
@lerman25
lerman25 deleted the omerl-fail-bg-shard-search-agg-8.10 branch September 24, 2026 15:54
@redisearch-backport-pull-request

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

Copy link
Copy Markdown
Contributor

🤖 Auto-backport summary

Target Status Backport PR
8.6-rse error Non-mechanical cursor lifetime conflicts in src/aggregate/aggregate_exec.c and src/info/info_redis/block_client.c: this release uses BlockCursorClient with no timeout/reply callbacks or private AREQ cleanup, and lacks BlockClientCtx, AREQ_CleanUpStoredCursor and cached cursor queryTimeoutPolicy. The PR assumes those facilities to keep deadlines active and finalize cursors safely after worker serialization. Selecting and porting the prerequisite cursor ownership/timer changes would extend beyond the supplied commit and requires a maintainer design decision. Cherry-pick aborted; no backport commit retained for this target.
8.8 conflicts(3) #11554
8.8-rse clean #11553

(PR #11541, 4b9a5820c — 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
…e main thread

Port the FAIL path from OSS 8.10 pull request #11541 to master.
lerman25 added a commit that referenced this pull request Nov 25, 2026
…e main thread

Use QueryRequest's blocked-client ownership for FAIL worker replies. Release the index read lock after collecting the chunk and port standalone RESP2 and RESP3 reply parity tests.

Port the FAIL path from OSS 8.10 pull request #11541.
lerman25 added a commit that referenced this pull request Nov 25, 2026
…e main thread

Use callback-free FAIL worker replies and release the index read lock before encoding buffered rows. Exercise standalone RESP2 and RESP3 reply parity.

Port the FAIL path from OSS 8.10 pull request #11541.
lerman25 added a commit that referenced this pull request Nov 29, 2026
…e main thread

Use callback-free FAIL worker replies and release the index read lock before encoding buffered rows. Exercise standalone RESP2 and RESP3 reply parity.

Port the FAIL path from OSS 8.10 pull request #11541.
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