Skip to content

MOD-9054: Fix total_results field in shard RESP3 response#5765

Merged
oshadmi merged 8 commits intomasterfrom
razmon-shard_response
Mar 19, 2025
Merged

MOD-9054: Fix total_results field in shard RESP3 response#5765
oshadmi merged 8 commits intomasterfrom
razmon-shard_response

Conversation

@raz-mon
Copy link
Collaborator

@raz-mon raz-mon commented Mar 16, 2025

Changes introduced in this PR:

  • Removes a redundant check from the RESP2 + RESP3 response paths.
  • Fixes the total_results field in the RESP3 response to be CORRECT, always.

Note: This fix should not be breaking, since it changes the response order of the MAP we use in RESP3, in which the order plays no role.
For that reason exactly (breakage), we do not fix this for RESP2.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses MOD-9054 by fixing the total_results field in the RESP3 response and removing a redundant check. The key changes include:

  • Removal of an unnecessary check from the shard RESP3 response.
  • Introduction of a new test to ensure that the total_results field in the FT.AGGREGATE command is accurate.

@raz-mon raz-mon requested review from Copilot and meiravgri March 16, 2025 09:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses MOD-9054 by fixing the total_results field in the shard RESP3 response and removing a redundant check in RESP2/RESP3 response paths to ensure accurate result counts.

  • Introduces a new test (test_totalResults_aggregate) that verifies the correct total_results when using the RESP3 protocol
  • Updates the test suite in tests/pytests/test_resp3.py to cover the fixed behavior

meiravgri
meiravgri previously approved these changes Mar 17, 2025
@raz-mon raz-mon requested a review from meiravgri March 17, 2025 15:16
@codecov
Copy link

codecov bot commented Mar 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.11%. Comparing base (d218d67) to head (afd1369).
Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5765   +/-   ##
=======================================
  Coverage   88.11%   88.11%           
=======================================
  Files         200      200           
  Lines       36067    36063    -4     
=======================================
- Hits        31779    31777    -2     
+ Misses       4288     4286    -2     

☔ 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.

@oshadmi oshadmi added this pull request to the merge queue Mar 19, 2025
Merged via the queue into master with commit 19504b6 Mar 19, 2025
10 checks passed
@oshadmi oshadmi deleted the razmon-shard_response branch March 19, 2025 11:52
@redisearch-backport-pull-request
Copy link
Contributor

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

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

git fetch origin 2.8
git worktree add -d .worktree/backport-5765-to-2.8 origin/2.8
cd .worktree/backport-5765-to-2.8
git switch --create backport-5765-to-2.8
git cherry-pick -x 19504b6e4211d7722e6e6a08a7d85a54fe751323

@redisearch-backport-pull-request
Copy link
Contributor

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

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

git fetch origin 2.10
git worktree add -d .worktree/backport-5765-to-2.10 origin/2.10
cd .worktree/backport-5765-to-2.10
git switch --create backport-5765-to-2.10
git cherry-pick -x 19504b6e4211d7722e6e6a08a7d85a54fe751323

@redisearch-backport-pull-request
Copy link
Contributor

Successfully created backport PR for 8.0:

redisearch-backport-pull-request bot pushed a commit that referenced this pull request Mar 19, 2025
* Remove redundant condition

* Return correct number of results in FT.AGGREGATE + RESP3

* Remove redundant condition in RESP2 response path

* Add test

* Add cursor test

* Fix spelling error

* Fix test

(cherry picked from commit 19504b6)
raz-mon added a commit that referenced this pull request Mar 20, 2025
* Remove redundant condition

* Return correct number of results in FT.AGGREGATE + RESP3

* Remove redundant condition in RESP2 response path

* Add test

* Add cursor test

* Fix spelling error

* Fix test
raz-mon added a commit that referenced this pull request Mar 20, 2025
* Remove redundant condition

* Return correct number of results in FT.AGGREGATE + RESP3

* Remove redundant condition in RESP2 response path

* Add test

* Add cursor test

* Fix spelling error

* Fix test
github-merge-queue bot pushed a commit that referenced this pull request Mar 20, 2025
…5765) (#5804)

MOD-9054: Fix `total_results` field in shard RESP3 response (#5765)

* Remove redundant condition

* Return correct number of results in FT.AGGREGATE + RESP3

* Remove redundant condition in RESP2 response path

* Add test

* Add cursor test

* Fix spelling error

* Fix test
github-merge-queue bot pushed a commit that referenced this pull request Mar 20, 2025
)

MOD-9054: Fix `total_results` field in shard RESP3 response (#5765)

* Remove redundant condition

* Return correct number of results in FT.AGGREGATE + RESP3

* Remove redundant condition in RESP2 response path

* Add test

* Add cursor test

* Fix spelling error

* Fix test
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.

4 participants