MOD-13252 Support multiple warnings in reply#7892
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7892 +/- ##
==========================================
- Coverage 84.25% 84.19% -0.06%
==========================================
Files 361 361
Lines 56295 56301 +6
Branches 15720 15720
==========================================
- Hits 47429 47403 -26
- Misses 8650 8682 +32
Partials 216 216
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/coord/rpnet.c
Outdated
| if (!strcmp(warning_str, QueryError_Strerror(QUERY_ERROR_CODE_TIMED_OUT))) { | ||
| timed_out = true; | ||
| } else if (!strcmp(warning_str, QUERY_WMAXPREFIXEXPANSIONS)) { | ||
| } |
There was a problem hiding this comment.
The else - if from before is still correct though
Maybe it's even better.
But I think a refactor for this code might be the better approach (smarter string compare)
| n_warnings += 1 | ||
| env.assertEqual(n_warnings, 1) | ||
|
|
||
| def test_multiple_warnings(): |
There was a problem hiding this comment.
Can't we test the profile also here?
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 8.2
git worktree add -d .worktree/backport-7892-to-8.2 origin/8.2
cd .worktree/backport-7892-to-8.2
git switch --create backport-7892-to-8.2
git cherry-pick -x 0b7aee51b64c6ebe760c69a81ecd5e7ab08245c6 |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 8.4
git worktree add -d .worktree/backport-7892-to-8.4 origin/8.4
cd .worktree/backport-7892-to-8.4
git switch --create backport-7892-to-8.4
git cherry-pick -x 0b7aee51b64c6ebe760c69a81ecd5e7ab08245c6 |
* take code from meiravg_persist_warnings_in_areq * take tests * fix test * review fixes * move test (cherry picked from commit 0b7aee5)
* take code from meiravg_persist_warnings_in_areq * take tests * fix test * review fixes * move test (cherry picked from commit 0b7aee5)
* bit map place holder * save profilectx in AREQ introduce ProfileWarnings * return all warnings in coord reply return all warnings in sendchunk resp3 return all warnings as an array in profil;e * align tests to the new format add testProfileMultipleWarnings and testPersistProfileWarning_MaxPrefixExpansions and test_multiple_warnings * more fixes * test fixes * revert multiple warnings code relted changes * fixes * remove tests relarted to #7892 * imp testPersistProfileWarning_MaxPrefixExpansions * remove temporary test * fix mising BG indexing OOM * fix test * move to header * add oom test * asserts * detect timeout when there are multiple warnings in netCursorCallback * fix assert * enhance test_multiple_warnings to test we have exactly 1 cursor read * fix assert * test with oom (remove in the next commit) * fix test - only test with timeout * comment on ProfileWarningType * fix test * remove unused
* bit map place holder * save profilectx in AREQ introduce ProfileWarnings * return all warnings in coord reply return all warnings in sendchunk resp3 return all warnings as an array in profil;e * align tests to the new format add testProfileMultipleWarnings and testPersistProfileWarning_MaxPrefixExpansions and test_multiple_warnings * more fixes * test fixes * revert multiple warnings code relted changes * fixes * remove tests relarted to #7892 * imp testPersistProfileWarning_MaxPrefixExpansions * remove temporary test * fix mising BG indexing OOM * fix test * move to header * add oom test * asserts * detect timeout when there are multiple warnings in netCursorCallback * fix assert * enhance test_multiple_warnings to test we have exactly 1 cursor read * fix assert * test with oom (remove in the next commit) * fix test - only test with timeout * comment on ProfileWarningType * fix test * remove unused (cherry picked from commit 2f47432)
* bit map place holder * save profilectx in AREQ introduce ProfileWarnings * return all warnings in coord reply return all warnings in sendchunk resp3 return all warnings as an array in profil;e * align tests to the new format add testProfileMultipleWarnings and testPersistProfileWarning_MaxPrefixExpansions and test_multiple_warnings * more fixes * test fixes * revert multiple warnings code relted changes * fixes * remove tests relarted to #7892 * imp testPersistProfileWarning_MaxPrefixExpansions * remove temporary test * fix mising BG indexing OOM * fix test * move to header * add oom test * asserts * detect timeout when there are multiple warnings in netCursorCallback * fix assert * enhance test_multiple_warnings to test we have exactly 1 cursor read * fix assert * test with oom (remove in the next commit) * fix test - only test with timeout * comment on ProfileWarningType * fix test * remove unused (cherry picked from commit 2f47432)
* MOD-12984 Persist query warnings across cursor reads (#7865) * bit map place holder * save profilectx in AREQ introduce ProfileWarnings * return all warnings in coord reply return all warnings in sendchunk resp3 return all warnings as an array in profil;e * align tests to the new format add testProfileMultipleWarnings and testPersistProfileWarning_MaxPrefixExpansions and test_multiple_warnings * more fixes * test fixes * revert multiple warnings code relted changes * fixes * remove tests relarted to #7892 * imp testPersistProfileWarning_MaxPrefixExpansions * remove temporary test * fix mising BG indexing OOM * fix test * move to header * add oom test * asserts * detect timeout when there are multiple warnings in netCursorCallback * fix assert * enhance test_multiple_warnings to test we have exactly 1 cursor read * fix assert * test with oom (remove in the next commit) * fix test - only test with timeout * comment on ProfileWarningType * fix test * remove unused (cherry picked from commit 2f47432) * fix includes and
* MOD-12984 Persist query warnings across cursor reads (#7865) * bit map place holder * save profilectx in AREQ introduce ProfileWarnings * return all warnings in coord reply return all warnings in sendchunk resp3 return all warnings as an array in profil;e * align tests to the new format add testProfileMultipleWarnings and testPersistProfileWarning_MaxPrefixExpansions and test_multiple_warnings * more fixes * test fixes * revert multiple warnings code relted changes * fixes * remove tests relarted to #7892 * imp testPersistProfileWarning_MaxPrefixExpansions * remove temporary test * fix mising BG indexing OOM * fix test * move to header * add oom test * asserts * detect timeout when there are multiple warnings in netCursorCallback * fix assert * enhance test_multiple_warnings to test we have exactly 1 cursor read * fix assert * test with oom (remove in the next commit) * fix test - only test with timeout * comment on ProfileWarningType * fix test * remove unused (cherry picked from commit 2f47432) * push last
* bit map place holder * save profilectx in AREQ introduce ProfileWarnings * return all warnings in coord reply return all warnings in sendchunk resp3 return all warnings as an array in profil;e * align tests to the new format add testProfileMultipleWarnings and testPersistProfileWarning_MaxPrefixExpansions and test_multiple_warnings * more fixes * test fixes * revert multiple warnings code relted changes * fixes * remove tests relarted to #7892 * imp testPersistProfileWarning_MaxPrefixExpansions * remove temporary test * fix mising BG indexing OOM * fix test * move to header * add asm warning in Profile * add oom test * asserts * detect timeout when there are multiple warnings in netCursorCallback * fix assert * enhance test_multiple_warnings to test we have exactly 1 cursor read * fix assert * test with oom (remove in the next commit) * fix test - only test with timeout * comment on ProfileWarningType * fix test * remove unused * add test * fix crash * change test show crash * add test * final fix * fix as per comments * fix adding profile cursor * fix comments from cursor * revert changes related to crash * handle comment from cursor * small refactor --------- Co-authored-by: meiravgri <[email protected]>
Problem
Currently, if a query triggers more than one warning (e.g., both timeout and max prefix expansions reached), only one warning is exposed to the client while the rest are silently dropped.
Solution
Modified warning handling to collect and return all relevant warnings from query execution.
Format Changes
FT.PROFILE (⚠️ breaking change)
Per-shard warning field changes from string to array of strings:
Location:
res['Profile']['Shards'][i]['Warning']"Timeout limit was reached"["Timeout limit was reached", "Max prefix expansions limit was reached"]FT.SEARCH / FT.AGGREGATE (RESP3)
res['Results']['warning']was already an array but only ever contained one warning. Now it can contain multiple:["Timeout limit was reached"]["Timeout limit was reached", "Max prefix expansions limit was reached"]Coordinator warnings (cluster mode, RESP3)
The warnings field remains an array, but we now aggregate warnings from all shards instead of just one.
Note
Introduces multi-warning support and unifies warning formatting.
_replyWarningsand ensures Resultswarningaccumulates multiple entriesrpnet.c) iterates all warning strings from shards, setting timeout/max-prefix/OOM/indexing-failure/ASM flags; handles empty replies and returns timed out when presentWarningfrom string to array for shards and coordinator; prints multiple warnings or['None']get_shards_profilehelper incommon.pyand adjusts RESP2 expectations where profile packs warnings in arraysWritten by Cursor Bugbot for commit c996a3c. This will update automatically on new commits. Configure here.