-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix ingest pipeline cannot be executed when retry the failed index requests for update_by_query and reindex #18003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ingest pipeline cannot be executed when retry the failed index requests for update_by_query and reindex #18003
Conversation
…quests for update_by_query API and reindex API Signed-off-by: Binlong Gao <[email protected]>
Signed-off-by: Binlong Gao <[email protected]>
❌ Gradle check result for 949410a: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❕ Gradle check result for 38f6bb5: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #18003 +/- ##
============================================
+ Coverage 72.47% 72.61% +0.14%
- Complexity 67034 67165 +131
============================================
Files 5478 5478
Lines 310132 310168 +36
Branches 45087 45091 +4
============================================
+ Hits 224775 225238 +463
+ Misses 66960 66516 -444
- Partials 18397 18414 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good with few minor comments
server/src/main/java/org/opensearch/action/bulk/BulkItemResponse.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/action/bulk/BulkItemResponse.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/action/bulk/BulkItemResponse.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you
Signed-off-by: Binlong Gao <[email protected]>
Signed-off-by: Binlong Gao <[email protected]>
❌ Gradle check result for 7fa102c: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Binlong Gao <[email protected]>
❌ Gradle check result for 0e4401a: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 0e4401a: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
@andrross can you also take a look here? |
…quests for update_by_query and reindex (#18003) * Fix ingest pipeline cannot be executed when retry the failed index requests for update_by_query API and reindex API Signed-off-by: Binlong Gao <[email protected]> * Modify changelog Signed-off-by: Binlong Gao <[email protected]> * Optimize some code Signed-off-by: Binlong Gao <[email protected]> * Fix precommit failure Signed-off-by: Binlong Gao <[email protected]> --------- Signed-off-by: Binlong Gao <[email protected]> (cherry picked from commit 9a3fc30) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…quests for update_by_query and reindex (#18003) (#18074) * Fix ingest pipeline cannot be executed when retry the failed index requests for update_by_query API and reindex API * Modify changelog * Optimize some code * Fix precommit failure --------- (cherry picked from commit 9a3fc30) Signed-off-by: Binlong Gao <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
This PR fixes the bug that ingest pipeline cannot be executed again when retrying the failed index requests for update_by_query and reindex, update_by_query and reindex are kind of
AbstractAsyncBulkByScrollAction
, they have retry logic when the index requests failed with 429 status code, but when build a new bulk request for retry, it doesn't honor the global pipeline specified the api request and theisPipelineResolved
field was set to true in all of the failed indexRequests, so the pipeline won't be executed again when retrying the bulk request.In addition, we need to find a way to mark the failure step if the BulkItemResponse, only if the ingest pipeline failed with 429 status code, then the
isPipelineResolved
field need to be reset, so I add asource
field to theFailure
class to mark which step has failure during the bulk processing, for other cases like the index has aread_only_allow_delete
block which is also retryable, we shouldn't reset theisPipelineResolved
field.Some unit test are added for the code change, but failed to add some yaml tests or IT because pipeline execution failure with 429 status code is not easy to mock.
Related Issues
Resolves #14337.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.