From 6435928c4ff59c6005c438edab8ec43c2587ecad Mon Sep 17 00:00:00 2001 From: Nhat Nguyen Date: Fri, 22 Dec 2017 15:03:25 -0500 Subject: [PATCH] Remove no existing commits assertion in onInit() This assertion does not hold if a shard is recovered from an empty store but failed then retries. Moreover, if the openMode is CREATE_INDEX_*, we pass CREATE mode to the IndexWriterConfig to create a new index and overwrite the existing one. Closes #27960 --- .../org/elasticsearch/index/engine/CombinedDeletionPolicy.java | 1 - 1 file changed, 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/index/engine/CombinedDeletionPolicy.java b/core/src/main/java/org/elasticsearch/index/engine/CombinedDeletionPolicy.java index 2d46ae1d8a8..478766e9426 100644 --- a/core/src/main/java/org/elasticsearch/index/engine/CombinedDeletionPolicy.java +++ b/core/src/main/java/org/elasticsearch/index/engine/CombinedDeletionPolicy.java @@ -53,7 +53,6 @@ final class CombinedDeletionPolicy extends IndexDeletionPolicy { public void onInit(List commits) throws IOException { switch (openMode) { case CREATE_INDEX_AND_TRANSLOG: - assert commits.isEmpty() : "index is created, but we have commits"; break; case OPEN_INDEX_CREATE_TRANSLOG: assert commits.isEmpty() == false : "index is opened, but we have no commits";