add EngineClosed and IndexShardClosed exceptions to assertions on executing bulk shard operation on replica

This commit is contained in:
Areek Zillur 2016-11-02 20:18:31 -04:00
parent 2e652d3b57
commit 2110221f59
1 changed files with 6 additions and 1 deletions

View File

@ -47,9 +47,11 @@ import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.VersionType;
import org.elasticsearch.index.engine.Engine;
import org.elasticsearch.index.engine.EngineClosedException;
import org.elasticsearch.index.engine.VersionConflictEngineException;
import org.elasticsearch.index.mapper.MapperParsingException;
import org.elasticsearch.index.shard.IndexShard;
import org.elasticsearch.index.shard.IndexShardClosedException;
import org.elasticsearch.index.translog.Translog;
import org.elasticsearch.indices.IndicesService;
import org.elasticsearch.threadpool.ThreadPool;
@ -346,7 +348,10 @@ public class TransportShardBulkAction extends TransportWriteAction<BulkShardRequ
Exception failure = operationResult.getFailure();
assert failure instanceof VersionConflictEngineException
|| failure instanceof MapperParsingException
: "expected version conflict or mapper parsing failures. got " + failure;
|| failure instanceof EngineClosedException
|| failure instanceof IndexShardClosedException
: "expected any one of [version conflict, mapper parsing, engine closed, index shard closed]" +
" failures. got " + failure;
if (!ignoreReplicaException(failure)) {
throw failure;
}