Skip to content

Commit a79c3b3

Browse files
Merge remote-tracking branch 'elastic/main' into batched-exec-short
2 parents 643c4a2 + 9209341 commit a79c3b3

File tree

55 files changed

+521
-293
lines changed

Some content is hidden

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

55 files changed

+521
-293
lines changed

muted-tests.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,6 @@ tests:
373373
- class: org.elasticsearch.search.CrossClusterSearchUnavailableClusterIT
374374
method: testSearchSkipUnavailable
375375
issue: https://github.com/elastic/elasticsearch/issues/121497
376-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT
377-
method: testStopQueryLocal
378-
issue: https://github.com/elastic/elasticsearch/issues/121672
379376
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
380377
issue: https://github.com/elastic/elasticsearch/issues/121411
381378
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
@@ -386,6 +383,26 @@ tests:
386383
- class: org.elasticsearch.xpack.searchablesnapshots.FrozenSearchableSnapshotsIntegTests
387384
method: testCreateAndRestorePartialSearchableSnapshot
388385
issue: https://github.com/elastic/elasticsearch/issues/121927
386+
- class: org.elasticsearch.analysis.common.CommonAnalysisClientYamlTestSuiteIT
387+
method: test {yaml=analysis-common/40_token_filters/stemmer_override file access}
388+
issue: https://github.com/elastic/elasticsearch/issues/121625
389+
- class: org.elasticsearch.test.rest.ClientYamlTestSuiteIT
390+
method: test {yaml=update/100_synthetic_source/stored text}
391+
issue: https://github.com/elastic/elasticsearch/issues/121964
392+
- class: org.elasticsearch.test.rest.ClientYamlTestSuiteIT
393+
method: test {yaml=update/100_synthetic_source/keyword}
394+
issue: https://github.com/elastic/elasticsearch/issues/121965
395+
- class: org.elasticsearch.xpack.esql.plugin.DataNodeRequestSenderTests
396+
method: testDoNotRetryOnRequestLevelFailure
397+
issue: https://github.com/elastic/elasticsearch/issues/121966
398+
- class: org.elasticsearch.xpack.searchablesnapshots.hdfs.SecureHdfsSearchableSnapshotsIT
399+
issue: https://github.com/elastic/elasticsearch/issues/121967
400+
- class: org.elasticsearch.smoketest.SmokeTestMultiNodeClientYamlTestSuiteIT
401+
method: test {yaml=update/100_synthetic_source/stored text}
402+
issue: https://github.com/elastic/elasticsearch/issues/121991
403+
- class: org.elasticsearch.smoketest.SmokeTestMultiNodeClientYamlTestSuiteIT
404+
method: test {yaml=update/100_synthetic_source/keyword}
405+
issue: https://github.com/elastic/elasticsearch/issues/121992
389406

390407
# Examples:
391408
#

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,18 @@ 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);
183-
public static final TransportVersion BATCHED_QUERY_PHASE_VERSION = def(9_007_0_00);
187+
public static final TransportVersion ESQL_PROFILE_ASYNC_NANOS = def(9_007_00_0);
188+
public static final TransportVersion BATCHED_QUERY_PHASE_VERSION = def(9_008_0_00);
184189

185190
/*
186191
* 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

server/src/main/java/org/elasticsearch/health/metadata/HealthMetadataService.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.elasticsearch.common.settings.Settings;
2727
import org.elasticsearch.core.Nullable;
2828
import org.elasticsearch.core.Tuple;
29-
import org.elasticsearch.features.FeatureService;
3029
import org.elasticsearch.gateway.GatewayService;
3130

3231
import java.util.List;
@@ -50,7 +49,6 @@ public class HealthMetadataService {
5049
private static final Logger logger = LogManager.getLogger(HealthMetadataService.class);
5150

5251
private final ClusterService clusterService;
53-
private final FeatureService featureService;
5452
private final ClusterStateListener clusterStateListener;
5553
private final MasterServiceTaskQueue<UpsertHealthMetadataTask> taskQueue;
5654
private volatile boolean enabled;
@@ -64,17 +62,16 @@ public class HealthMetadataService {
6462
// ClusterState to maintain an up-to-date version of it across the cluster.
6563
private volatile HealthMetadata localHealthMetadata;
6664

67-
private HealthMetadataService(ClusterService clusterService, FeatureService featureService, Settings settings) {
65+
private HealthMetadataService(ClusterService clusterService, Settings settings) {
6866
this.clusterService = clusterService;
69-
this.featureService = featureService;
7067
this.clusterStateListener = this::updateOnClusterStateChange;
7168
this.enabled = ENABLED_SETTING.get(settings);
7269
this.localHealthMetadata = initialHealthMetadata(settings);
7370
this.taskQueue = clusterService.createTaskQueue("health metadata service", Priority.NORMAL, new Executor());
7471
}
7572

76-
public static HealthMetadataService create(ClusterService clusterService, FeatureService featureService, Settings settings) {
77-
HealthMetadataService healthMetadataService = new HealthMetadataService(clusterService, featureService, settings);
73+
public static HealthMetadataService create(ClusterService clusterService, Settings settings) {
74+
HealthMetadataService healthMetadataService = new HealthMetadataService(clusterService, settings);
7875
healthMetadataService.registerListeners();
7976
return healthMetadataService;
8077
}

server/src/main/java/org/elasticsearch/health/node/DiskHealthIndicatorService.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.elasticsearch.cluster.routing.RoutingNodes;
1919
import org.elasticsearch.cluster.service.ClusterService;
2020
import org.elasticsearch.common.util.set.Sets;
21-
import org.elasticsearch.features.FeatureService;
2221
import org.elasticsearch.health.Diagnosis;
2322
import org.elasticsearch.health.HealthIndicatorDetails;
2423
import org.elasticsearch.health.HealthIndicatorImpact;
@@ -73,11 +72,9 @@ public class DiskHealthIndicatorService implements HealthIndicatorService {
7372
private static final String IMPACT_CLUSTER_FUNCTIONALITY_UNAVAILABLE_ID = "cluster_functionality_unavailable";
7473

7574
private final ClusterService clusterService;
76-
private final FeatureService featureService;
7775

78-
public DiskHealthIndicatorService(ClusterService clusterService, FeatureService featureService) {
76+
public DiskHealthIndicatorService(ClusterService clusterService) {
7977
this.clusterService = clusterService;
80-
this.featureService = featureService;
8178
}
8279

8380
@Override

0 commit comments

Comments
 (0)