Skip to content

Commit 65cb320

Browse files
Merge branch 'main' into ml-proxy-action
2 parents bd7f3d6 + f1b1983 commit 65cb320

File tree

57 files changed

+388
-280
lines changed

Some content is hidden

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

57 files changed

+388
-280
lines changed

docs/changelog/121667.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
pr: 121667
2+
summary: Add deprecation warning for flush API
3+
area: Machine Learning
4+
type: deprecation
5+
issues:
6+
- 121506
7+
deprecation:
8+
title: Add deprecation warning for flush API
9+
area: REST API
10+
details: The anomaly detection job flush API is deprecated since it is only required for the post data API, which was deprecated since 7.11.0.
11+
impact: This should have a minimal impact on users as the flush API is only required for the post data API, which was deprecated since 7.11.0.

docs/changelog/121911.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 121911
2+
summary: Fix ENRICH validation for use of wildcards
3+
area: ES|QL
4+
type: bug
5+
issues: []

muted-tests.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,6 @@ tests:
378378
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
379379
method: test {yaml=reference/cat/health/cat-health-no-timestamp-example}
380380
issue: https://github.com/elastic/elasticsearch/issues/121867
381-
- class: org.elasticsearch.xpack.searchablesnapshots.minio.MinioSearchableSnapshotsIT
382-
issue: https://github.com/elastic/elasticsearch/issues/121882
383381
- class: org.elasticsearch.xpack.searchablesnapshots.FrozenSearchableSnapshotsIntegTests
384382
method: testCreateAndRestorePartialSearchableSnapshot
385383
issue: https://github.com/elastic/elasticsearch/issues/121927
@@ -397,9 +395,12 @@ tests:
397395
issue: https://github.com/elastic/elasticsearch/issues/121966
398396
- class: org.elasticsearch.xpack.searchablesnapshots.hdfs.SecureHdfsSearchableSnapshotsIT
399397
issue: https://github.com/elastic/elasticsearch/issues/121967
400-
- class: org.elasticsearch.xpack.esql.parser.StatementParserTests
401-
method: testInvalidJoinPatterns
402-
issue: https://github.com/elastic/elasticsearch/issues/121968
398+
- class: org.elasticsearch.smoketest.SmokeTestMultiNodeClientYamlTestSuiteIT
399+
method: test {yaml=update/100_synthetic_source/stored text}
400+
issue: https://github.com/elastic/elasticsearch/issues/121991
401+
- class: org.elasticsearch.smoketest.SmokeTestMultiNodeClientYamlTestSuiteIT
402+
method: test {yaml=update/100_synthetic_source/keyword}
403+
issue: https://github.com/elastic/elasticsearch/issues/121992
403404

404405
# Examples:
405406
#

