Merge pull request #16305 from s1monw/issues/16301

Add a hard check to ensure we are running with the expected lucene version
This commit is contained in:
Simon Willnauer 2016-01-29 12:17:35 +01:00
commit 74a1959c3b
1 changed files with 10 additions and 0 deletions

View File

@ -288,6 +288,9 @@ final class Bootstrap {
// fail if using broken version
JVMCheck.check();
// fail if somebody replaced the lucene jars
checkLucene();
INSTANCE.setup(true, settings, environment);
INSTANCE.start();
@ -364,4 +367,11 @@ final class Bootstrap {
private static void exit(int 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 + "]");
}
}
}