浏览代码

Enable query phase parallelism by default (#101230)

Inter-segment search concurrency is enabled only in the DFS phase so
far, and affects knn searches. This commit enables it by default for the
query phase too.
Luca Cavanna 2 年之前
父节点
当前提交
d2f97e7e88

+ 12 - 0
docs/changelog/101230.yaml

@@ -0,0 +1,12 @@
+pr: 101230
+summary: Enable query phase parallelism within a single shard
+area: Search
+type: enhancement
+issues:
+ - 80693
+highlight:
+  title: Enable query phase parallelism within a single shard
+  body: |-
+    Activate inter-segment search concurrency by default in the query phase, in order to
+    enable parallelizing search execution across segments that a single shard is made of.
+  notable: true

+ 1 - 1
server/src/main/java/org/elasticsearch/search/SearchService.java

@@ -224,7 +224,7 @@ public class SearchService extends AbstractLifecycleComponent implements IndexEv
 
     public static final Setting<Boolean> QUERY_PHASE_PARALLEL_COLLECTION_ENABLED = Setting.boolSetting(
         "search.query_phase_parallel_collection_enabled",
-        false,
+        true,
         Property.NodeScope,
         Property.Dynamic
     );

+ 2 - 1
test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java

@@ -2075,8 +2075,9 @@ public abstract class ESIntegTestCase extends ESTestCase {
         }
         boolean enableConcurrentSearch = enableConcurrentSearch();
         if (enableConcurrentSearch) {
-            initialNodeSettings.put(SearchService.QUERY_PHASE_PARALLEL_COLLECTION_ENABLED.getKey(), true);
             initialNodeSettings.put(SearchService.MINIMUM_DOCS_PER_SLICE.getKey(), 1);
+        } else {
+            initialNodeSettings.put(SearchService.QUERY_PHASE_PARALLEL_COLLECTION_ENABLED.getKey(), false);
         }
         return new NodeConfigurationSource() {
             @Override

+ 3 - 2
test/framework/src/main/java/org/elasticsearch/test/ESSingleNodeTestCase.java

@@ -254,8 +254,9 @@ public abstract class ESSingleNodeTestCase extends ESTestCase {
 
         boolean enableConcurrentSearch = enableConcurrentSearch();
         if (enableConcurrentSearch) {
-            settingBuilder.put(SearchService.QUERY_PHASE_PARALLEL_COLLECTION_ENABLED.getKey(), true)
-                .put(SearchService.MINIMUM_DOCS_PER_SLICE.getKey(), 1);
+            settingBuilder.put(SearchService.MINIMUM_DOCS_PER_SLICE.getKey(), 1);
+        } else {
+            settingBuilder.put(SearchService.QUERY_PHASE_PARALLEL_COLLECTION_ENABLED.getKey(), false);
         }
         Settings settings = settingBuilder.build();