Skip to content

Commit a14ea32

Browse files
authored
Merge branch 'main' into main
2 parents c211583 + 7bea3a5 commit a14ea32

File tree

233 files changed

+6199
-3435
lines changed

Some content is hidden

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

233 files changed

+6199
-3435
lines changed

benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/AggregatorBenchmark.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ private static Operator operator(DriverContext driverContext, String grouping, S
155155

156156
if (grouping.equals("none")) {
157157
return new AggregationOperator(
158-
List.of(supplier(op, dataType, filter, 0).aggregatorFactory(AggregatorMode.SINGLE).apply(driverContext)),
158+
List.of(supplier(op, dataType, filter).aggregatorFactory(AggregatorMode.SINGLE, List.of(0)).apply(driverContext)),
159159
driverContext
160160
);
161161
}
@@ -182,33 +182,33 @@ private static Operator operator(DriverContext driverContext, String grouping, S
182182
default -> throw new IllegalArgumentException("unsupported grouping [" + grouping + "]");
183183
};
184184
return new HashAggregationOperator(
185-
List.of(supplier(op, dataType, filter, groups.size()).groupingAggregatorFactory(AggregatorMode.SINGLE)),
185+
List.of(supplier(op, dataType, filter).groupingAggregatorFactory(AggregatorMode.SINGLE, List.of(groups.size()))),
186186
() -> BlockHash.build(groups, driverContext.blockFactory(), 16 * 1024, false),
187187
driverContext
188188
);
189189
}
190190

