Skip to content
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

Adds min rollover age as a transition condition #215

Merged
merged 2 commits into from
Dec 7, 2021

Conversation

dbbaughe
Copy link
Contributor

@dbbaughe dbbaughe commented Dec 7, 2021

Signed-off-by: Drew Baugher 46505179+dbbaughe@users.noreply.github.com

Issue #, if available:
#191

Description of changes:

Adds a new transition condition - min_rollover_age

This lets you transition to a new state based on when the index was rolled over instead of the index creation date to help with keeping data around for a specific amount of time.

As an index can be rolled over multiple times using different aliases (which is uncommon, i.e. I haven't actually seen that use case yet, so if you have this use case please comment on the PR) we will use the oldest rollover date that is available, i.e. the first one that happened. In the future if it seems like users want to specify which alias to use for this calculation we can introduce an index level setting to allow specifying the exact alias to use. I didn't include it for now in this PR as it seems like an unknown use case and we're starting to have a lot of settings introduced so want to limit them.

If the index evaluates this condition and the index was never rolled over, we will fail as this transition condition is only meant to be used after a rollover action has occured.

CheckList:

  • Commits are signed per the DCO using --signoff

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.

Signed-off-by: Drew Baugher <46505179+dbbaughe@users.noreply.github.com>
@codecov-commenter
Copy link

Codecov Report

Merging #215 (e3eb122) into main (1fe36be) will increase coverage by 0.40%.
The diff coverage is 77.77%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #215      +/-   ##
============================================
+ Coverage     75.73%   76.13%   +0.40%     
- Complexity     1927     1950      +23     
============================================
  Files           260      260              
  Lines         11094    11122      +28     
  Branches       1746     1753       +7     
============================================
+ Hits           8402     8468      +66     
+ Misses         1747     1697      -50     
- Partials        945      957      +12     
Impacted Files Coverage Δ
...temanagement/opensearchapi/OpenSearchExtensions.kt 80.23% <ø> (+0.96%) ⬆️
...ent/indexstatemanagement/util/ManagedIndexUtils.kt 78.38% <66.66%> (-0.93%) ⬇️
...anagement/indexstatemanagement/model/Transition.kt 67.60% <80.00%> (-0.09%) ⬇️
...anagement/step/transition/AttemptTransitionStep.kt 87.65% <80.00%> (+2.14%) ⬆️
...statemanagement/model/destination/CustomWebhook.kt 65.21% <0.00%> (-27.54%) ⬇️
.../opensearch/indexmanagement/rollup/model/Rollup.kt 84.43% <0.00%> (-0.48%) ⬇️
.../org/opensearch/indexmanagement/util/IndexUtils.kt 74.66% <0.00%> (ø)
...g/opensearch/indexmanagement/util/SecurityUtils.kt 20.00% <0.00%> (ø)
... and 254 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1fe36be...e3eb122. Read the comment docs.

Signed-off-by: Drew Baugher <46505179+dbbaughe@users.noreply.github.com>
@dbbaughe dbbaughe merged commit d718d7c into opensearch-project:main Dec 7, 2021
@dbbaughe dbbaughe deleted the minrollover branch December 7, 2021 22:16
downsrob pushed a commit to downsrob/index-management that referenced this pull request Mar 9, 2022
* Adds min rollover age as a transition condition

Signed-off-by: Drew Baugher <46505179+dbbaughe@users.noreply.github.com>

* Fixes link checker

Signed-off-by: Drew Baugher <46505179+dbbaughe@users.noreply.github.com>
downsrob pushed a commit to downsrob/index-management that referenced this pull request Mar 9, 2022
* Adds min rollover age as a transition condition

Signed-off-by: Drew Baugher <46505179+dbbaughe@users.noreply.github.com>

* Fixes link checker

Signed-off-by: Drew Baugher <46505179+dbbaughe@users.noreply.github.com>
Signed-off-by: Robert Downs <downsrob@amazon.com>
downsrob pushed a commit that referenced this pull request Mar 9, 2022
* Adds min rollover age as a transition condition

Signed-off-by: Drew Baugher <46505179+dbbaughe@users.noreply.github.com>

* Fixes link checker

Signed-off-by: Drew Baugher <46505179+dbbaughe@users.noreply.github.com>
Signed-off-by: Robert Downs <downsrob@amazon.com>
wuychn pushed a commit to ochprince/index-management that referenced this pull request Mar 16, 2023
* Adds min rollover age as a transition condition

Signed-off-by: Drew Baugher <46505179+dbbaughe@users.noreply.github.com>

* Fixes link checker

Signed-off-by: Drew Baugher <46505179+dbbaughe@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants