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

Make plugin install idempotent #61385

Closed
anyasabo opened this issue Aug 20, 2020 · 9 comments
Closed

Make plugin install idempotent #61385

anyasabo opened this issue Aug 20, 2020 · 9 comments
Assignees
Labels
:Core/Infra/Plugins Plugin API and infrastructure >enhancement Team:Core/Infra Meta label for core/infra team

Comments

@anyasabo
Copy link

It would be useful if bin/elasticsearch-plugin install --batch could be called repeatedly. As it is, the first call will succeed and subsequent calls will fail. This comes up not infrequently in Kubernetes environments, where we may install plugins as an init container (which runs before the Elasticsearch container), but some maintenance operations may cause it to run again and error out. If it could detect that it has already run successfully and exit gracefully it would be helpful.

There are workarounds including:

  • test for plugin existence before installing
  • create a new docker image with the plugin already installed, so never use an init container

But both add extra complexity on the user side.

Here's an ECK issue discussing this for reference:
elastic/cloud-on-k8s#3530

We also have similar issues with initializing the keystore, but we can discuss that in a separate issue.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Plugins)

@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Aug 20, 2020
@jaymode jaymode removed the needs:triage Requires assignment of a team area label label Aug 20, 2020
@pugnascotia
Copy link
Contributor

We discussed this issue in the Core/Infra sync. @anyasabo would it work for you to pass an extra flag, e.g. --ignore-existing, that would stop the install process exiting with a failure if a plugin was already present? There's no infrastructure in place right now for comparing the currently-installed plugin with the to-be-installed plugin, so simply accepting the already-installed plugin would be simplest.

@anyasabo
Copy link
Author

anyasabo commented Sep 9, 2020

👍 that makes sense to me

@rjernst rjernst self-assigned this Sep 15, 2020
@rjernst rjernst added the needs:triage Requires assignment of a team area label label Dec 3, 2020
@williamrandolph
Copy link
Contributor

This issue looks like something that the core-infra team should plan to work on, so I'm going to remove the needs:triage label and leave it as is.

@irizzant
Copy link

I have applied the following workaround:

command: [
            'sh',
            '-c',
            'bin/elasticsearch-plugin install --batch repository-s3 || true',
          ],

@mark-vieira
Copy link
Contributor

We might want to consider this a duplicate of #70219. The use case described in that issue would solve this problem as well.

@B-Souty
Copy link

B-Souty commented Jun 7, 2021

Has there been any progress on this issue? We just had this issue in production using ECK where a master was in a crash loop due to a plugin already installed. I really like the solution proposed in #70219

@epicvinny
Copy link

Has there been any progress on this issue? We just had this issue in production using ECK where a master was in a crash loop due to a plugin already installed. I really like the solution proposed in #70219

+1

@rjernst
Copy link
Member

rjernst commented Sep 27, 2021

Closing in favor of #70219

@rjernst rjernst closed this as completed Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Plugins Plugin API and infrastructure >enhancement Team:Core/Infra Meta label for core/infra team
Projects
None yet
Development

No branches or pull requests

10 participants