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

Allow copying source settings on resize operation #30255

Merged
merged 6 commits into from
May 1, 2018

Conversation

jasontedor
Copy link
Member

@jasontedor jasontedor commented Apr 30, 2018

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:

  • 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

Relates #28347

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
@elasticmachine
Copy link
Collaborator

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]
Copy link
Member Author

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]
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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)) {
Copy link
Member Author

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)) {
Copy link
Member Author

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 link
Contributor

@colings86 colings86 left a 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)
@jasontedor jasontedor merged commit 5053542 into elastic:master May 1, 2018
@jasontedor jasontedor deleted the resize-settings branch May 1, 2018 14:57
jkakavas added a commit to jkakavas/elasticsearch that referenced this pull request Feb 7, 2019
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.
@jimczi jimczi added v7.0.0-beta1 and removed v7.0.0 labels Feb 7, 2019
dliappis added a commit that referenced this pull request Mar 8, 2019
#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >enhancement v6.4.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants