Make the index-too-old exception more explicit (#18438)

Closes #18418
This commit is contained in:
Clinton Gormley 2016-05-18 13:33:25 +02:00
parent de321fb159
commit c03dd8a290
1 changed files with 5 additions and 7 deletions

View File

@ -88,15 +88,13 @@ public class MetaDataIndexUpgradeService extends AbstractComponent {
} }
/** /**
* Elasticsearch 3.0 no longer supports indices with pre Lucene v5.0 (Elasticsearch v2.0.0.beta1) segments. All indices * Elasticsearch 5.0 no longer supports indices with pre Lucene v5.0 (Elasticsearch v2.0.0.beta1) segments. All indices
* that were created before Elasticsearch v2.0.0.beta1 should be upgraded using upgrade API before they can * that were created before Elasticsearch v2.0.0.beta1 should be reindexed in Elasticsearch 2.x
* be open by this version of elasticsearch. * before they can be opened by this version of elasticsearch. */
*/
private void checkSupportedVersion(IndexMetaData indexMetaData) { private void checkSupportedVersion(IndexMetaData indexMetaData) {
if (indexMetaData.getState() == IndexMetaData.State.OPEN && isSupportedVersion(indexMetaData) == false) { if (indexMetaData.getState() == IndexMetaData.State.OPEN && isSupportedVersion(indexMetaData) == false) {
throw new IllegalStateException("The index [" + indexMetaData.getIndex() + "] was created before v2.0.0.beta1 and wasn't upgraded." throw new IllegalStateException("The index [" + indexMetaData.getIndex() + "] was created before v2.0.0.beta1."
+ " This index should be opened using a version before " + Version.CURRENT.minimumCompatibilityVersion() + " It should be reindexed in Elasticsearch 2.x before upgrading to " + Version.CURRENT + ".");
+ " and upgraded using the upgrade API.");
} }
} }