Skip to content

Commit 3d77894

Browse files
authored
Remove empty queue conditional from slicing logic (#114513)
With recent changes in Lucene around not forking execution when not necessary, we have removed the search worker thread pool in #111099. The worker thread pool had unlimited queue, and the fear was that we couuld have much more queueing on the search thread pool if we use it to parallelize execution across segments, because every shard would take up to a thread per slice when executing the query phase. We have then introduced an additional conditional to stop parallelizing when there is a queue. That is perhaps a bit extreme, as it's a decision made when creating the searcher, while a queue may no longer be there once the search is executing. This has caused some benchmarks regressions, hence this commit removes the additional queue dependent conditional in order to perform additional benchmarks without it.
1 parent 08a24ca commit 3d77894

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

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

-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ static int determineMaximumNumberOfSlices(
291291
ToLongFunction<String> fieldCardinality
292292
) {
293293
return executor instanceof ThreadPoolExecutor tpe
294-
&& tpe.getQueue().isEmpty()
295294
&& isParallelCollectionSupportedForResults(resultsType, request.source(), fieldCardinality, enableQueryPhaseParallelCollection)
296295
? tpe.getMaximumPoolSize()
297296
: 1;

0 commit comments

Comments
 (0)