Add a hard check to ensure we are running with the expected lucene version

Closes #16301
This commit is contained in:
Simon Willnauer 2016-01-29 11:35:20 +01:00
parent fea8676a6c
commit fa17a84a89
1 changed files with 10 additions and 0 deletions

View File

@ -288,6 +288,9 @@ final class Bootstrap {
// fail if using broken version // fail if using broken version
JVMCheck.check(); JVMCheck.check();
// fail if somebody replaced the lucene jars
checkLucene();
INSTANCE.setup(true, settings, environment); INSTANCE.setup(true, settings, environment);
INSTANCE.start(); INSTANCE.start();
@ -364,4 +367,11 @@ final class Bootstrap {
private static void exit(int status) { private static void exit(int status) {
System.exit(status); System.exit(status);
} }
private static void checkLucene() {
if (Version.CURRENT.luceneVersion.equals(org.apache.lucene.util.Version.LATEST) == false) {
throw new AssertionError("Lucene version mismatch this version of Elasticsearch requires lucene version ["
+ Version.CURRENT.luceneVersion + "] but the current lucene version is [" + org.apache.lucene.util.Version.LATEST + "]");
}
}
} }