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

Increment version on system index settings change #84994

Merged
merged 1 commit into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public ClusterState execute(ClusterState currentState) throws Exception {
boolean isHidden = indexMetadata.getSettings().getAsBoolean(IndexMetadata.SETTING_INDEX_HIDDEN, false);
if (isSystem && isHidden == false) {
builder.settings(Settings.builder().put(indexMetadata.getSettings()).put(IndexMetadata.SETTING_INDEX_HIDDEN, true));
builder.settingsVersion(builder.settingsVersion() + 1);
updated = true;
}
if (isSystem && indexMetadata.getAliases().values().stream().anyMatch(a -> Boolean.FALSE.equals(a.isHidden()))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -784,9 +784,9 @@ public synchronized void updateMetadata(final IndexMetadata currentIndexMetadata
final long currentSettingsVersion = currentIndexMetadata.getSettingsVersion();
final long newSettingsVersion = newIndexMetadata.getSettingsVersion();
if (currentSettingsVersion == newSettingsVersion) {
assert updateIndexSettings == false;
assert updateIndexSettings == false : "No index updates are expected as index settings version has not changed";
} else {
assert updateIndexSettings;
assert updateIndexSettings : "Index updates are expected as index settings version has changed";
assert currentSettingsVersion < newSettingsVersion
: "expected current settings version ["
+ currentSettingsVersion
Expand Down