-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Add index and reindex request settings to speed up reindex #119780
base: main
Are you sure you want to change the base?
Add index and reindex request settings to speed up reindex #119780
Conversation
Pinging @elastic/es-data-management (Team:Data Management) |
Hi @parkertimmins, I've created a changelog YAML for you. |
- if source index was read-only, setting update needs to happen before test is made read only - default test was failing due to a template causing number_of_replica to not come from setting default
// random_index_template sets value for number_of_replicas, remove template so default value is used instead | ||
assertAcked( | ||
indicesAdmin().execute(TransportDeleteIndexTemplateAction.TYPE, new DeleteIndexTemplateRequest("random_index_template")) | ||
); |
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 is a bit hacky, but not sure of a better way to force number_of_replicas
to use the default value.
builder.copy(setting, settingsBefore); | ||
} else { | ||
// otherwise, delete from dest index so that it loads from the settings default | ||
builder.putNull(setting); |
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.
Alternatively, we could get the current setting value using one of the methods that falls back to the default, then set this value on the dest index. But I prefer the current version as it avoids adding a settings explicitly to the dest index which had been unset (and using the default) on the source index.
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.
We talked offline about maybe using a higher-priority template rather than deleting random_index_template
, but I think either one gives the same result (and either one requires that you know that randomly sometimes a random_index_template
changes your default replicas.
Just a couple optimizations to speed up the reindexing of a single data stream index: