Skip to content

Commit a11d4b8

Browse files
committed
Merge branch 'main' into esql-datetrunc-timezone
2 parents 8b8a115 + deba9f1 commit a11d4b8

File tree

24 files changed

+705
-13
lines changed

24 files changed

+705
-13
lines changed

docs/changelog/136890.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 136890
2+
summary: "Cat API: added endpoint for Circuit Breakers"
3+
area: Infra/REST API
4+
type: enhancement
5+
issues: []

docs/changelog/137047.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 137047
2+
summary: Reject invalid `reverse_nested` aggs
3+
area: Aggregations
4+
type: bug
5+
issues: []

docs/changelog/137306.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 137306
2+
summary: Shard started reroute high priority
3+
area: Allocation
4+
type: enhancement
5+
issues: []

docs/changelog/137325.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 137325
2+
summary: "Enable `_otlp` usage with `create_doc`, `auto_configure` privileges"
3+
area: TSDB
4+
type: "bug"
5+
issues: []

modules/aggregations/src/yamlRestTest/resources/rest-api-spec/test/aggregations/nested.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,33 @@ setup:
194194
- match: { aggregations.courses.highpass_filter.unnest.department.buckets.0.doc_count: 1 }
195195
- match: { aggregations.courses.highpass_filter.unnest.department.buckets.1.key: math }
196196
- match: { aggregations.courses.highpass_filter.unnest.department.buckets.1.doc_count: 1 }
197+
---
198+
"Illegal reverse nested aggregation to a child nested object":
199+
- requires:
200+
capabilities:
201+
- method: POST
202+
path: /_search
203+
capabilities: [ reject_invalid_reverse_nesting ]
204+
test_runner_features: [ capabilities ]
205+
reason: "search does not yet reject invalid reverse nesting paths"
206+
- do:
207+
catch: /Reverse nested path \[courses.sessions\] is not a parent of the current nested scope \[courses\]/
208+
search:
209+
index: test
210+
body:
211+
{
212+
"aggs": {
213+
"parent_nested": {
214+
"nested": {
215+
"path": "courses"
216+
},
217+
"aggs": {
218+
"invalid_reverse_nested": {
219+
"reverse_nested": {
220+
"path": "courses.sessions"
221+
}
222+
}
223+
}
224+
}
225+
}
226+
}

muted-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,9 @@ tests:
504504
- class: org.elasticsearch.xpack.esql.qa.mixed.EsqlClientYamlIT
505505
method: test {p0=esql/40_tsdb/error on rename timestamp}
506506
issue: https://github.com/elastic/elasticsearch/issues/137259
507+
- class: org.elasticsearch.xpack.esql.plan.physical.ShowExecSerializationTests
508+
method: testConcurrentSerialization
509+
issue: https://github.com/elastic/elasticsearch/issues/137338
507510

508511
# Examples:
509512
#
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"cat.circuit_breaker": {
3+
"documentation": {
4+
"url": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO",
5+
"description": "Get circuit breakers statistics"
6+
},
7+
"stability": "stable",
8+
"visibility": "public",
9+
"headers": {
10+
"accept": [
11+
"text/plain",
12+
"application/json"
13+
]
14+
},
15+
"url": {
16+
"paths": [
17+
{
18+
"path": "/_cat/circuit_breaker",
19+
"methods": [
20+
"GET"
21+
]
22+
},
23+
{
24+
"path": "/_cat/circuit_breaker/{circuit_breaker_patterns}",
25+
"methods": [
26+
"GET"
27+
],
28+
"parts": {
29+
"circuit_breaker_patterns": {
30+
"type": "list",
31+
"description": "A comma-separated list of regular-expressions to filter the circuit breakers in the output"
32+
}
33+
}
34+
}
35+
]
36+
},
37+
"params": {
38+
"format": {
39+
"type": "string",
40+
"default": "text",
41+
"description": "a short version of the Accept header, e.g. json, yaml"
42+
},
43+
"time": {
44+
"type": "enum",
45+
"description": "The unit in which to display time values",
46+
"options": [
47+
"d",
48+
"h",
49+
"m",
50+
"s",
51+
"ms",
52+
"micros",
53+
"nanos"
54+
]
55+
},
56+
"local": {
57+
"type": "boolean",
58+
"default": false,
59+
"description": "Return local information, do not retrieve the state from master node (default: false)"
60+
},
61+
"master_timeout": {
62+
"type": "time",
63+
"default": "30s",
64+
"description": "Explicit operation timeout for connection to master node"
65+
},
66+
"h": {
67+
"type": "list",
68+
"description": "Comma-separated list of column names to display"
69+
},
70+
"help": {
71+
"type": "boolean",
72+
"description": "Return help information",
73+
"default": false
74+
},
75+
"s": {
76+
"type": "list",
77+
"description": "Comma-separated list of column names or column aliases to sort by"
78+
},
79+
"v": {
80+
"type": "boolean",
81+
"description": "Verbose mode. Display column headers",
82+
"default": false
83+
},
84+
"bytes": {
85+
"type": "enum",
86+
"description": "The unit in which to display byte values",
87+
"options": [
88+
"b",
89+
"kb",
90+
"mb",
91+
"gb",
92+
"tb",
93+
"pb"
94+
]
95+
}
96+
}
97+
}
98+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
"Test cat circuit_breaker help":
3+
- requires:
4+
capabilities:
5+
- method: GET
6+
path: /_cat/circuit_breaker
7+
test_runner_features: capabilities
8+
reason: Capability required to run test
9+
- do:
10+
cat.circuit_breaker:
11+
help: true
12+
13+
- match:
14+
$body: |
15+
/^ node_id .+ \n
16+
node_name .+ \n
17+
breaker .+ \n
18+
limit .+ \n
19+
limit_bytes .+ \n
20+
estimated .+ \n
21+
estimated_bytes .+ \n
22+
tripped .+ \n
23+
overhead .+ \n $/
24+
25+
---
26+
"Test cat circuit_breaker output":
27+
- requires:
28+
capabilities:
29+
- method: GET
30+
path: /_cat/circuit_breaker
31+
test_runner_features: capabilities
32+
reason: Capability required to run test
33+
- do:
34+
cat.circuit_breaker: {}
35+
36+
- match:
37+
$body: |
38+
/ #node_id breaker \s+ limit \s+ estimated \s+ tripped \n
39+
^ (\S+ \s+ \S+ \s+ \S+ \s+ \S+ \s+ \d+ \n)+ $/
40+
41+
- do:
42+
cat.circuit_breaker:
43+
v: true
44+
45+
- match:
46+
$body: |
47+
/^ node_id \s+ breaker \s+ limit \s+ estimated \s+ tripped \n
48+
(\S+ \s+ \S+ \s+ \S+ \s+ \S+ \s+ \d+ \n)+ $/
49+
50+
- do:
51+
cat.circuit_breaker:
52+
circuit_breaker_patterns: request,fielddata
53+
h: node_id,breaker,limit,estimated,tripped
54+
v: true
55+
56+
- match:
57+
$body: |
58+
/^ node_id \s+ breaker \s+ limit \s+ estimated \s+ tripped \n
59+
(\S+ \s+ (request|fielddata) \s+ \S+ \s+ \S+ \s+ \d+ \n){2,} $/
60+
61+
- do:
62+
cat.circuit_breaker:
63+
circuit_breaker_patterns: request
64+
h: node_id,breaker,limit,limit_bytes,estimated,estimated_bytes,tripped,overhead
65+
v: true
66+
67+
- match:
68+
$body: |
69+
/^ node_id \s+ breaker \s+ limit \s+ limit_bytes \s+ estimated \s+ estimated_bytes \s+ tripped \s+ overhead \n
70+
(\S+ \s+ request \s+ \S+ \s+ \d+ \s+ \S+ \s+ \d+ \s+ \d+ \s+ \d+\.\d+ \n)+ $/
71+
72+
- do:
73+
cat.circuit_breaker:
74+
circuit_breaker_patterns: "*"
75+
h: node_id,breaker,tripped
76+
77+
- match:
78+
$body: |
79+
/ #node_id breaker \s+ tripped \n
80+
^ (\S+ \s+ \S+ \s+ \d+ \n)+ $/

server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ReverseNestedIT.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,15 +470,19 @@ public void testReverseNestedAggWithoutNestedAgg() {
470470
public void testNonExistingNestedField() throws Exception {
471471
assertNoFailuresAndResponse(
472472
prepareSearch("idx2").setQuery(matchAllQuery())
473-
.addAggregation(nested("nested2", "nested1.nested2").subAggregation(reverseNested("incorrect").path("nested3"))),
473+
.addAggregation(nested("nested2", "nested1.nested2"))
474+
.addAggregation(nested("incorrect", "nested1.incorrect")),
474475
response -> {
475476

476477
SingleBucketAggregation nested = response.getAggregations().get("nested2");
477478
assertThat(nested, notNullValue());
478479
assertThat(nested.getName(), equalTo("nested2"));
480+
assertThat(nested.getDocCount(), is(27L));
479481

480-
SingleBucketAggregation reverseNested = nested.getAggregations().get("incorrect");
481-
assertThat(reverseNested.getDocCount(), is(0L));
482+
SingleBucketAggregation incorrect = response.getAggregations().get("incorrect");
483+
assertThat(incorrect, notNullValue());
484+
assertThat(incorrect.getName(), equalTo("incorrect"));
485+
assertThat(incorrect.getDocCount(), is(0L));
482486
}
483487
);
484488

server/src/main/java/org/elasticsearch/action/ActionModule.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@
376376
import org.elasticsearch.rest.action.cat.RestAliasAction;
377377
import org.elasticsearch.rest.action.cat.RestAllocationAction;
378378
import org.elasticsearch.rest.action.cat.RestCatAction;
379+
import org.elasticsearch.rest.action.cat.RestCatCircuitBreakerAction;
379380
import org.elasticsearch.rest.action.cat.RestCatComponentTemplateAction;
380381
import org.elasticsearch.rest.action.cat.RestCatRecoveryAction;
381382
import org.elasticsearch.rest.action.cat.RestFielddataAction;
@@ -1028,6 +1029,7 @@ public void initRestHandlers(Supplier<DiscoveryNodes> nodesInCluster, Predicate<
10281029
registerHandler.accept(new org.elasticsearch.rest.action.cat.RestPendingClusterTasksAction());
10291030
registerHandler.accept(new RestAliasAction());
10301031
registerHandler.accept(new RestThreadPoolAction());
1032+
registerHandler.accept(new RestCatCircuitBreakerAction());
10311033
registerHandler.accept(new RestPluginsAction());
10321034
registerHandler.accept(new RestFielddataAction());
10331035
registerHandler.accept(new RestNodeAttrsAction());

0 commit comments

Comments
 (0)