elastic / elasticsearch

Free and Open, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
68.65k stars 24.38k forks source link

Debian/Ubuntu: Package upgrade (and maybe remove) should uninstall plugins before removing the package #110486

Open mikkorantalainen opened 1 week ago

mikkorantalainen commented 1 week ago

Description

Example case:

System had Elasticseach 7.x (package elasticsearch) installed from official Elasticsearch repository and it had plugin analysis-icu installed. When the Debian/Ubuntu package was upgraded to Elasticsearch 8.x the plugin stopped working and the official tools couldn't even uninstall the plugin because of version mismatch.

The only way to workaround the issue was to downgrade the package again, uninstall the plugin, reinstall the upgraded package and reinstall the plugin.

Sensible options to improve the behavior would be as follows:

  1. Automatically uninstall all the versioned plugins before uninstalling any package (either for removal or upgrade). This is required to prevent next installed version from failing to boot because of version mismatch in plugins.
  2. Add a prerm script that aborts the uninstall of previous package if any versioned plugins are currently installed. This may cause some side-effects with package manager but it would prevent removing anything from the system without the adminstrator being aware of it.
  3. Improve the Elasticsearch to be able to automatically disable any plugin with version mismatch and allow removing any disabled plugin without downgrading the whole software first.
elasticsearchmachine commented 1 week ago

Pinging @elastic/es-delivery (Team:Delivery)

elasticsearchmachine commented 1 week ago

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

mark-vieira commented 1 week ago

Presumably this is problem with all packaging types but it's probably a bit easier to automate this with the deb/rpm packages since we can script this stuff.

Another option here would be to expand the capability of declarative plugins to packaging types other than Docker.