Skip to content

[8.4] [MOD-12416] Create basis for tracking Query Errors and track syntax and args errors#7422

Merged
lerman25 merged 2 commits into8.4from
backport-7386-to-8.4
Nov 25, 2025
Merged

[8.4] [MOD-12416] Create basis for tracking Query Errors and track syntax and args errors#7422
lerman25 merged 2 commits into8.4from
backport-7386-to-8.4

Conversation

@redisearch-backport-pull-request
Copy link
Contributor

@redisearch-backport-pull-request redisearch-backport-pull-request bot commented Nov 19, 2025

Description

Backport of #7386 to 8.4.


Note

Add global counters for query syntax/argument errors (shard vs coordinator), instrument error paths in search/aggregate/hybrid flows, and expose them in INFO MODULES with tests.

  • Global statistics:
    • Add QueryErrorsGlobalStats and QueryErrorsGlobalStats_UpdateError(...) with COORD_ERR_WARN/SHARD_ERR_WARN to track query errors by type (syntax, arguments) and origin (coordinator vs shard).
    • Extend TotalGlobalStats_GetQueryStats() to return new error counters.
  • Instrumentation (error paths):
    • Update error handling to bump counters in: aggregate/aggregate_exec.c (execCommandCommon), coord/dist_aggregate.c (DistAggregateCleanups), coord/hybrid/dist_hybrid.c (DistHybridCleanups), hybrid/hybrid_exec.c (CleanupAndReplyStatus), and module.c (bailOut).
  • INFO output:
    • In info_redis.c, add new metrics under warnings_and_errors and coordinator_warnings_and_errors: shard_total_query_errors_syntax/arguments and coord_total_query_errors_syntax/arguments.
  • Tests:
    • Add Python tests validating metrics behavior in standalone and cluster for FT.SEARCH, FT.AGGREGATE, and FT.HYBRID, including no-error queries not affecting counters.

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

…nd args errors (#7386)

* Query error metric with coord base

* remove coord - not used yet

* Count syntax and arg errors

* Revert "remove coord - not used yet"

This reverts commit 8cff9f0.

* Seperate into shard error and coord error

* tests

* Treat SA as shard

* Meirav fixups

(cherry picked from commit 4c31dc3)

* Add future test

* fix hybrid SA test

* Refractor previous dict check

(cherry picked from commit bf41b7f)
lerman25
lerman25 previously approved these changes Nov 19, 2025
@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.69%. Comparing base (94fe5ce) to head (d4db2e9).
⚠️ Report is 36 commits behind head on 8.4.

Additional details and impacted files
@@            Coverage Diff             @@
##              8.4    #7422      +/-   ##
==========================================
- Coverage   85.71%   85.69%   -0.03%     
==========================================
  Files         330      330              
  Lines       52324    52375      +51     
  Branches    12001    12001              
==========================================
+ Hits        44850    44881      +31     
- Misses       7306     7327      +21     
+ Partials      168      167       -1     
Flag Coverage Δ
flow 84.19% <100.00%> (-0.12%) ⬇️
unit 52.46% <0.00%> (-0.04%) ⬇️

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 Nov 20, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 20, 2025
@lerman25 lerman25 added this pull request to the merge queue Nov 20, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 20, 2025
@lerman25 lerman25 added this pull request to the merge queue Nov 23, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to Branch Protection failures Nov 23, 2025
You're not authorized to push to this branch. Visit "About protected branches" for more information.
@lerman25 lerman25 added this pull request to the merge queue Nov 25, 2025
Merged via the queue into 8.4 with commit 958b361 Nov 25, 2025
25 checks passed
@lerman25 lerman25 deleted the backport-7386-to-8.4 branch November 25, 2025 09:02
@lerman25
Copy link
Collaborator

/backport

@redisearch-backport-pull-request
Copy link
Contributor Author

Backport failed for 8.2, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 8.2
git worktree add -d .worktree/backport-7422-to-8.2 origin/8.2
cd .worktree/backport-7422-to-8.2
git switch --create backport-7422-to-8.2
git cherry-pick -x 958b361555597bd082924ec5f78734b14674e9aa

lerman25 added a commit that referenced this pull request Nov 30, 2025
…and args errors ([#7422](#7422))

* [MOD-12416] Create basis for tracking Query Errors and track syntax and args errors ([#7386](#7386))

* Query error metric with coord base

* remove coord - not used yet

* Count syntax and arg errors

* Revert "remove coord - not used yet"

This reverts commit 8cff9f0.

* Seperate into shard error and coord error

* tests

* Treat SA as shard

* Meirav fixups

(cherry picked from commit 4c31dc3)

* Add future test

* fix hybrid SA test

* Refractor previous dict check

(cherry picked from commit bf41b7f)

* Replace to c enum

---------

Co-authored-by: lerman25 <[email protected]>
Co-authored-by: lerman25 <[email protected]>
(cherry picked from commit 958b361)
lerman25 added a commit that referenced this pull request Nov 30, 2025
…and args errors ([[#7422](https://github.com/RediSearch/RediSearch/issues/7422)](https://github.com/RediSearch/RediSearch/issues/7422))

* [MOD-12416] Create basis for tracking Query Errors and track syntax and args errors ([[#7386](https://github.com/RediSearch/RediSearch/issues/7386)](https://github.com/RediSearch/RediSearch/issues/7386))

* Query error metric with coord base

* remove coord - not used yet

* Count syntax and arg errors

* Revert "remove coord - not used yet"

This reverts commit 8cff9f0.

* Seperate into shard error and coord error

* tests

* Treat SA as shard

* Meirav fixups

(cherry picked from commit 4c31dc3)

* Add future test

* fix hybrid SA test

* Refractor previous dict check

(cherry picked from commit bf41b7f)

* Replace to c enum

---------

Co-authored-by: lerman25 <[email protected]>
Co-authored-by: lerman25 <[email protected]>
(cherry picked from commit 958b361)
github-merge-queue bot pushed a commit that referenced this pull request Nov 30, 2025
…ntax … (#7577)

[MOD-12416] Create basis for tracking Query Errors and track syntax and args errors ([[#7422](https://github.com/RediSearch/RediSearch/issues/7422)](https://github.com/RediSearch/RediSearch/issues/7422))

* [MOD-12416] Create basis for tracking Query Errors and track syntax and args errors ([[#7386](https://github.com/RediSearch/RediSearch/issues/7386)](https://github.com/RediSearch/RediSearch/issues/7386))

* Query error metric with coord base

* remove coord - not used yet

* Count syntax and arg errors

* Revert "remove coord - not used yet"

This reverts commit 8cff9f0.

* Seperate into shard error and coord error

* tests

* Treat SA as shard

* Meirav fixups

(cherry picked from commit 4c31dc3)

* Add future test

* fix hybrid SA test

* Refractor previous dict check

(cherry picked from commit bf41b7f)

* Replace to c enum

---------



(cherry picked from commit 958b361)
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