opensearch-project / index-management

🗃 Automate periodic data operations, such as deleting indices at a certain age or performing a rollover at a certain size
https://opensearch.org/docs/latest/im-plugin/index/
Apache License 2.0
52 stars 107 forks source link

Step Metadata Update on Index Rollover Timeout #1174

Closed harshitakaushik-dev closed 1 month ago

harshitakaushik-dev commented 1 month ago

Issue #1132 :

Issue Description:

This pull request addresses a bug in the Index Management plugin where the step metadata fields within IndexActionMetadata are not updated when a rollover action times out. Currently, only the info.message field is updated to indicate a timeout, which can be misleading if the previous run did not meet the rollover conditions.

Expected Behaviour:

Upon a timeout during the rollover action, the step.status and step.name fields within IndexActionMetadata should be updated to reflect the timeout event. This provides a clearer picture of the action's execution and avoids confusion regarding successful completion.

CheckList:

Proposed Changes:

Testing:

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.

sarthakaggarwal97 commented 1 month ago

thanks @harshitakaushik-dev for raising this!

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 66.29%. Comparing base (e5a13ff) to head (ce33ce5). Report is 4 commits behind head on main.

:exclamation: Current head ce33ce5 differs from pull request most recent head a8d7379

Please upload reports for the commit a8d7379 to get more accurate results.

Files Patch % Lines
...agement/indexstatemanagement/ManagedIndexRunner.kt 0.00% 6 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1174 +/- ## ============================================ - Coverage 75.34% 66.29% -9.05% + Complexity 2812 2406 -406 ============================================ Files 367 367 Lines 17038 17039 +1 Branches 2370 2372 +2 ============================================ - Hits 12837 11296 -1541 - Misses 2901 4596 +1695 + Partials 1300 1147 -153 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sarthakaggarwal97 commented 1 month ago

@bowenlan-amzn would you please do the final reviews so we can merge it. Thank you!

bowenlan-amzn commented 1 month ago

Thanks for the contribution! @harshitakaushik-dev

opensearch-trigger-bot[bot] commented 1 month ago

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

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/index-management/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/index-management/backport-2.x
# Create a new branch
git switch --create backport/backport-1174-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d4ee795e22f4490b78662f171f62d566a81c1abc
# Push it to GitHub
git push --set-upstream origin backport/backport-1174-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/index-management/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-1174-to-2.x.

bowenlan-amzn commented 1 month ago

@harshitakaushik-dev the backport failed, could you backport manually to 2.x