-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Allow copying source settings on resize operation #30255
Conversation
Today when an index is created from shrinking or splitting an existing index, the target index inherits almost none of the source index settings. This is surprising and a hassle for operators managing such indices. Given this is the default behavior, we can not simply change. Instead, we start by introducing the ability to copy settings. This flag can be set on the REST API or on the transport layer and it has the behavior that it copies all settings from the source except settings and settings on the request will override. This change is the first step in our adventure: - this flag is added here in 7.0.0 and immediately deprecated - this flag will be backported to 6.4.0 and remain deprecated - then, we will remove the ability to set this flag to false in 7.0.0 - finally, in 8.0.0 we will remove this flag and the only behavior will be for settings to be copied
Pinging @elastic/es-core-infra |
from the source index can be copied to the target index by adding the URL | ||
parameter `copy_settings=true` to the request. | ||
|
||
deprecated[7.0.0, `copy_settings` will default to `true` in 8.x and will be removed in 9.0.0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be adjusted after backporting.
from the source index can be copied to the target index by adding the URL | ||
parameter `copy_settings=true` to the request. | ||
|
||
deprecated[7.0.0, `copy_settings` will default to `true` in 8.x and will be removed in 9.0.0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be adjusted after backporting.
which will copy all index settings from the source except for non-copyable index | ||
settings. This parameter defaults to `false` in 7.x, is immediately deprecated | ||
in 7.0.0, will only be able to be set to `true` in 8.x, and will be removed in | ||
9.0.0. Note than when this parameter is used it means that all copyable settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be adjusted after backporting.
"Copy settings during shrink index": | ||
- skip: | ||
version: " - 6.99.99" | ||
reason: copy_settings did not exist prior to 7.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be adjusted after backporting.
"Copy settings during split index": | ||
- skip: | ||
version: " - 6.99.99" | ||
reason: copy_settings did not exist prior to 7.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be adjusted after backporting.
@@ -96,6 +98,11 @@ public void readFrom(StreamInput in) throws IOException { | |||
} else { | |||
type = ResizeType.SHRINK; // BWC this used to be shrink only | |||
} | |||
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be adjusted after backporting.
@@ -106,6 +113,9 @@ public void writeTo(StreamOutput out) throws IOException { | |||
if (out.getVersion().onOrAfter(ResizeAction.COMPATIBILITY_VERSION)) { | |||
out.writeEnum(type); | |||
} | |||
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be adjusted after backporting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - I assume its cleaner to copy only the settings that haven't been set on the request than to copy all the copyable settings before applying the settings from the request?
* origin/master: [test] add java packaging test project (elastic#30161) Fix macros in changelog (elastic#30269) [DOCS] Fixes syskeygen command name [ML] Include 3rd party C++ component notices (elastic#30132) _cluster/state Skip Test for pre-6.4, not pre-7.0 (elastic#30264) Improve docs for disk watermarks (elastic#30249) [DOCS] Removes redundant Active Directory realm settings (elastic#30190) [DOCS] Removes redundant LDAP realm settings (elastic#30193) _cluster/state should always return cluster_uuid (elastic#30143) HTML5ify Javadoc for core and test framework (elastic#30234) Minor tweaks to reroute documentation (elastic#30246)
This commit removes the `copy_settings` flag for shrink and split operations. The flag was introduced in elastic#30255 and the default value from now onwards is for the settings to be copied.
#30255 introduced the `copy_settings` parameter in 6.x. This commit adds support for setting it via `setCopySettings` in the HLRC and also adjusts docs.
Today when an index is created from shrinking or splitting an existing index, the target index inherits almost none of the source index settings. This is surprising and a hassle for operators managing such indices. Given this is the default behavior, we can not simply change it. Instead, we start by introducing the ability to copy settings. This flag can be set on the REST API or on the transport layer and it has the behavior that it copies all settings from the source except non-copyable settings (a property of a setting introduced in this change). Additionally, settings on the request will always override.
This change is the first step in our adventure:
Relates #28347