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

Task manager to have migrations #40872

Closed
mikecote opened this issue Jul 11, 2019 · 3 comments · Fixed by #39829
Closed

Task manager to have migrations #40872

mikecote opened this issue Jul 11, 2019 · 3 comments · Fixed by #39829

Comments

@mikecote
Copy link
Contributor

mikecote commented Jul 11, 2019

Problem

The .kibana_task_manager index doesn't have a way to change the mapping or to migrate data. I want to add new fields to the index like retryAt and startedAt (see #39829).

Proposed solution

The solution I'm thinking of is to convert the index to be managed under saved objects but still as its own index. This will solve the problem of upgrading mappings and migrating the data by using the common migrator.

Solution problems

  • We'll need a way to migrate and transfer the data from the existing index to a new index created under saved objects
  • We may need to enhance saved objects client or still use callCluster to match current operations the task store does to Elasticsearch
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-stack-services

@mikecote
Copy link
Contributor Author

@epixa @elastic/kibana-operations Any idea how we could transfer the data from the existing index to a new index created by the saved objects client?

@mikecote
Copy link
Contributor Author

After speaking with @chrisdavies and @tylersmalley, we have come up with 4 options:

  1. When the migrator converts an index to an alias. As it moves the documents to a new index with _1 suffix, we'll allow a script to be provided that can convert the task manager documents from {id} to {type}:{id} and use the regular migrator for the rest.
  2. We can relax the rules of isRawSavedObject to not look for a prefix in the id. Use the regular migrator to change ids and the rest.
  3. Have some logic when isRawSavedObject returns false for documents to be claimed by a saved object type and run a migration function before the regular migrations to change the id and other fields if necessary.
  4. Write custom startup code to migrate the documents before the task manager starts up.

I will be exploring option 1 at this time.

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

Successfully merging a pull request may close this issue.

2 participants