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

BWC for rollover skip, restricted index pattern #371

Merged
merged 2 commits into from
May 23, 2022

Conversation

bowenlan-amzn
Copy link
Member

@bowenlan-amzn bowenlan-amzn commented May 23, 2022

Signed-off-by: bowenlan-amzn [email protected]

Description of changes:

Though these 2 settings are released after OpenSearch, we backport them to AWS Elasticsearch code base, to keep the minimal code difference, we want to add the change for supporting setting BWC between Elasticsearch and OpenSearch code bases.

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.

@codecov-commenter
Copy link

codecov-commenter commented May 23, 2022

Codecov Report

Merging #371 (917dcc1) into main (e789214) will increase coverage by 0.49%.
The diff coverage is 94.44%.

@@             Coverage Diff              @@
##               main     #371      +/-   ##
============================================
+ Coverage     74.88%   75.38%   +0.49%     
- Complexity     2138     2159      +21     
============================================
  Files           262      263       +1     
  Lines         12461    12429      -32     
  Branches       1969     1975       +6     
============================================
+ Hits           9331     9369      +38     
+ Misses         2060     1974      -86     
- Partials       1070     1086      +16     
Impacted Files Coverage Δ
...atemanagement/step/shrink/AttemptMoveShardsStep.kt 60.42% <ø> (+4.87%) ⬆️
...temanagement/opensearchapi/OpenSearchExtensions.kt 66.66% <50.00%> (-0.43%) ⬇️
...pensearch/indexmanagement/IndexManagementPlugin.kt 89.06% <100.00%> (+0.08%) ⬆️
...t/settings/LegacyOpenDistroManagedIndexSettings.kt 98.56% <100.00%> (+0.13%) ⬆️
...exstatemanagement/settings/ManagedIndexSettings.kt 98.43% <100.00%> (ø)
...nt/indexstatemanagement/model/destination/Chime.kt 55.55% <0.00%> (-22.23%) ⬇️
...arch/indexmanagement/rollup/RollupSearchService.kt 57.40% <0.00%> (-3.71%) ⬇️
...exmanagement/opensearchapi/OpenSearchExtensions.kt 84.69% <0.00%> (-1.03%) ⬇️
...earch/indexmanagement/transform/model/Transform.kt 85.47% <0.00%> (-0.43%) ⬇️
...nt/indexstatemanagement/ManagedIndexCoordinator.kt 69.00% <0.00%> (-0.30%) ⬇️
... and 10 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 e789214...917dcc1. Read the comment docs.

Signed-off-by: bowenlan-amzn <[email protected]>
@bowenlan-amzn bowenlan-amzn marked this pull request as ready for review May 23, 2022 17:16
@bowenlan-amzn bowenlan-amzn requested a review from a team May 23, 2022 17:16
Comment on lines +58 to +60
if (this.settings.get(ManagedIndexSettings.ROLLOVER_SKIP.key).isNullOrBlank()) {
return this.settings.getAsBoolean(LegacyOpenDistroManagedIndexSettings.ROLLOVER_SKIP.key, false)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is unnecessary because the fallback setting for ManagedIndexSettings.ROLLOVER_SKIP is set to LegacyOpenDistroManagedIndexSettings.ROLLOVER_SKIP when initialized, so the open distro setting would be checked anyways

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on above getRolloverAlias, probably this is not working as that. Write like this should be safe.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I looked into it deeper and it seems that the fallback settings do not operate as I thought for index settings.

Comment on lines +203 to +209
val RESTRICTED_INDEX_PATTERN = Setting.simpleString(
"opendistro.index_state_management.restricted_index_pattern",
ManagedIndexSettings.DEFAULT_RESTRICTED_PATTERN,
Setting.Property.NodeScope,
Setting.Property.Dynamic,
Setting.Property.Deprecated
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this too Bowen

@bowenlan-amzn bowenlan-amzn merged commit 3f552f2 into opensearch-project:main May 23, 2022
@bowenlan-amzn bowenlan-amzn deleted the setting-bwc branch May 23, 2022 20:05
wuychn pushed a commit to ochprince/index-management that referenced this pull request Mar 16, 2023
* BWC for rollover skip, restricted index pattern

Signed-off-by: bowenlan-amzn <[email protected]>

* Remove VisibleForTesting

Signed-off-by: bowenlan-amzn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants