-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[BUGFIX] Fix missing fields to resolve Strict Dynamic Mapping issue when saving task result #16201
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
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? |
|
❌ 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.xThen, 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]>
…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]>


Related Issues
Resolves #16060
Description
[The result of the execution]
StrictDynamicMappingExceptionoccurredCCR Plugin(cross-cluster-replication), the.tasksindex is properly updated withoutStrictDynamicMappingException.[Background]
auto followrule in the CCR Plugin, aStrictDynamicMappingExceptionwas previously encountered:TaskResultsService.storeResult(TaskResult taskResult, ActionListener<Void> listener)is called.TaskInfoobject from theTaskResultparameter.TaskInfodefines the necessary fields for a task, which are mapped to the.tasksindex viatask-index-mapping.json..tasksindex should be updated.tasksindex has strict dynamic mapping enabled.cancellation_time_millisandresource_statswere present inTaskInfobut missing from the mapping JSON.StrictDynamicMappingException.[PR contents]
cancellation_time_millisandresource_statsfields totask-index-mapping.json:versionin bothtask-index-mapping.jsonandTaskResultsServicefrom 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_statsandcancellation_time_millisin 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
assembleit, 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.shDocker Composeto create two clusters.auto followrule and then canceled it to verify the behavior. Set up a cross-cluster connection, get-started-with-auto-follow:StrictDynamicMappingExceptionoccurred. After modifying thetask-index-mapping.jsoncorrectly, 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.gzfile with the version that matches your system.If needed, I am happy to provide the
Docker imageused 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.