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

Mark index.merge.policy.max_merge_at_once_explicit not to be accepted in v10 #124807

Merged
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 @@ -166,6 +166,13 @@ public enum Property {
*/
IndexSettingDeprecatedInV8AndRemovedInV9,

/**
* Indicates that this index-level setting was deprecated in {@link Version#V_9_1_0} and is
* forbidden in indices created from V10 onwards.
* TODO Should be checked in {@link Setting#isDeprecatedAndRemoved}
*/
IndexSettingDeprecatedInV9AndRemovedInV10,

/**
* Indicates that this setting is accessible by non-operator users (public) in serverless
* Users will be allowed to set and see values of this setting.
Expand All @@ -188,7 +195,8 @@ public enum Property {
Property.Deprecated,
Property.DeprecatedWarning,
Property.IndexSettingDeprecatedInV7AndRemovedInV8,
Property.IndexSettingDeprecatedInV8AndRemovedInV9
Property.IndexSettingDeprecatedInV8AndRemovedInV9,
Property.IndexSettingDeprecatedInV9AndRemovedInV10
);

@SuppressWarnings("this-escape")
Expand Down Expand Up @@ -229,6 +237,7 @@ private Setting(
checkPropertyRequiresIndexScope(propertiesAsSet, Property.PrivateIndex);
checkPropertyRequiresIndexScope(propertiesAsSet, Property.IndexSettingDeprecatedInV7AndRemovedInV8);
checkPropertyRequiresIndexScope(propertiesAsSet, Property.IndexSettingDeprecatedInV8AndRemovedInV9);
checkPropertyRequiresIndexScope(propertiesAsSet, Property.IndexSettingDeprecatedInV9AndRemovedInV10);
checkPropertyRequiresNodeScope(propertiesAsSet);
this.properties = propertiesAsSet;
}
Expand Down Expand Up @@ -464,7 +473,8 @@ private boolean isDeprecated() {
return properties.contains(Property.Deprecated)
|| properties.contains(Property.DeprecatedWarning)
|| properties.contains(Property.IndexSettingDeprecatedInV7AndRemovedInV8)
|| properties.contains(Property.IndexSettingDeprecatedInV8AndRemovedInV9);
|| properties.contains(Property.IndexSettingDeprecatedInV8AndRemovedInV9)
|| properties.contains(Property.IndexSettingDeprecatedInV9AndRemovedInV10);
}

private boolean isDeprecatedWarningOnly() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ MergePolicy getMergePolicy(MergePolicyConfig config, boolean isTimeBasedIndex) {
"index.merge.policy.max_merge_at_once_explicit",
30,
2,
Property.Deprecated, // When removing in 9.0 follow the approach of IndexSettingDeprecatedInV7AndRemovedInV8
Property.IndexSettingDeprecatedInV9AndRemovedInV10,
Property.Dynamic,
Property.IndexScope
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,19 @@ public void testDeprecationPropertyValidation() {
IllegalArgumentException.class,
() -> Setting.boolSetting("a.bool.setting", true, Property.DeprecatedWarning, Property.IndexSettingDeprecatedInV8AndRemovedInV9)
);
expectThrows(
IllegalArgumentException.class,
() -> Setting.boolSetting("a.bool.setting", true, Property.Deprecated, Property.IndexSettingDeprecatedInV9AndRemovedInV10)
);
expectThrows(
IllegalArgumentException.class,
() -> Setting.boolSetting(
"a.bool.setting",
true,
Property.DeprecatedWarning,
Property.IndexSettingDeprecatedInV9AndRemovedInV10
)
);
}

public void testIntSettingBounds() {
Expand Down