Skip to content

Commit 9000571

Browse files
authored
Merge branch 'main' into fix/fetch-phase-breaker-lifecycle
2 parents fe581ad + 3d0a647 commit 9000571

File tree

67 files changed

+1377
-598
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1377
-598
lines changed

docs/changelog/138139.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,21 @@ summary: Support window function in time-series aggregations
33
area: ES|QL
44
type: enhancement
55
issues: []
6+
highlight:
7+
title: Evaluate time series aggregation functions over sliding windows
8+
body: |-
9+
Time series aggregations in ES|QL can be optionally calculated over a sliding time window. Using a window
10+
larger than the time bucket interval reduces jitter in dashboards, by taking a larger number of data points into
11+
account.
12+
13+
Windows can be specified in all supported time series aggregations, as a second argument. For instance, the
14+
following ES|QL query calculates the average rate of requests per host every minute, using a 10-minute window:
15+
16+
TS metrics
17+
| WHERE TRANGE(1h)
18+
| STATS avg(rate(requests, 10m)) BY TBUCKET(1m), host
19+
20+
Acceptable window values are currently limited to multiples of the time bucket value (e.g. `BUCKET` or `TBUCKET`),
21+
as specified in the BY-clause. If no window is provided, it's implicitly set to the time bucket value,
22+
matching existing behavior.
23+
notable: true

docs/changelog/138583.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138583
2+
summary: "Fix: Correctly pickup MRT value for `msearch`'s search requests"
3+
area: CCS
4+
type: bug
5+
issues: []

docs/changelog/139460.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 139460
2+
summary: "Fix: IPv6 address parsing with non-zero offset in `InetAddresses`"
3+
area: Mapping
4+
type: bug
5+
issues: []

docs/release-notes/breaking-changes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ If you are migrating from a version prior to version 9.0, you must first upgrade
1212

1313
% ## Next version [elasticsearch-nextversion-breaking-changes]
1414

15+
## 9.1.9 [elasticsearch-9.1.9-breaking-changes]
16+
```{applies_to}
17+
stack: ga 9.1.9
18+
```
19+
20+
There are no breaking changes associated with this release.
1521

1622
## 9.2.2 [elasticsearch-9.2.2-breaking-changes]
1723

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
version: 9.1.9
2+
released: false
3+
generated: 2025-12-13T00:13:16.356358962Z
4+
changelogs:
5+
- pr: 137558
6+
summary: Improve security migration resilience by handling version conflicts
7+
area: Security
8+
type: enhancement
9+
issues: []
10+
- pr: 138115
11+
summary: GET /_migration/deprecations doesn't check disk watermarks against correct settings values
12+
area: Infra/Core
13+
type: bug
14+
issues:
15+
- 137005
16+
- pr: 138624
17+
summary: Handle individual doc parsing failure in bulk request with pipeline
18+
area: Ingest Node
19+
type: bug
20+
issues:
21+
- 138445
22+
- pr: 138632
23+
summary: Correctly handle empty inputs in `chunkedInfer()`
24+
area: Machine Learning
25+
type: bug
26+
issues: []
27+
- pr: 138806
28+
summary: Bump lz4 dependency
29+
area: Infra/Core
30+
type: upgrade
31+
issues: []
32+
- pr: 138854
33+
summary: Upgrade ECS logging layout
34+
area: Infra/Logging
35+
type: upgrade
36+
issues: []
37+
- pr: 138869
38+
summary: Fix multi fields in downsampling
39+
area: Downsampling
40+
type: bug
41+
issues: []
42+
- pr: 139028
43+
summary: More reliable trigger for security index migration
44+
area: Security
45+
type: bug
46+
issues: []
47+
- pr: 139080
48+
summary: "[ES|QL] Compare query builders using identity"
49+
area: ES|QL
50+
type: bug
51+
issues: []

docs/release-notes/deprecations.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ To give you insight into what deprecated features you’re using, {{es}}:
1616

1717
% ## Next version [elasticsearch-nextversion-deprecations]
1818

19+
## 9.1.9 [elasticsearch-9.1.9-deprecations]
20+
```{applies_to}
21+
stack: ga 9.1.9
22+
```
23+
24+
There are no deprecations associated with this release.
1925

2026
## 9.2.2 [elasticsearch-9.2.2-deprecations]
2127

docs/release-notes/index.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,45 @@ To check for security updates, go to [Security announcements for the Elastic sta
2020
% ### Fixes [elasticsearch-next-fixes]
2121
% *
2222

23+
## 9.1.9 [elasticsearch-9.1.9-release-notes]
24+
```{applies_to}
25+
stack: ga 9.1.9
26+
```
27+
28+
### Features and enhancements [elasticsearch-9.1.9-features-enhancements]
29+
30+
Infra/Core:
31+
* Bump lz4 dependency [#138806](https://github.com/elastic/elasticsearch/pull/138806)
32+
33+
Infra/Logging:
34+
* Upgrade ECS logging layout [#138854](https://github.com/elastic/elasticsearch/pull/138854)
35+
36+
Security:
37+
* Improve security migration resilience by handling version conflicts [#137558](https://github.com/elastic/elasticsearch/pull/137558)
38+
39+
40+
### Fixes [elasticsearch-9.1.9-fixes]
41+
42+
Downsampling:
43+
* Fix multi fields in downsampling [#138869](https://github.com/elastic/elasticsearch/pull/138869)
44+
45+
ES|QL:
46+
* [ES|QL] Compare query builders using identity [#139080](https://github.com/elastic/elasticsearch/pull/139080)
47+
48+
Infra/Core:
49+
* GET /_migration/deprecations doesn't check disk watermarks against correct settings values [#138115](https://github.com/elastic/elasticsearch/pull/138115) (issue: [#137005](https://github.com/elastic/elasticsearch/issues/137005))
50+
51+
Ingest Node:
52+
* Handle individual doc parsing failure in bulk request with pipeline [#138624](https://github.com/elastic/elasticsearch/pull/138624) (issue: [#138445](https://github.com/elastic/elasticsearch/issues/138445))
53+
54+
Machine Learning:
55+
* Correctly handle empty inputs in `chunkedInfer()` [#138632](https://github.com/elastic/elasticsearch/pull/138632)
56+
57+
Security:
58+
* More reliable trigger for security index migration [#139028](https://github.com/elastic/elasticsearch/pull/139028)
59+
60+
61+
2362
## 9.2.2 [elasticsearch-9.2.2-release-notes]
2463

2564
### Features and enhancements [elasticsearch-9.2.2-features-enhancements]
@@ -114,6 +153,8 @@ Vector Search:
114153
* Update to Lucene 10.3.2 [#138230](https://github.com/elastic/elasticsearch/pull/138230) (issue: [#135718](https://github.com/elastic/elasticsearch/issues/135718))
115154
* [Vector Search] Fix wrong vector docvalue_fields [#137862](https://github.com/elastic/elasticsearch/pull/137862)
116155

156+
157+
117158
## 9.1.8 [elasticsearch-9.1.8-release-notes]
118159

119160
### Features and enhancements [elasticsearch-9.1.8-features-enhancements]

server/src/internalClusterTest/java/org/elasticsearch/search/msearch/MultiSearchIT.java

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,24 @@
1212
import org.elasticsearch.TransportVersion;
1313
import org.elasticsearch.action.search.MultiSearchRequest;
1414
import org.elasticsearch.action.search.MultiSearchResponse.Item;
15+
import org.elasticsearch.action.search.SearchRequest;
16+
import org.elasticsearch.common.bytes.BytesArray;
1517
import org.elasticsearch.common.settings.Settings;
1618
import org.elasticsearch.index.query.QueryBuilders;
19+
import org.elasticsearch.rest.RestRequest;
20+
import org.elasticsearch.rest.action.search.RestMultiSearchAction;
1721
import org.elasticsearch.search.DummyQueryBuilder;
1822
import org.elasticsearch.search.SearchService;
1923
import org.elasticsearch.test.ESIntegTestCase;
2024
import org.elasticsearch.test.TransportVersionUtils;
25+
import org.elasticsearch.test.rest.FakeRestRequest;
26+
import org.elasticsearch.usage.UsageService;
2127
import org.elasticsearch.xcontent.XContentType;
28+
import org.hamcrest.Matchers;
29+
30+
import java.io.IOException;
31+
import java.util.Map;
32+
import java.util.Optional;
2233

2334
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFirstHit;
2435
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
@@ -119,4 +130,90 @@ public TransportVersion getMinimalSupportedVersion() {
119130
}
120131
);
121132
}
133+
134+
public void testMrtValuesArePickedCorrectly() throws IOException {
135+
136+
{
137+
// If no MRT is specified, all searches should default to true.
138+
String body = """
139+
{"index": "index-1" }
140+
{"query" : {"match" : { "message": "this is a test"}}}
141+
{"index": "index-2" }
142+
{"query" : {"match_all" : {}}}
143+
""";
144+
145+
MultiSearchRequest mreq = parseRequest(body, Map.of());
146+
for (SearchRequest req : mreq.requests()) {
147+
assertTrue(req.isCcsMinimizeRoundtrips());
148+
}
149+
}
150+
151+
{
152+
// MRT query param is false, so all searches should use this value.
153+
String body = """
154+
{"index": "index-1" }
155+
{"query" : {"match" : { "message": "this is a test"}}}
156+
{"index": "index-2" }
157+
{"query" : {"match_all" : {}}}
158+
""";
159+
160+
MultiSearchRequest mreq = parseRequest(body, Map.of("ccs_minimize_roundtrips", "false"));
161+
for (SearchRequest req : mreq.requests()) {
162+
assertFalse(req.isCcsMinimizeRoundtrips());
163+
}
164+
}
165+
166+
{
167+
// Query param is absent but MRT is specified for each request.
168+
String body = """
169+
{"index": "index-1", "ccs_minimize_roundtrips": false }
170+
{"query" : {"match" : { "message": "this is a test"}}}
171+
{"index": "index-2", "ccs_minimize_roundtrips": false }
172+
{"query" : {"match_all" : {}}}
173+
""";
174+
175+
MultiSearchRequest mreq = parseRequest(body, Map.of());
176+
for (SearchRequest req : mreq.requests()) {
177+
assertFalse(req.isCcsMinimizeRoundtrips());
178+
}
179+
}
180+
181+
{
182+
/*
183+
* The first request overrides the query param and should use MRT=true.
184+
* The second request should use the query param value.
185+
*/
186+
String body = """
187+
{"index": "index-1", "ccs_minimize_roundtrips": true }
188+
{"query" : {"match" : { "message": "this is a test"}}}
189+
{"index": "index-2" }
190+
{"query" : {"match_all" : {}}}
191+
""";
192+
193+
MultiSearchRequest mreq = parseRequest(body, Map.of("ccs_minimize_roundtrips", "false"));
194+
195+
assertThat(mreq.requests().size(), Matchers.is(2));
196+
assertTrue(mreq.requests().getFirst().isCcsMinimizeRoundtrips());
197+
assertFalse(mreq.requests().getLast().isCcsMinimizeRoundtrips());
198+
}
199+
}
200+
201+
private RestRequest mkRequest(String body, Map<String, String> params) {
202+
return new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.POST)
203+
.withPath("/index*/_msearch")
204+
.withParams(params)
205+
.withContent(new BytesArray(body), XContentType.JSON)
206+
.build();
207+
}
208+
209+
private MultiSearchRequest parseRequest(String body, Map<String, String> params) throws IOException {
210+
return RestMultiSearchAction.parseRequest(
211+
mkRequest(body, params),
212+
true,
213+
new UsageService().getSearchUsageHolder(),
214+
(ignored) -> true,
215+
// Disable CPS for these tests.
216+
Optional.of(false)
217+
);
218+
}
122219
}

server/src/main/java/org/elasticsearch/common/network/InetAddresses.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,14 @@ private static byte[] textToNumericFormatV6(byte[] ipUtf8, int offset, int lengt
206206
// Find position of :: abbreviation if present
207207
int compressedHextetIndex = -1;
208208
int hextetIndex = 0;
209-
int currentHextetStart = 0;
209+
int currentHextetStart = offset;
210210
int currentHextet = 0;
211211
for (int i = offset; i < offset + length; i++) {
212212
byte c = ipUtf8[i];
213213
if (c == ':') {
214214
if (currentHextetStart == i) {
215215
// Two colons in a row, indicating a compressed section
216-
if (compressedHextetIndex >= 0 && i != 1) {
216+
if (compressedHextetIndex >= 0 && i != offset + 1) {
217217
// We've already seen a ::, can't have another
218218
return null;
219219
}

server/src/main/java/org/elasticsearch/index/fielddata/IndexNumericFieldData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public SortField sortField(
197197
return rewrittenSortField;
198198
}
199199

200-
SortField rewrittenSortField = new SortField(sortField.getField(), SortField.Type.LONG, reverse);
200+
SortField rewrittenSortField = new SortedNumericSortField(sortField.getField(), SortField.Type.LONG, reverse);
201201
rewrittenSortField.setMissingValue(longSource.missingObject(missingValue, reverse));
202202
// we don't optimize sorting on int field for old indices
203203
rewrittenSortField.setOptimizeSortWithPoints(false);

0 commit comments

Comments
 (0)