191-
private static AggregatorFunctionSupplier supplier(String op, String dataType, String filter, int dataChannel) {
191+
private static AggregatorFunctionSupplier supplier(String op, String dataType, String filter) {
192192
return filtered(switch (op) {
193-
case COUNT -> CountAggregatorFunction.supplier(List.of(dataChannel));
193+
case COUNT -> CountAggregatorFunction.supplier();
194194
case COUNT_DISTINCT -> switch (dataType) {
195-
case LONGS -> new CountDistinctLongAggregatorFunctionSupplier(List.of(dataChannel), 3000);
196-
case DOUBLES -> new CountDistinctDoubleAggregatorFunctionSupplier(List.of(dataChannel), 3000);
195+
case LONGS -> new CountDistinctLongAggregatorFunctionSupplier(3000);
196+
case DOUBLES -> new CountDistinctDoubleAggregatorFunctionSupplier(3000);
197197
default -> throw new IllegalArgumentException("unsupported data type [" + dataType + "]");
198198
};
199199
case MAX -> switch (dataType) {
200-
case LONGS -> new MaxLongAggregatorFunctionSupplier(List.of(dataChannel));
201-
case DOUBLES -> new MaxDoubleAggregatorFunctionSupplier(List.of(dataChannel));
200+
case LONGS -> new MaxLongAggregatorFunctionSupplier();
201+
case DOUBLES -> new MaxDoubleAggregatorFunctionSupplier();
202202
default -> throw new IllegalArgumentException("unsupported data type [" + dataType + "]");
203203
};
204204
case MIN -> switch (dataType) {
205-
case LONGS -> new MinLongAggregatorFunctionSupplier(List.of(dataChannel));
206-
case DOUBLES -> new MinDoubleAggregatorFunctionSupplier(List.of(dataChannel));
205+
case LONGS -> new MinLongAggregatorFunctionSupplier();
206+
case DOUBLES -> new MinDoubleAggregatorFunctionSupplier();
207207
default -> throw new IllegalArgumentException("unsupported data type [" + dataType + "]");
208208
};
209209
case SUM -> switch (dataType) {
210-
case LONGS -> new SumLongAggregatorFunctionSupplier(List.of(dataChannel));
211-
case DOUBLES -> new SumDoubleAggregatorFunctionSupplier(List.of(dataChannel));
210+
case LONGS -> new SumLongAggregatorFunctionSupplier();
211+
case DOUBLES -> new SumDoubleAggregatorFunctionSupplier();
212212
default -> throw new IllegalArgumentException("unsupported data type [" + dataType + "]");
213213
};
214214
default -> throw new IllegalArgumentException("unsupported op [" + op + "]");

docs/changelog/120998.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120998
2+
summary: ES|QL `change_point` processing command
3+
area: Machine Learning
4+
type: feature
5+
issues: []

docs/changelog/121731.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
pr: 121731
2+
summary: Remove TLSv1.1 from default protocols
3+
area: TLS
4+
type: breaking
5+
issues: []
6+
breaking:
7+
title: Remove TLSv1.1 from default protocols
8+
area: Cluster and node setting
9+
details: "TLSv1.1 is no longer enabled by default. Prior to version 9.0, Elasticsearch\
10+
\ would attempt to enable TLSv1.1 if the JDK supported it. In most cases, including\
11+
\ all cases where Elasticsearch 8 was running with the bundled JDK, the JDK would\
12+
\ not support TLSv1.1, so that protocol would not be available in Elasticsearch.\
13+
\ However, if Elasticsearch was running on an old JDK or a JDK that have been\
14+
\ reconfigured to support TLSv1.1, then the protocol would automatically be available\
15+
\ within Elasticsearch. As of Elasticsearch 9.0, this is no longer true. If you\
16+
\ wish to enable TLSv1.1 then you must enable it within the JDK and also enable\
17+
\ it within Elasticsearch by using the `ssl.supported_protocols` setting."
18+
impact: "Most users will not be impacted. If your Elastisearch 8 cluster was using\
19+
\ a custom JDK and you relied on TLSv1.1, then you will need to explicitly enable\
20+
\ TLSv1.1 within Elasticsearch (as well as enabling it within your JDK)"
21+
notable: false

libs/ssl-config/src/main/java/org/elasticsearch/common/ssl/SslConfigurationLoader.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
import java.nio.file.Path;
1515
import java.security.KeyStore;
16-
import java.util.Arrays;
17-
import java.util.Collections;
1816
import java.util.List;
1917
import java.util.Objects;
2018
import java.util.Set;
@@ -25,7 +23,6 @@
2523
import javax.net.ssl.TrustManagerFactory;
2624

2725
import static org.elasticsearch.common.ssl.KeyStoreUtil.inferKeyStoreType;
28-
import static org.elasticsearch.common.ssl.SslConfiguration.ORDERED_PROTOCOL_ALGORITHM_MAP;
2926
import static org.elasticsearch.common.ssl.SslConfigurationKeys.CERTIFICATE;
3027
import static org.elasticsearch.common.ssl.SslConfigurationKeys.CERTIFICATE_AUTHORITIES;
3128
import static org.elasticsearch.common.ssl.SslConfigurationKeys.CIPHERS;
@@ -63,11 +60,7 @@
6360
*/
6461
public abstract class SslConfigurationLoader {
6562

66-
static final List<String> DEFAULT_PROTOCOLS = Collections.unmodifiableList(
67-
ORDERED_PROTOCOL_ALGORITHM_MAP.containsKey("TLSv1.3")
68-
? Arrays.asList("TLSv1.3", "TLSv1.2", "TLSv1.1")
69-
: Arrays.asList("TLSv1.2", "TLSv1.1")
70-
);
63+
static final List<String> DEFAULT_PROTOCOLS = List.of("TLSv1.3", "TLSv1.2");
7164

7265
private static final List<String> JDK12_CIPHERS = List.of(
7366
// TLSv1.3 cipher has PFS, AEAD, hardware support

muted-tests.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -379,18 +379,9 @@ tests:
379379
issue: https://github.com/elastic/elasticsearch/issues/121537
380380
- class: org.elasticsearch.xpack.migrate.action.ReindexDatastreamIndexTransportActionIT
381381
issue: https://github.com/elastic/elasticsearch/issues/121737
382-
- class: org.elasticsearch.xpack.downsample.DataStreamLifecycleDownsampleDisruptionIT
383-
method: testDataStreamLifecycleDownsampleRollingRestart
384-
issue: https://github.com/elastic/elasticsearch/issues/122056
385382
- class: org.elasticsearch.xpack.restart.FullClusterRestartIT
386383
method: testWatcherWithApiKey {cluster=UPGRADED}
387384
issue: https://github.com/elastic/elasticsearch/issues/122061
388-
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
389-
method: test {yaml=update/100_synthetic_source/stored text}
390-
issue: https://github.com/elastic/elasticsearch/issues/122100
391-
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
392-
method: test {yaml=update/100_synthetic_source/keyword}
393-
issue: https://github.com/elastic/elasticsearch/issues/122101
394385
- class: org.elasticsearch.test.rest.ClientYamlTestSuiteIT
395386
method: test {yaml=snapshot.delete/10_basic/Delete a snapshot asynchronously}
396387
issue: https://github.com/elastic/elasticsearch/issues/122102
@@ -400,25 +391,25 @@ tests:
400391
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
401392
method: test {yaml=snapshot.delete/10_basic/Delete a snapshot asynchronously}
402393
issue: https://github.com/elastic/elasticsearch/issues/122104
403-
- class: org.elasticsearch.datastreams.TSDBPassthroughIndexingIT
404-
issue: https://github.com/elastic/elasticsearch/issues/121716
405394
- class: org.elasticsearch.xpack.ml.integration.ClassificationIT
406395
method: testWithOnlyTrainingRowsAndTrainingPercentIsFifty_DependentVariableIsBoolean
407396
issue: https://github.com/elastic/elasticsearch/issues/121680
408397
- class: org.elasticsearch.xpack.esql.action.EsqlActionBreakerIT
409-
method: testExtractFields
410-
issue: https://github.com/elastic/elasticsearch/issues/122125
411-
- class: org.elasticsearch.xpack.esql.action.EsqlActionBreakerIT
412-
method: testIndexPatterns
413-
issue: https://github.com/elastic/elasticsearch/issues/122128
398+
issue: https://github.com/elastic/elasticsearch/issues/122153
414399
- class: org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT
415400
issue: https://github.com/elastic/elasticsearch/issues/121411
416-
- class: org.elasticsearch.xpack.esql.action.EsqlActionBreakerIT
417-
method: testGroupingMultiValueByOrdinals
418-
issue: https://github.com/elastic/elasticsearch/issues/122131
419401
- class: org.elasticsearch.xpack.esql.action.EsqlNodeFailureIT
420402
method: testFailureLoadingFields
421403
issue: https://github.com/elastic/elasticsearch/issues/122132
404+
- class: org.elasticsearch.xpack.esql.action.CrossClustersCancellationIT
405+
method: testCloseSkipUnavailable
406+
issue: https://github.com/elastic/elasticsearch/issues/121627
407+
- class: org.elasticsearch.xpack.downsample.DownsampleActionSingleNodeTests
408+
method: testDuplicateDownsampleRequest
409+
issue: https://github.com/elastic/elasticsearch/issues/122158
410+
- class: org.elasticsearch.search.SearchCancellationIT
411+
method: testCancelFailedSearchWhenPartialResultDisallowed
412+
issue: https://github.com/elastic/elasticsearch/issues/121719
422413

423414
# Examples:
424415
#

qa/smoke-test-http/src/javaRestTest/java/org/elasticsearch/http/SearchErrorTraceIT.java

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,26 @@
1111

1212
import org.apache.http.entity.ContentType;
1313
import org.apache.http.nio.entity.NByteArrayEntity;
14-
import org.elasticsearch.ExceptionsHelper;
1514
import org.elasticsearch.action.search.MultiSearchRequest;
1615
import org.elasticsearch.action.search.SearchRequest;
1716
import org.elasticsearch.client.Request;
17+
import org.elasticsearch.search.ErrorTraceHelper;
1818
import org.elasticsearch.search.builder.SearchSourceBuilder;
19-
import org.elasticsearch.transport.TransportMessageListener;
20-
import org.elasticsearch.transport.TransportService;
2119
import org.elasticsearch.xcontent.XContentType;
2220
import org.junit.Before;
2321

2422
import java.io.IOException;
2523
import java.nio.charset.Charset;
26-
import java.util.Optional;
27-
import java.util.concurrent.atomic.AtomicBoolean;
24+
import java.util.function.BooleanSupplier;
2825

2926
import static org.elasticsearch.index.query.QueryBuilders.simpleQueryStringQuery;
3027

3128
public class SearchErrorTraceIT extends HttpSmokeTestCase {
32-
private AtomicBoolean hasStackTrace;
29+
private BooleanSupplier hasStackTrace;
3330

3431
@Before
35-
private void setupMessageListener() {
36-
internalCluster().getDataNodeInstances(TransportService.class).forEach(ts -> {
37-
ts.addMessageListener(new TransportMessageListener() {
38-
@Override
39-
public void onResponseSent(long requestId, String action, Exception error) {
40-
TransportMessageListener.super.onResponseSent(requestId, action, error);
41-
if (action.startsWith("indices:data/read/search")) {
42-
Optional<Throwable> throwable = ExceptionsHelper.unwrapCausesAndSuppressed(
43-
error,
44-
t -> t.getStackTrace().length > 0
45-
);
46-
hasStackTrace.set(throwable.isPresent());
47-
}
48-
}
49-
});
50-
});
32+
public void setupMessageListener() {
33+
hasStackTrace = ErrorTraceHelper.setupErrorTraceListener(internalCluster());
5134
}
5235

5336
private void setupIndexWithDocs() {
@@ -61,7 +44,6 @@ private void setupIndexWithDocs() {
6144
}
6245

6346
public void testSearchFailingQueryErrorTraceDefault() throws IOException {
64-
hasStackTrace = new AtomicBoolean();
6547
setupIndexWithDocs();
6648

6749
Request searchRequest = new Request("POST", "/_search");
@@ -76,11 +58,10 @@ public void testSearchFailingQueryErrorTraceDefault() throws IOException {
7658
}
7759
""");
7860
getRestClient().performRequest(searchRequest);
79-
assertFalse(hasStackTrace.get());
61+
assertFalse(hasStackTrace.getAsBoolean());
8062
}
8163

8264
public void testSearchFailingQueryErrorTraceTrue() throws IOException {
83-
hasStackTrace = new AtomicBoolean();
8465
setupIndexWithDocs();
8566

8667
Request searchRequest = new Request("POST", "/_search");
@@ -96,11 +77,10 @@ public void testSearchFailingQueryErrorTraceTrue() throws IOException {
9677
""");
9778
searchRequest.addParameter("error_trace", "true");
9879
getRestClient().performRequest(searchRequest);
99-
assertTrue(hasStackTrace.get());
80+
assertTrue(hasStackTrace.getAsBoolean());
10081
}
10182

10283
public void testSearchFailingQueryErrorTraceFalse() throws IOException {
103-
hasStackTrace = new AtomicBoolean();
10484
setupIndexWithDocs();
10585

10686
Request searchRequest = new Request("POST", "/_search");
@@ -116,11 +96,10 @@ public void testSearchFailingQueryErrorTraceFalse() throws IOException {
11696
""");
11797
searchRequest.addParameter("error_trace", "false");
11898
getRestClient().performRequest(searchRequest);
119-
assertFalse(hasStackTrace.get());
99+
assertFalse(hasStackTrace.getAsBoolean());
120100
}
121101

122102
public void testMultiSearchFailingQueryErrorTraceDefault() throws IOException {
123-
hasStackTrace = new AtomicBoolean();
124103
setupIndexWithDocs();
125104

126105
XContentType contentType = XContentType.JSON;
@@ -133,11 +112,10 @@ public void testMultiSearchFailingQueryErrorTraceDefault() throws IOException {
133112
new NByteArrayEntity(requestBody, ContentType.create(contentType.mediaTypeWithoutParameters(), (Charset) null))
134113
);
135114
getRestClient().performRequest(searchRequest);
136-
assertFalse(hasStackTrace.get());
115+
assertFalse(hasStackTrace.getAsBoolean());
137116
}
138117

139118
public void testMultiSearchFailingQueryErrorTraceTrue() throws IOException {
140-
hasStackTrace = new AtomicBoolean();
141119
setupIndexWithDocs();
142120

143121
XContentType contentType = XContentType.JSON;
@@ -151,11 +129,10 @@ public void testMultiSearchFailingQueryErrorTraceTrue() throws IOException {
151129
);
152130
searchRequest.addParameter("error_trace", "true");
153131
getRestClient().performRequest(searchRequest);
154-
assertTrue(hasStackTrace.get());
132+
assertTrue(hasStackTrace.getAsBoolean());
155133
}
156134

157135
public void testMultiSearchFailingQueryErrorTraceFalse() throws IOException {
158-
hasStackTrace = new AtomicBoolean();
159136
setupIndexWithDocs();
160137

161138
XContentType contentType = XContentType.JSON;
@@ -170,6 +147,6 @@ public void testMultiSearchFailingQueryErrorTraceFalse() throws IOException {
170147
searchRequest.addParameter("error_trace", "false");
171148
getRestClient().performRequest(searchRequest);
172149

173-
assertFalse(hasStackTrace.get());
150+
assertFalse(hasStackTrace.getAsBoolean());
174151
}
175152
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.search;
11+
12+
import org.elasticsearch.ExceptionsHelper;
13+
import org.elasticsearch.test.InternalTestCluster;
14+
import org.elasticsearch.transport.TransportMessageListener;
15+
import org.elasticsearch.transport.TransportService;
16+
17+
import java.util.Optional;
18+
import java.util.concurrent.atomic.AtomicBoolean;
19+
import java.util.function.BooleanSupplier;
20+
21+
/**
22+
* Utilities around testing the `error_trace` message header in search.
23+
*/
24+
public enum ErrorTraceHelper {
25+
;
26+
27+
public static BooleanSupplier setupErrorTraceListener(InternalTestCluster internalCluster) {
28+
final AtomicBoolean transportMessageHasStackTrace = new AtomicBoolean(false);
29+
internalCluster.getDataNodeInstances(TransportService.class).forEach(ts -> ts.addMessageListener(new TransportMessageListener() {
30+
@Override
31+
public void onResponseSent(long requestId, String action, Exception error) {
32+
TransportMessageListener.super.onResponseSent(requestId, action, error);
33+
if (action.startsWith("indices:data/read/search")) {
34+
Optional<Throwable> throwable = ExceptionsHelper.unwrapCausesAndSuppressed(error, t -> t.getStackTrace().length > 0);
35+
transportMessageHasStackTrace.set(throwable.isPresent());
36+
}
37+
}
38+
}));
39+
return transportMessageHasStackTrace::get;
40+
}
41+
}

0 commit comments

Comments
 (0)