Skip to content

Commit b3e171b

Browse files
EsduardHendrik Muhs
and
Hendrik Muhs
authored
changing hard coded 10k page size limit to 65k (#74651)
changes hard code 10k page size limit to 65k(default for `search.max_bucket`) Closes #57719 Co-authored-by: Hendrik Muhs <[email protected]>
1 parent bec0d94 commit b3e171b

File tree

5 files changed

+28
-18
lines changed

5 files changed

+28
-18
lines changed

docs/reference/rest-api/common-parms.asciidoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,8 @@ tag::bulk-dynamic-templates[]
602602
`dynamic_templates`::
603603
(Optional, map)
604604
A map from the full name of fields to the name of <<dynamic-templates, dynamic templates>.
605-
Defaults to an empty map. If a name matches a dynamic template, then that template will be
606-
applied regardless of other match predicates defined in the template. And if a field is
605+
Defaults to an empty map. If a name matches a dynamic template, then that template will be
606+
applied regardless of other match predicates defined in the template. And if a field is
607607
already defined in the mapping, then this parameter won't be used.
608608
end::bulk-dynamic-templates[]
609609

@@ -896,11 +896,11 @@ end::source-transforms[]
896896
tag::source-index-transforms[]
897897
The _source indices_ for the {transform}. It can be a single index, an index
898898
pattern (for example, `"my-index-*"`), an array of indices (for example,
899-
`["my-index-000001", "my-index-000002"]`), or an array of index patterns (for
900-
example, `["my-index-*", "my-other-index-*"]`. For remote indices use the syntax
899+
`["my-index-000001", "my-index-000002"]`), or an array of index patterns (for
900+
example, `["my-index-*", "my-other-index-*"]`. For remote indices use the syntax
901901
`"remote_name:index_name"`.
902902

903-
NOTE: If any indices are in remote clusters then the master node and at least
903+
NOTE: If any indices are in remote clusters then the master node and at least
904904
one transform node must have the `remote_cluster_client` node role.
905905
end::source-index-transforms[]
906906

@@ -910,8 +910,8 @@ A query clause that retrieves a subset of data from the source index. See
910910
end::source-query-transforms[]
911911

912912
tag::source-runtime-mappings-transforms[]
913-
Definitions of search-time runtime fields that can be used by the transform. For
914-
search runtime fields all data nodes, including remote nodes, must be 7.12 or
913+
Definitions of search-time runtime fields that can be used by the transform. For
914+
search runtime fields all data nodes, including remote nodes, must be 7.12 or
915915
later.
916916
end::source-runtime-mappings-transforms[]
917917

@@ -971,7 +971,7 @@ unique key.
971971
end::transform-latest[]
972972

973973
tag::transform-retention[]
974-
Defines a retention policy for the {transform}. Data that meets the defined
974+
Defines a retention policy for the {transform}. Data that meets the defined
975975
criteria is deleted from the destination index.
976976
end::transform-retention[]
977977

@@ -984,7 +984,7 @@ The date field that is used to calculate the age of the document.
984984
end::transform-retention-time-field[]
985985

986986
tag::transform-retention-time-max-age[]
987-
Specifies the maximum age of a document in the destination index. Documents that
987+
Specifies the maximum age of a document in the destination index. Documents that
988988
are older than the configured value are removed from the destination index.
989989
end::transform-retention-time-max-age[]
990990

@@ -1008,7 +1008,7 @@ end::transform-settings-docs-per-second[]
10081008
tag::transform-settings-max-page-search-size[]
10091009
Defines the initial page size to use for the composite aggregation for each
10101010
checkpoint. If circuit breaker exceptions occur, the page size is dynamically
1011-
adjusted to a lower value. The minimum value is `10` and the maximum is `10,000`.
1011+
adjusted to a lower value. The minimum value is `10` and the maximum is `65,536`.
10121012
The default value is `500`.
10131013
end::transform-settings-max-page-search-size[]
10141014

x-pack/plugin/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ tasks.named("yamlRestCompatTest").configure {
167167
'transform/transforms_cat_apis/Test cat transform stats hiding headers',
168168
'transform/transforms_cat_apis/Test cat transform stats with column selection',
169169
'transform/transforms_cat_apis/Test cat transform stats with continuous transform',
170+
'transform/transforms_crud/Test put config with invalid pivot size', // disabled until backport of #74651 has finished
170171
'vectors/10_dense_vector_basic/Deprecated function signature',
171172
'vectors/30_sparse_vector_basic/Cosine Similarity',
172173
'vectors/30_sparse_vector_basic/Deprecated function signature',

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SettingsConfig.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.elasticsearch.common.xcontent.ToXContentObject;
1919
import org.elasticsearch.common.xcontent.XContentBuilder;
2020
import org.elasticsearch.common.xcontent.XContentParser;
21+
import org.elasticsearch.search.aggregations.MultiBucketConsumerService;
2122
import org.elasticsearch.xpack.core.transform.TransformField;
2223

2324
import java.io.IOException;
@@ -97,10 +98,12 @@ public Integer getDatesAsEpochMillisForUpdate() {
9798
}
9899

99100
public ActionRequestValidationException validate(ActionRequestValidationException validationException) {
100-
// TODO: make this dependent on search.max_buckets
101-
if (maxPageSearchSize != null && (maxPageSearchSize < 10 || maxPageSearchSize > 10_000)) {
101+
if (maxPageSearchSize != null && (maxPageSearchSize < 10 || maxPageSearchSize > MultiBucketConsumerService.DEFAULT_MAX_BUCKETS)) {
102102
validationException = addValidationError(
103-
"settings.max_page_search_size [" + maxPageSearchSize + "] must be greater than 10 and less than 10,000",
103+
"settings.max_page_search_size ["
104+
+ maxPageSearchSize
105+
+ "] is out of range. The minimum value is 10 and the maximum is "
106+
+ MultiBucketConsumerService.DEFAULT_MAX_BUCKETS,
104107
validationException
105108
);
106109
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/PivotConfig.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.elasticsearch.common.xcontent.ToXContentObject;
1919
import org.elasticsearch.common.xcontent.XContentBuilder;
2020
import org.elasticsearch.common.xcontent.XContentParser;
21+
import org.elasticsearch.search.aggregations.MultiBucketConsumerService;
2122
import org.elasticsearch.search.aggregations.bucket.composite.CompositeAggregationBuilder;
2223
import org.elasticsearch.xpack.core.transform.TransformField;
2324
import org.elasticsearch.xpack.core.transform.utils.ExceptionsHelper;
@@ -170,9 +171,13 @@ public int hashCode() {
170171
}
171172

172173
public ActionRequestValidationException validate(ActionRequestValidationException validationException) {
173-
if (maxPageSearchSize != null && (maxPageSearchSize < 10 || maxPageSearchSize > 10_000)) {
174+
175+
if (maxPageSearchSize != null && (maxPageSearchSize < 10 || maxPageSearchSize > MultiBucketConsumerService.DEFAULT_MAX_BUCKETS)) {
174176
validationException = addValidationError(
175-
"pivot.max_page_search_size [" + maxPageSearchSize + "] must be greater than 10 and less than 10,000",
177+
"pivot.max_page_search_size ["
178+
+ maxPageSearchSize
179+
+ "] is out of range. The minimum value is 10 and the maximum is "
180+
+ MultiBucketConsumerService.DEFAULT_MAX_BUCKETS,
176181
validationException
177182
);
178183
}

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/transform/transforms_crud.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ setup:
480480
---
481481
"Test put config with invalid pivot size":
482482
- do:
483-
catch: /pivot\.max_page_search_size \[5\] must be greater than 10 and less than 10,000/
483+
catch: /pivot\.max_page_search_size \[5\] is out of range. The minimum value is 10 and the maximum is 65536/
484484
transform.put_transform:
485485
transform_id: "airline-transform"
486486
body: >
@@ -494,15 +494,16 @@ setup:
494494
}
495495
}
496496
- do:
497-
catch: /pivot\.max_page_search_size \[15000\] must be greater than 10 and less than 10,000/
497+
catch: /pivot\.max_page_search_size \[75000\] is out of range. The minimum value is 10 and the maximum is 65536/
498+
498499
transform.put_transform:
499500
transform_id: "airline-transform"
500501
body: >
501502
{
502503
"source": { "index": "airline-data" },
503504
"dest": { "index": "airline-dest-index" },
504505
"pivot": {
505-
"max_page_search_size": 15000,
506+
"max_page_search_size": 75000,
506507
"group_by": { "airline": {"terms": {"field": "airline"}}},
507508
"aggs": {"avg_response": {"avg": {"field": "responsetime"}}}
508509
}

0 commit comments

Comments
 (0)