Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/changelog/135934.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 135934
summary: Move can-match thread from transport thread to search coordinator thread
area: Search
type: bug
issues:
- 134959
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public static void registerRequestHandler(

transportService.registerRequestHandler(
QUERY_ACTION_NAME,
EsExecutors.DIRECT_EXECUTOR_SERVICE,
transportService.getThreadPool().executor(ThreadPool.Names.SEARCH_COORDINATION),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I see what the intention is here, to move off of the transport thread part of the shard query phase that happens before we fork to search, can you confirm?

The title of the PR refers to can match thread though, while this moves the query action (rather than can match) to search coordination.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SearchService::executeQueryPhase is an overloaded function. As far as I can tell, the executeQueryPhase referenced here is performing a can-match (if possible) and if the can-match succeeds, then calls the other executeQueryPhase function which is doing the normal query phase.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, we really shouldn't have named two different methods doing different things by one name... But there seems to be four executeQueryPhase methods, quite confusing tbh. None of them have any explanation on how they differ from others, sigh.

ShardSearchRequest::new,
(request, channel, task) -> searchService.executeQueryPhase(
request,
Expand Down