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

Adds warning to the healthcheck when a migration is pending #30040

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@tylersmalley
Copy link
Member

tylersmalley commented Feb 5, 2019

Since the index template was removed in #29268, we need to inform the user when they have done something to the index which requires a restart.

Here we wait until the migrations have been completed and check for pending required migrations with the health check.

To test you can delete the Kibana index after Kibana has started. You should begin to see warnings like the following:

server    log   [18:27:03.849] [warning] The Kibana server has pending migrations and should be restarted. This is most likely caused by removing or manually updating the underlying Kibana index.

This warning is currently limited to once every 30 seconds.

@elasticmachine

This comment has been minimized.

Copy link

elasticmachine commented Feb 5, 2019

@tylersmalley

This comment has been minimized.

Copy link
Member Author

tylersmalley commented Feb 5, 2019

@chrisdavies, thoughts?

@tylersmalley tylersmalley force-pushed the tylersmalley:pending-migrations branch from 7265cab to 7a07570 Feb 5, 2019

Adds warning to the healthcheck when a migration is pending
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

@tylersmalley tylersmalley force-pushed the tylersmalley:pending-migrations branch from 7a07570 to 69da28f Feb 5, 2019

@elastic elastic deleted a comment from elasticmachine Feb 5, 2019

@elastic elastic deleted a comment from elasticmachine Feb 5, 2019

@elasticmachine

This comment has been minimized.

Copy link

elasticmachine commented Feb 5, 2019


if (server.kibanaMigrator && server.kibanaMigrator.hasMigrated === true) {
const { migrationVersion } = server.kibanaMigrator.documentMigrator;
const upTodate = await migrationsUpToDate(callWithInternalUser, kibanaIndex, migrationVersion, 1);

This comment has been minimized.

@jbudz

jbudz Feb 5, 2019

Contributor

does it make sense to attach this to the kibanaMigrator class?

This comment has been minimized.

@tylersmalley

tylersmalley Feb 5, 2019

Author Member

Not sure what you mean. Do you mean move this logger logic into it or not use the kibanaMigrator here?

This comment has been minimized.

@jbudz

jbudz Feb 5, 2019

Contributor

migrationsUpToDate on the surface looks like something kibanaMigrator would expose but they're resolved differently (import vs exposed on server object). i see it's used via a static class instead, feel free to ignore

@chrisdavies

This comment has been minimized.

Copy link
Contributor

chrisdavies commented Feb 6, 2019

I wonder how expensive this check is? I'm not sure if we want to be doing it every 30 seconds, as I think it requires a full index scan. But I don't know much about this kind of thing.

It's also going to be permanently spammy in the case that someone has applied an index template that affects Kibana's mappings. Maybe I should get this PR moving forward: #28252

Maybe we can make it a less-frequent check?

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