-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Initial work on ReindexDatastreamIndexAction #116996
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
Initial work on ReindexDatastreamIndexAction #116996
Conversation
Add an action which reindexes a single data stream index. Most of the work involves settings the correct settings before and after the reindexing. Eventually, this action will handle reindexing searchable snapshot indices, but this is left out for now.
...rc/main/java/org/elasticsearch/datastreams/action/TransportReindexDataStreamIndexAction.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/elasticsearch/datastreams/action/TransportReindexDataStreamIndexAction.java
Outdated
Show resolved
Hide resolved
Pinging @elastic/es-data-management (Team:Data Management) |
Hi @parkertimmins, I've created a changelog YAML for you. |
Seems fine for an initial pass, once you put the action in OperatorPrivilegesIT. Nothing will actually use this yet, so it's just a placeholder. |
server/src/main/java/org/elasticsearch/action/datastreams/ReindexDataStreamIndexAction.java
Outdated
Show resolved
Hide resolved
.addListener(listener); | ||
} | ||
|
||
private void setBlockWrites(String sourceIndexName, ActionListener<AcknowledgedResponse> listener) { |
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.
Should we remove the write block on the source index after reindexing? I'm inclined to say it's fine to leave it, but if we failed/cancelled an instance of this call then reran it, the block-writes setting would then be found on the source index and copied to the new dest 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 discussed adding a flag to the cluster state which says whether an index had block-write before the call to this action. This would then be passed as a param into the action.
.../main/java/org/elasticsearch/xpack/migrate/action/ReindexDataStreamIndexTransportAction.java
Outdated
Show resolved
Hide resolved
.../main/java/org/elasticsearch/xpack/migrate/action/ReindexDataStreamIndexTransportAction.java
Outdated
Show resolved
Hide resolved
.../main/java/org/elasticsearch/xpack/migrate/action/ReindexDataStreamIndexTransportAction.java
Outdated
Show resolved
Hide resolved
...grate/src/main/java/org/elasticsearch/xpack/migrate/action/ReindexDataStreamIndexAction.java
Outdated
Show resolved
Hide resolved
assertEquals(endTime, destEnd); | ||
} | ||
|
||
// TODO more logsdb/tsdb specific tests |
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.
There was no logsdb/tsdb in 7.x was there? So nothing to upgrade?
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.
Oh sweet. Well, then I can remove some tests
💔 Backport failed
You can use sqren/backport to manually backport by running |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
Add an action to reindex a single index from a source index to a destination index. Unlike the reindex action, this action copies settings and mappings from the source index to the dest index before performing the reindex. This action is part of work to reindex data streams and will be called on each of the backing indices within a data stream. (cherry picked from commit 0a6ce27)
Add an action to reindex a single index from a source index to a destination index. Unlike the reindex action, this action copies settings and mappings from the source index to the dest index before performing the reindex. This action is part of work to reindex data streams and will be called on each of the backing indices within a data stream. (cherry picked from commit 0a6ce27)
Add an action to reindex a single index from a source index to a destination index. Unlike the reindex action, this action copies settings and mappings from the source index to the dest index before performing the reindex. This action is part of work to reindex data streams and will be called on each of the backing indices within a data stream. (cherry picked from commit 0a6ce27)
When creating a destination index, filter any deprecated settings before copying the source settings to the dest index. Specifically, filter out settings with the property IndexSettingDeprecatedInV7AndRemovedInV8 or settings from a specific list which do not have this property but have no effect in v8. This also includes a change which reverts the changes that #116996 made to MetadataCreateIndexService. That change factored the method copySettingsFromSource out of prepareResizeIndexSettings so it could be used to filter settings in CreateIndexFromSourceAction. The additional filtering of deprecated property caused the requirements in CreateIndexFromSourceAction and MetadataCreateIndexService to diverge. So this change reverts the original refactor to MetadataCreateIndexService and adds a method similar to copySettingsFromSource to CreateIndexFromSourceAction.
…0163) When creating a destination index, filter any deprecated settings before copying the source settings to the dest index. Specifically, filter out settings with the property IndexSettingDeprecatedInV7AndRemovedInV8 or settings from a specific list which do not have this property but have no effect in v8. This also includes a change which reverts the changes that elastic#116996 made to MetadataCreateIndexService. That change factored the method copySettingsFromSource out of prepareResizeIndexSettings so it could be used to filter settings in CreateIndexFromSourceAction. The additional filtering of deprecated property caused the requirements in CreateIndexFromSourceAction and MetadataCreateIndexService to diverge. So this change reverts the original refactor to MetadataCreateIndexService and adds a method similar to copySettingsFromSource to CreateIndexFromSourceAction.
…120319) When creating a destination index, filter any deprecated settings before copying the source settings to the dest index. Specifically, filter out settings with the property IndexSettingDeprecatedInV7AndRemovedInV8 or settings from a specific list which do not have this property but have no effect in v8. This also includes a change which reverts the changes that #116996 made to MetadataCreateIndexService. That change factored the method copySettingsFromSource out of prepareResizeIndexSettings so it could be used to filter settings in CreateIndexFromSourceAction. The additional filtering of deprecated property caused the requirements in CreateIndexFromSourceAction and MetadataCreateIndexService to diverge. So this change reverts the original refactor to MetadataCreateIndexService and adds a method similar to copySettingsFromSource to CreateIndexFromSourceAction.
…0163) When creating a destination index, filter any deprecated settings before copying the source settings to the dest index. Specifically, filter out settings with the property IndexSettingDeprecatedInV7AndRemovedInV8 or settings from a specific list which do not have this property but have no effect in v8. This also includes a change which reverts the changes that elastic#116996 made to MetadataCreateIndexService. That change factored the method copySettingsFromSource out of prepareResizeIndexSettings so it could be used to filter settings in CreateIndexFromSourceAction. The additional filtering of deprecated property caused the requirements in CreateIndexFromSourceAction and MetadataCreateIndexService to diverge. So this change reverts the original refactor to MetadataCreateIndexService and adds a method similar to copySettingsFromSource to CreateIndexFromSourceAction.
Add an action which reindexes a single data stream index. The contents of this action are not yet complete, but provide a way to wire into the reindex datastream persistent task. Eventually this action will do the following: