Skip to content

MOD-9174: Fix pipeline issues#5837

Merged
raz-mon merged 10 commits intomasterfrom
razmon-MOD9174
Apr 1, 2025
Merged

MOD-9174: Fix pipeline issues#5837
raz-mon merged 10 commits intomasterfrom
razmon-MOD9174

Conversation

@raz-mon
Copy link
Collaborator

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

Pipeline fixes

SafeLoader last result-status

The SafeLoader's last result-status mechanism was such that an RS_RESULT_OK status could have been returned even though a result was not populated.
This PR fixes that mechanism to continue to poll the upstream in that case, instead.

Empty result not serialized

We do not serialize empty results from the shard pipeline, as such results are not expected by the coordinator which will in turn return an error. We instead crash in development, or warn the user that an empty result has been received for serialization via a log, and skip the serialization of that result in production.

The coordinator is prepared to get a result that does not have an id in the FT.SEARCH pipeline, in which case it will gracefully return an error instead of crashing.

Assertions added

This PR adds assertions to some critical places in our code:

Healthy result id from shard

The result id exists and is not NULL in the coordinator response parsing logic.

SafeLoader last result-status

The safe-loader CANNOT return RS_RESULT_OK upon returning the last result status, since the result it returns is not populated.

@raz-mon raz-mon requested review from GuyAv46 and kei-nan March 31, 2025 10:47
@codecov
Copy link

codecov bot commented Mar 31, 2025

Codecov Report

Attention: Patch coverage is 40.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 87.01%. Comparing base (061323f) to head (20325d5).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/result_processor.c 25.00% 6 Missing ⚠️
src/aggregate/aggregate_exec.c 60.00% 2 Missing ⚠️
src/module.c 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5837      +/-   ##
==========================================
- Coverage   87.06%   87.01%   -0.05%     
==========================================
  Files         211      211              
  Lines       37778    37788      +10     
  Branches     1229     1229              
==========================================
- Hits        32890    32883       -7     
- Misses       4883     4900      +17     
  Partials        5        5              

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

GuyAv46
GuyAv46 previously approved these changes Mar 31, 2025
@raz-mon raz-mon enabled auto-merge March 31, 2025 12:53
@raz-mon raz-mon added this pull request to the merge queue Mar 31, 2025
@raz-mon raz-mon removed this pull request from the merge queue due to a manual request Mar 31, 2025
@raz-mon raz-mon added this pull request to the merge queue Mar 31, 2025
Copy link
Collaborator

@kei-nan kei-nan left a comment

Choose a reason for hiding this comment

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

In this PR a new Next call was added which creates a very unlikely call circle:
rpSafeLoader_ResetAndReturnLastCode -> rpSafeLoaderNext_Accumulate -> rpSafeLoaderNext_Yield -> rpSafeLoader_ResetAndReturnLastCode

We reviewed the flow and it seems unlikely to happen since when setting next to yield we know we have at least one result.

Approving after reviewing the flow.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 31, 2025
@raz-mon raz-mon added this pull request to the merge queue Apr 1, 2025
@raz-mon raz-mon removed this pull request from the merge queue due to a manual request Apr 1, 2025
@raz-mon raz-mon added this pull request to the merge queue Apr 1, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 1, 2025
@raz-mon raz-mon enabled auto-merge April 1, 2025 12:18
@raz-mon raz-mon added this pull request to the merge queue Apr 1, 2025
Merged via the queue into master with commit 7587c22 Apr 1, 2025
9 of 10 checks passed
@raz-mon raz-mon deleted the razmon-MOD9174 branch April 1, 2025 15:05
@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-5837-to-2.8 origin/2.8
cd .worktree/backport-5837-to-2.8
git switch --create backport-5837-to-2.8
git cherry-pick -x 7587c226ed6c27691cd9a0437a7abec3dc18c255

@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-5837-to-2.10 origin/2.10
cd .worktree/backport-5837-to-2.10
git switch --create backport-5837-to-2.10
git cherry-pick -x 7587c226ed6c27691cd9a0437a7abec3dc18c255

@redisearch-backport-pull-request
Copy link
Contributor

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

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

git fetch origin 8.0
git worktree add -d .worktree/backport-5837-to-8.0 origin/8.0
cd .worktree/backport-5837-to-8.0
git switch --create backport-5837-to-8.0
git cherry-pick -x 7587c226ed6c27691cd9a0437a7abec3dc18c255

raz-mon added a commit that referenced this pull request Apr 2, 2025
* Fix pager query resultLimit setting to initialization time

* Change fix to call Next in safeLoader again

* Enhance comment

* wip

* Fix safe-loader to not deplete the pipeline on first call

* Fix test

* Address review

* Remove all of resultLimit in Pager

* Revert "Remove all of resultLimit in Pager"

This reverts commit 142aca0.
github-merge-queue bot pushed a commit that referenced this pull request Apr 2, 2025
raz-mon added a commit that referenced this pull request Apr 3, 2025
* Fix pager query resultLimit setting to initialization time

* Change fix to call Next in safeLoader again

* Enhance comment

* wip

* Fix safe-loader to not deplete the pipeline on first call

* Fix test

* Address review

* Remove all of resultLimit in Pager

* Revert "Remove all of resultLimit in Pager"

This reverts commit 142aca0.
github-merge-queue bot pushed a commit that referenced this pull request Apr 3, 2025
* MOD-9174: Fix pipeline issues (#5837)

* Fix pager query resultLimit setting to initialization time

* Change fix to call Next in safeLoader again

* Enhance comment

* wip

* Fix safe-loader to not deplete the pipeline on first call

* Fix test

* Address review

* Remove all of resultLimit in Pager

* Revert "Remove all of resultLimit in Pager"

This reverts commit 142aca0.

* Fix test config params to 2.8 multi-threading
github-merge-queue bot pushed a commit that referenced this pull request Apr 20, 2025
MOD-9174: Fix pipeline issues (#5837)

* Fix pager query resultLimit setting to initialization time

* Change fix to call Next in safeLoader again

* Enhance comment

* wip

* Fix safe-loader to not deplete the pipeline on first call

* Fix test

* Address review

* Remove all of resultLimit in Pager

* Revert "Remove all of resultLimit in Pager"

This reverts commit 142aca0.
JoanFM pushed a commit that referenced this pull request May 27, 2025
* Fix pager query resultLimit setting to initialization time

* Change fix to call Next in safeLoader again

* Enhance comment

* wip

* Fix safe-loader to not deplete the pipeline on first call

* Fix test

* Address review

* Remove all of resultLimit in Pager

* Revert "Remove all of resultLimit in Pager"

This reverts commit 142aca0.
JoanFM pushed a commit that referenced this pull request May 27, 2025
* Fix pager query resultLimit setting to initialization time

* Change fix to call Next in safeLoader again

* Enhance comment

* wip

* Fix safe-loader to not deplete the pipeline on first call

* Fix test

* Address review

* Remove all of resultLimit in Pager

* Revert "Remove all of resultLimit in Pager"

This reverts commit 142aca0.
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.

3 participants