-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[BUGFIX] Fix missing fields to resolve Strict Dynamic Mapping issue when saving task result #16201
Conversation
❌ Gradle check result for 839a1bc: 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 7946ad9: 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? |
5e60e37
to
5469e96
Compare
❌ Gradle check result for 5469e96: 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 f09fe85: 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? |
The local tests succeed, but they fail on “Gradle Check (Jenkins) / gradle-check (pull_request_target)” even though I haven’t modified them. |
Looks like two test failures:
|
❕ Gradle check result for 0b367cc: 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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #16201 +/- ##
============================================
+ Coverage 72.05% 72.13% +0.07%
- Complexity 64861 64885 +24
============================================
Files 5309 5309
Lines 302734 302785 +51
Branches 43733 43750 +17
============================================
+ Hits 218134 218404 +270
+ Misses 66731 66516 -215
+ Partials 17869 17865 -4 ☔ View full report in Codecov by Sentry. |
❌ Gradle check result for 797821f: 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? |
…tasks index (opensearch-project#16060) - Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled. - Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`. - Ensured proper task result storage by updating the mappings. - Changed the version in the meta field from 4 to 5 to reflect the updated mappings. Signed-off-by: inpink <[email protected]>
The Gradle check has been completed. 😄🎉 |
Signed-off-by: Daniel Widdis <[email protected]>
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-16201-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 322bdc42dab1d6d4fa021529057453afd5cb898e
# Push it to GitHub
git push --set-upstream origin backport/backport-16201-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x Then, create a pull request where the |
…tasks index (opensearch-project#16060) (opensearch-project#16201) - Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled. - Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`. - Ensured proper task result storage by updating the mappings. - Changed the version in the meta field from 4 to 5 to reflect the updated mappings. Signed-off-by: inpink <[email protected]> Signed-off-by: Daniel Widdis <[email protected]> Co-authored-by: Daniel Widdis <[email protected]>
…tasks index (#16060) (#16201) (#16414) - Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled. - Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`. - Ensured proper task result storage by updating the mappings. - Changed the version in the meta field from 4 to 5 to reflect the updated mappings. Signed-off-by: inpink <[email protected]> Signed-off-by: Daniel Widdis <[email protected]> Co-authored-by: inpink <[email protected]>
Related Issues
Resolves #16060
Description
[The result of the execution]
StrictDynamicMappingException
occurredCCR Plugin
(cross-cluster-replication), the.tasks
index is properly updated withoutStrictDynamicMappingException
.[Background]
auto follow
rule in the CCR Plugin, aStrictDynamicMappingException
was previously encountered:TaskResultsService.storeResult(TaskResult taskResult, ActionListener<Void> listener)
is called.TaskInfo
object from theTaskResult
parameter.TaskInfo
defines the necessary fields for a task, which are mapped to the.tasks
index viatask-index-mapping.json
..tasks
index should be updated.tasks
index has strict dynamic mapping enabled.cancellation_time_millis
andresource_stats
were present inTaskInfo
but missing from the mapping JSON.StrictDynamicMappingException
.[PR contents]
cancellation_time_millis
andresource_stats
fields totask-index-mapping.json
:version
in bothtask-index-mapping.json
andTaskResultsService
from 4 to 5.These versions must match for the mapping to apply correctly. When updating a mapping, increment the version so future operations can detect and apply changes.
[Test]
I conducted two types of tests:
Writing a test in OpenSearch
TaskInfo has two constructors: one that includes
cancellation_time_millis
(a) and one that does not (b).In the existing
TasksIT
, theresultsService.storeResult()
test did not include the appropriateresource_stats
andcancellation_time_millis
in theTaskInfo
.So, I added
testStoreResultWithAllFields
, using constructor (b) to create a test that only passes with the updatedtask-index-mapping.json
.Local End-to-End (e2e) Testing
assemble
it, generating theopensearch-min-3.0.0-SNAPSHOT-linux-arm64.tar.gz file
.Dockerfile
, I built aDocker image
. In the same directory as the Dockerfile, I included the following files:opensearch-min-3.0.0-SNAPSHOT-linux-arm64.tar.gz
,opensearch-cross-cluster-replication-3.0.0.0-SNAPSHOT.zip
,opensearch.yml
,opensearch-docker-entrypoint.sh
,opensearch-onetime-setup.sh
Docker Compose
to create two clusters.auto follow
rule and then canceled it to verify the behavior. Set up a cross-cluster connection, get-started-with-auto-follow:StrictDynamicMappingException
occurred. After modifying thetask-index-mapping.json
correctly, I observed that instead of the previousStrictDynamicMappingException
, the task status was successfully updated.Below are the files I used for testing, along with their sources:
My test environment was
Mac OS M2
. If you are using a different operating system, replace the.tar.gz
file with the version that matches your system.If needed, I am happy to provide the
Docker image
used in my test. Please feel free to request it if required.Check List
API changes companion pull request created, if applicable.Public documentation issue/PR created, if applicable.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.