OpenSearch/server
Jim Ferenczi 0f333c89b9
Always rewrite search shard request outside of the search thread pool (#51708) (#51979)
This change ensures that the rewrite of the shard request is executed in the network thread or in the refresh listener when waiting for an active shard. This allows queries that rewrite to match_no_docs to bypass the search thread pool entirely even if the can_match phase was skipped (pre_filter_shard_size > number of shards). Coordinating nodes don't have the ability to create empty responses so this change also ensures that at least one shard creates a full empty response while the other can return null ones. This is needed since creating true empty responses on shards require to create concrete aggregators which would be too costly to build on a network thread. We should move this functionality to aggregation builders in a follow up but that would be a much bigger change.
This change is also important for #49601 since we want to add the ability to use the result of other shards to rewrite the request of subsequent ones. For instance if the first M shards have their top N computed, the top worst document in the global queue can be pass to subsequent shards that can then rewrite to match_no_docs if they can guarantee that they don't have any document better than the provided one.
2020-02-06 10:53:11 +01:00
..
licenses Upgrade to lucene-8.5.0-snapshot-3333ce7da6d (#51749) 2020-01-31 11:20:15 -05:00
src Always rewrite search shard request outside of the search thread pool (#51708) (#51979) 2020-02-06 10:53:11 +01:00
build.gradle Upgrade to lucene-8.5.0-snapshot-3333ce7da6d (#51749) 2020-01-31 11:20:15 -05:00