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:
parent
79d0c4ed18
commit
f9f4d87437
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue