Add a hard check to ensure we are running with the expected lucene version
Closes #16301
This commit is contained in:
parent
fea8676a6c
commit
fa17a84a89
|
@ -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 + "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue