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

[FEATURE] Copy metadata from last index during rollover #849

Open
soosinha opened this issue Jul 10, 2023 · 5 comments
Open

[FEATURE] Copy metadata from last index during rollover #849

soosinha opened this issue Jul 10, 2023 · 5 comments
Assignees
Labels
enhancement New request

Comments

@soosinha
Copy link
Member

soosinha commented Jul 10, 2023

Is your feature request related to a problem?
Follow up from the feature request in OpenSearch: opensearch-project/OpenSearch#8419

During rollover, the index metadata is picked up from the template. But in case the mappings have been updated during ingestion due to dynamic mappings being enabled, the new index will not have the latest mappings. When data is ingested on the new index, there will be updation of mappings immediately which will result in cluster state updates. These cluster state updates can potentially increase the load on the cluster manager nodes.

What solution would you like?
Rollover action should have an option to copy the metadata from the previous index. This way the mappings will be in sync with documents being ingested and we can avoid redundant dynamic mappings updates.

Detailed API level changes:
The rollover action will have a new boolean parameter use_previous_index_metadata like below:

{
  "rollover": {
    "use_previous_index_metadata": true
  }
}

This parameter will be false by default. When this is set to true, during rollover the metadata will be copied from the last write index of the alias or the data stream.

@soosinha
Copy link
Member Author

@opensearch-project/index-management Let me know if I can go ahead with this change.

@bowenlan-amzn
Copy link
Member

@soosinha please go ahead.
We have a request to copy over all aliases from previous index to newly created index during rollover, will your enhancement also cover aliases or it will only cover mappings of index metadata.

@soosinha
Copy link
Member Author

soosinha commented Jul 11, 2023

@bowenlan-amzn Thanks for the confirmation. Can you assign this issue to me?

The plan was to copy only settings and mappings from the previous index.
But the issue that you have linked here seems very similar to current scope. I should be able to handle the copying of aliases as well in this change.

Should one parameter like copy_metadata be sufficient to control the copying of aliases, settings and mappings or do we need separate parameters like copy_alias and copy_mappings ?

@bowenlan-amzn
Copy link
Member

Thanks a lot!
I would suggest using separate parameters for aliases, settings and mappings.

@JahanviAcquia
Copy link

any update on this ticket? We have dynamic attribute mapping. So we will need to update rollover alias manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New request
Projects
None yet
Development

No branches or pull requests

3 participants