Remove invalid assertion in SearchService (#62675)

This assertion does not always hold because there can be a race between
`putReaderContext` and `afterIndexRemoved` when an index is deleted.

Closes #62624
This commit is contained in:
Nhat Nguyen 2020-09-21 16:27:22 -04:00
parent 79d0c4ed18
commit f9f4d87437
1 changed files with 1 additions and 2 deletions

View File

@ -300,8 +300,7 @@ public class SearchService extends AbstractLifecycleComponent implements IndexEv
// this is important to ensure store can be cleaned up, in particular if the search is a scroll with a long timeout.
final Index index = context.indexShard().shardId().getIndex();
if (indicesService.hasIndex(index) == false) {
final ReaderContext removed = removeReaderContext(context.id().getId());
assert removed == context;
removeReaderContext(context.id().getId());
throw new IndexNotFoundException(index);
}
}