Skip to content

[2.8] [MOD-12320] [MOD-12625] Ensure full profile output on timeout with RETURN policy#7480

Merged
meiravgri merged 2 commits into2.8from
backport-7472-to-2.8
Nov 24, 2025
Merged

[2.8] [MOD-12320] [MOD-12625] Ensure full profile output on timeout with RETURN policy#7480
meiravgri merged 2 commits into2.8from
backport-7472-to-2.8

Conversation

@meiravgri
Copy link
Copy Markdown
Collaborator

@meiravgri meiravgri commented Nov 24, 2025

Backport #7345 (MOD-12320) and #7472 (MOD-12625) to 2.8


Note

Ensures complete profile output on timeouts (RETURN policy) by tracking profiling state, draining pending shard replies, and adding FT.CURSOR PROFILE; updates command/iterator APIs and tests.

  • Coordinator/Distributed Execution:
    • Add MRCommand.forProfiling flag and new root command C_PROFILE; propagate through command copy and cursor flow.
    • On RESP3 profile replies, detect timeout warnings and mark iterator timed out to trigger CURSOR PROFILE on next dispatch.
    • Extend getCursorCommand to send _FT.CURSOR PROFILE when timed out on profile queries; preserve flags.
    • Add iterator helpers MRIterator_GetChannelSize and MRIterator_GetNumShards.
  • Profile Aggregation:
    • In printAggProfile, collect profile info from current and remaining channel replies; drain channel until empty; warn if partial shard profiles.
    • Track AREQ.has_timedout and pass in ProfilePrinterCtx consistently.
  • Cursor/Profile Commands:
    • Implement FT.CURSOR PROFILE {index} {cid} to return profile (with empty/dummy results) and free the cursor; errors for missing/non-profile cursors.
    • Add sendChunk_ReplyOnly_EmptyResults to emit profile without results (RESP2/RESP3, cursor/non-cursor).
  • Pipeline/Replies:
    • Ensure profile data is preserved when pager stops early; include dummy row for profile replies so they aren’t discarded.
  • Tests:
    • Add/adjust tests for cursor profile, coordinator timeout warnings (RESP2/RESP3), and partial-consumed results ensuring shard profiles are returned.

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

…policy (#7472)

* not backported yet:
aggregate_exec.c
dist_aggregate.c
test_profile.py

* introduce forProfiling in MRCommand

* rewrite sendChunk_ReplyOnly_EmptyResults with a dummy result
 rewrite: printAggProfile

getNextReply frees the reply so no need to free it

add test

* wrap dummy result in isProfile

* fix return early

* consume current result

* add test to partially consumed

(cherry picked from commit 3d4e635)
@meiravgri meiravgri requested a review from GuyAv46 November 24, 2025 04:56
@meiravgri meiravgri enabled auto-merge November 24, 2025 04:58
Comment thread src/aggregate/aggregate_exec.c
Comment thread coord/src/dist_aggregate.c Outdated
@meiravgri meiravgri changed the title [2.8] [MOD-12320] [MOD-12625] Ensure full profile output on timeout with RETURN policy (#7472) [2.8] [MOD-12320] [MOD-12625] Ensure full profile output on timeout with RETURN policy Nov 24, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 24, 2025

Codecov Report

❌ Patch coverage is 93.63636% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.47%. Comparing base (1887694) to head (100c4b9).
⚠️ Report is 1 commits behind head on 2.8.

Files with missing lines Patch % Lines
src/aggregate/aggregate_exec.c 92.85% 5 Missing ⚠️
coord/src/dist_aggregate.c 93.93% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              2.8    #7480      +/-   ##
==========================================
- Coverage   87.50%   87.47%   -0.03%     
==========================================
  Files         203      203              
  Lines       34812    34918     +106     
==========================================
+ Hits        30461    30546      +85     
- Misses       4351     4372      +21     
Flag Coverage Δ
flow 81.87% <93.63%> (-0.22%) ⬇️
unit 42.34% <2.72%> (-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.

@meiravgri meiravgri added this pull request to the merge queue Nov 24, 2025
Merged via the queue into 2.8 with commit 9d6fb4c Nov 24, 2025
13 checks passed
@meiravgri meiravgri deleted the backport-7472-to-2.8 branch November 24, 2025 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants