Skip to content

Commit f9f4d87

Browse files
committed
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
1 parent 79d0c4e commit f9f4d87

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

server/src/main/java/org/elasticsearch/search/SearchService.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,7 @@ protected void putReaderContext(ReaderContext context) {
300300
// this is important to ensure store can be cleaned up, in particular if the search is a scroll with a long timeout.
301301
final Index index = context.indexShard().shardId().getIndex();
302302
if (indicesService.hasIndex(index) == false) {
303-
final ReaderContext removed = removeReaderContext(context.id().getId());
304-
assert removed == context;
303+
removeReaderContext(context.id().getId());
305304
throw new IndexNotFoundException(index);
306305
}
307306
}

0 commit comments

Comments
 (0)