CombinedDeletionPolicy can't assert it has no commits when creating an index

This is an appealing assertion, but there scenarios where it can happen under normal operations. For example, when an index is created it may run into an exception when the lucene files have already been created. The master will try to assign the shard to another node (it's empty, so no need to look for data) but if there is no other node, it will reassign it to the same node. At that point the deletion will get a list of existing commits (which it will typically delete).
This commit is contained in:
Boaz Leskes 2017-07-18 17:22:38 +02:00
parent 43bfe06759
commit c0e6dafcab
1 changed files with 0 additions and 1 deletions

View File

@ -51,7 +51,6 @@ class CombinedDeletionPolicy extends IndexDeletionPolicy {
indexDeletionPolicy.onInit(commits);
switch (openMode) {
case CREATE_INDEX_AND_TRANSLOG:
assert commits.isEmpty() : "index is being created but we already have commits";
break;
case OPEN_INDEX_CREATE_TRANSLOG:
assert commits.isEmpty() == false : "index is opened, but we have no commits";