server/src/main/java/org/elasticsearch/TransportVersions.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,17 @@ static TransportVersion def(int id) {
174174
public static final TransportVersion ML_INFERENCE_IBM_WATSONX_RERANK_ADDED = def(8_840_0_00);
175175
public static final TransportVersion COHERE_BIT_EMBEDDING_TYPE_SUPPORT_ADDED_BACKPORT_8_X = def(8_840_0_01);
176176
public static final TransportVersion ELASTICSEARCH_9_0 = def(9_000_0_00);
177+
public static final TransportVersion REMOVE_SNAPSHOT_FAILURES_90 = def(9_000_0_01);
178+
public static final TransportVersion TRANSPORT_STATS_HANDLING_TIME_REQUIRED_90 = def(9_000_0_02);
179+
public static final TransportVersion REMOVE_DESIRED_NODE_VERSION_90 = def(9_000_0_03);
180+
public static final TransportVersion ESQL_DRIVER_TASK_DESCRIPTION_90 = def(9_000_0_04);
177181
public static final TransportVersion COHERE_BIT_EMBEDDING_TYPE_SUPPORT_ADDED = def(9_001_0_00);
178182
public static final TransportVersion REMOVE_SNAPSHOT_FAILURES = def(9_002_0_00);
179183
public static final TransportVersion TRANSPORT_STATS_HANDLING_TIME_REQUIRED = def(9_003_0_00);
180184
public static final TransportVersion REMOVE_DESIRED_NODE_VERSION = def(9_004_0_00);
181185
public static final TransportVersion ESQL_DRIVER_TASK_DESCRIPTION = def(9_005_0_00);
182186
public static final TransportVersion ESQL_RETRY_ON_SHARD_LEVEL_FAILURE = def(9_006_0_00);
187+
public static final TransportVersion ESQL_PROFILE_ASYNC_NANOS = def(9_007_00_0);
183188

184189
/*
185190
* STOP! READ THIS FIRST! No, really,

server/src/main/java/org/elasticsearch/action/admin/cluster/desirednodes/TransportUpdateDesiredNodesAction.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@
2222
import org.elasticsearch.cluster.desirednodes.VersionConflictException;
2323
import org.elasticsearch.cluster.metadata.DesiredNodes;
2424
import org.elasticsearch.cluster.metadata.DesiredNodesMetadata;
25-
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
2625
import org.elasticsearch.cluster.routing.RerouteService;
2726
import org.elasticsearch.cluster.routing.allocation.AllocationService;
2827
import org.elasticsearch.cluster.service.ClusterService;
2928
import org.elasticsearch.cluster.service.MasterServiceTaskQueue;
3029
import org.elasticsearch.common.Priority;
3130
import org.elasticsearch.common.util.concurrent.EsExecutors;
32-
import org.elasticsearch.features.FeatureService;
3331
import org.elasticsearch.injection.guice.Inject;
3432
import org.elasticsearch.tasks.Task;
3533
import org.elasticsearch.threadpool.ThreadPool;
@@ -42,18 +40,15 @@
4240
public class TransportUpdateDesiredNodesAction extends TransportMasterNodeAction<UpdateDesiredNodesRequest, UpdateDesiredNodesResponse> {
4341
private static final Logger logger = LogManager.getLogger(TransportUpdateDesiredNodesAction.class);
4442

45-
private final FeatureService featureService;
4643
private final MasterServiceTaskQueue<UpdateDesiredNodesTask> taskQueue;
4744

4845
@Inject
4946
public TransportUpdateDesiredNodesAction(
5047
TransportService transportService,
5148
ClusterService clusterService,
5249
RerouteService rerouteService,
53-
FeatureService featureService,
5450
ThreadPool threadPool,
5551
ActionFilters actionFilters,
56-
IndexNameExpressionResolver indexNameExpressionResolver,
5752
AllocationService allocationService
5853
) {
5954
super(
@@ -67,7 +62,6 @@ public TransportUpdateDesiredNodesAction(
6762
UpdateDesiredNodesResponse::new,
6863
EsExecutors.DIRECT_EXECUTOR_SERVICE
6964
);
70-
this.featureService = featureService;
7165
this.taskQueue = clusterService.createTaskQueue(
7266
"update-desired-nodes",
7367
Priority.URGENT,

server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponse.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public GetSnapshotsResponse(List<SnapshotInfo> snapshots, @Nullable String next,
4949

5050
public GetSnapshotsResponse(StreamInput in) throws IOException {
5151
this.snapshots = in.readCollectionAsImmutableList(SnapshotInfo::readFrom);
52-
if (in.getTransportVersion().before(TransportVersions.REMOVE_SNAPSHOT_FAILURES)) {
52+
if (in.getTransportVersion().before(TransportVersions.REMOVE_SNAPSHOT_FAILURES)
53+
&& in.getTransportVersion().isPatchFrom(TransportVersions.REMOVE_SNAPSHOT_FAILURES_90) == false) {
5354
// Deprecated `failures` field
5455
in.readMap(StreamInput::readException);
5556
}
@@ -83,7 +84,8 @@ public int remaining() {
8384
@Override
8485
public void writeTo(StreamOutput out) throws IOException {
8586
out.writeCollection(snapshots);
86-
if (out.getTransportVersion().before(TransportVersions.REMOVE_SNAPSHOT_FAILURES)) {
87+
if (out.getTransportVersion().before(TransportVersions.REMOVE_SNAPSHOT_FAILURES)
88+
&& out.getTransportVersion().isPatchFrom(TransportVersions.REMOVE_SNAPSHOT_FAILURES_90) == false) {
8789
// Deprecated `failures` field
8890
out.writeMap(Map.of(), StreamOutput::writeException);
8991
}

server/src/main/java/org/elasticsearch/action/search/AbstractSearchAsyncAction.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -246,32 +246,6 @@ void skipShard(SearchShardIterator iterator) {
246246
successfulShardExecution();
247247
}
248248

249-
private static boolean assertExecuteOnStartThread() {
250-
// Ensure that the current code has the following stacktrace:
251-
// AbstractSearchAsyncAction#start -> AbstractSearchAsyncAction#executePhase -> AbstractSearchAsyncAction#performPhaseOnShard
252-
final StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
253-
assert stackTraceElements.length >= 6 : stackTraceElements;
254-
int index = 0;
255-
assert stackTraceElements[index++].getMethodName().equals("getStackTrace");
256-
assert stackTraceElements[index++].getMethodName().equals("assertExecuteOnStartThread");
257-
assert stackTraceElements[index++].getMethodName().equals("failOnUnavailable");
258-
if (stackTraceElements[index].getMethodName().equals("performPhaseOnShard")) {
259-
assert stackTraceElements[index].getClassName().endsWith("CanMatchPreFilterSearchPhase");
260-
index++;
261-
}
262-
assert stackTraceElements[index].getClassName().endsWith("AbstractSearchAsyncAction");
263-
assert stackTraceElements[index++].getMethodName().equals("run");
264-
265-
assert stackTraceElements[index].getClassName().endsWith("AbstractSearchAsyncAction");
266-
assert stackTraceElements[index++].getMethodName().equals("executePhase");
267-
268-
assert stackTraceElements[index].getClassName().endsWith("AbstractSearchAsyncAction");
269-
assert stackTraceElements[index++].getMethodName().equals("start");
270-
271-
assert stackTraceElements[index].getClassName().endsWith("AbstractSearchAsyncAction") == false;
272-
return true;
273-
}
274-
275249
private void performPhaseOnShard(final int shardIndex, final SearchShardIterator shardIt, final SearchShardTarget shard) {
276250
if (throttleConcurrentRequests) {
277251
var pendingExecutions = pendingExecutionsPerNode.computeIfAbsent(
@@ -313,7 +287,6 @@ public void onFailure(Exception e) {
313287
}
314288

315289
private void failOnUnavailable(int shardIndex, SearchShardIterator shardIt) {
316-
assert assertExecuteOnStartThread();
317290
SearchShardTarget unassignedShard = new SearchShardTarget(null, shardIt.shardId(), shardIt.getClusterAlias());
318291
onShardFailure(shardIndex, unassignedShard, shardIt, new NoShardAvailableActionException(shardIt.shardId()));
319292
}

server/src/main/java/org/elasticsearch/cluster/coordination/NodeJoinExecutor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ private static void blockForbiddenVersions(TransportVersion joiningTransportVers
371371
* that are also present across the whole cluster as a result.
372372
*/
373373
private Set<String> calculateEffectiveClusterFeatures(DiscoveryNodes nodes, Map<String, Set<String>> nodeFeatures) {
374-
if (featureService.featuresCanBeAssumedForNodes(nodes)) {
374+
if (FeatureService.featuresCanBeAssumedForNodes(nodes)) {
375375
Set<String> assumedFeatures = featureService.getNodeFeatures()
376376
.values()
377377
.stream()
@@ -382,7 +382,7 @@ private Set<String> calculateEffectiveClusterFeatures(DiscoveryNodes nodes, Map<
382382
// add all assumed features to the featureset of all nodes of the next major version
383383
nodeFeatures = new HashMap<>(nodeFeatures);
384384
for (var node : nodes.getNodes().entrySet()) {
385-
if (featureService.featuresCanBeAssumedForNode(node.getValue())) {
385+
if (FeatureService.featuresCanBeAssumedForNode(node.getValue())) {
386386
assert nodeFeatures.containsKey(node.getKey()) : "Node " + node.getKey() + " does not have any features";
387387
nodeFeatures.computeIfPresent(node.getKey(), (k, v) -> {
388388
var newFeatures = new HashSet<>(v);
@@ -525,7 +525,7 @@ private Set<String> enforceNodeFeatureBarrier(DiscoveryNode node, Set<String> ef
525525
return newNodeFeatures;
526526
}
527527

528-
if (featureService.featuresCanBeAssumedForNode(node)) {
528+
if (FeatureService.featuresCanBeAssumedForNode(node)) {
529529
// it might still be ok for this node to join if this node can have assumed features,
530530
// and all the missing features are assumed
531531
// we can get the NodeFeature object direct from this node's registered features

server/src/main/java/org/elasticsearch/cluster/metadata/DesiredNode.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ public static DesiredNode readFrom(StreamInput in) throws IOException {
161161
}
162162
final var memory = ByteSizeValue.readFrom(in);
163163
final var storage = ByteSizeValue.readFrom(in);
164-
if (in.getTransportVersion().before(TransportVersions.REMOVE_DESIRED_NODE_VERSION)) {
164+
if (in.getTransportVersion().before(TransportVersions.REMOVE_DESIRED_NODE_VERSION)
165+
&& in.getTransportVersion().isPatchFrom(TransportVersions.REMOVE_DESIRED_NODE_VERSION_90) == false) {
165166
in.readOptionalString();
166167
}
167168
return new DesiredNode(settings, processors, processorsRange, memory, storage);
@@ -180,7 +181,8 @@ public void writeTo(StreamOutput out) throws IOException {
180181
}
181182
memory.writeTo(out);
182183
storage.writeTo(out);
183-
if (out.getTransportVersion().before(TransportVersions.REMOVE_DESIRED_NODE_VERSION)) {
184+
if (out.getTransportVersion().before(TransportVersions.REMOVE_DESIRED_NODE_VERSION)
185+
&& out.getTransportVersion().isPatchFrom(TransportVersions.REMOVE_DESIRED_NODE_VERSION_90) == false) {
184186
out.writeOptionalString(null);
185187
}
186188
}

server/src/main/java/org/elasticsearch/features/FeatureService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ public Map<String, NodeFeature> getNodeFeatures() {
5353
/**
5454
* Returns {@code true} if {@code node} can have assumed features.
5555
*/
56-
public boolean featuresCanBeAssumedForNode(DiscoveryNode node) {
56+
public static boolean featuresCanBeAssumedForNode(DiscoveryNode node) {
5757
return ClusterFeatures.featuresCanBeAssumedForNode(node);
5858
}
5959

6060
/**
6161
* Returns {@code true} if one or more nodes in {@code nodes} can have assumed features.
6262
*/
63-
public boolean featuresCanBeAssumedForNodes(DiscoveryNodes nodes) {
63+
public static boolean featuresCanBeAssumedForNodes(DiscoveryNodes nodes) {
6464
return ClusterFeatures.featuresCanBeAssumedForNodes(nodes);
6565
}
6666

0 commit comments

Comments
 (0)