Skip to content

Upgrade from 5.4.0 to 5.6.0 failed with indexes using custom similarity. #26647

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

Closed
pweerd opened this issue Sep 14, 2017 · 1 comment
Closed

Comments

@pweerd
Copy link

pweerd commented Sep 14, 2017

Describe the feature:

Elasticsearch version (bin/elasticsearch --version):

Plugins installed: [my custom similarity plugin]

JVM version (java -version): 1.8.0_111-b14

OS version (uname -a if on a Unix-like system): Windows 10

Description of the problem including expected versus actual behavior:
Elasticsearch will not start when there are existing indexes with a custom similarity.
The exception is: Error injecting constructor, java.lang.IllegalStateException: unable to upgrade the mappings for the index [[boe_pc/PGTTzoK3SV-A54eryi40iw]],

which is caused by:
java.lang.IllegalArgumentException: Unknown Similarity type [bounded_similarity] for [default]

Bounded_similarity is the name of my custom similarity.
To me it looks like Elasticsearch starts upgrading the existing indexes before calling the plugins "onIndexModule". When starting a cluster with no data and creating a simple index, "onIndexModule" gets called, but when ES starts with existing indexes, it crashes in the upgrade procedure without calling my plugin.,

I think in general it would be handy when there is an option to allow an index with a problematic custom similarity to be loaded anyway (without that similarity). If that is the case, one can manipulate the index definition afterwards.

I can work around it: I can simply copy the documents from the old index to a brand new index in the new cluster. But it is a pain, and it is not the first time that upgrades fail because of this...

Steps to reproduce:

Please include a minimal but complete recreation of the problem, including
(e.g.) index creation, mappings, settings, query etc. The easier you make for
us to reproduce it, the more likely that somebody will take the time to look at it.

  1. Create an index with a custom similarity in a 5.4.0 cluster
  2. Upgrade the cluster to 5.6.0

I can provide my 5.4 and 5.6 plugin and an index definition if you wish.

Provide logs (if relevant):
I can provide logs if you wish.

@jasontedor
Copy link
Member

Duplicates #25350

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

No branches or pull requests

2 participants