Skip to content

Commit 94613cc

Browse files
authored
Merge branch 'main' into ES-10641_add_leak_detection_to_store
2 parents 9521d7e + feba92d commit 94613cc

File tree

4 files changed

+25
-10
lines changed

4 files changed

+25
-10
lines changed

muted-tests.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ tests:
125125
- class: org.elasticsearch.xpack.ml.integration.RegressionIT
126126
method: testTwoJobsWithSameRandomizeSeedUseSameTrainingSet
127127
issue: https://github.com/elastic/elasticsearch/issues/117805
128-
- class: org.elasticsearch.xpack.esql.action.EsqlActionTaskIT
129-
method: testCancelRequestWhenFailingFetchingPages
130-
issue: https://github.com/elastic/elasticsearch/issues/118193
131128
- class: org.elasticsearch.packaging.test.ArchiveTests
132129
method: test44AutoConfigurationNotTriggeredOnNotWriteableConfDir
133130
issue: https://github.com/elastic/elasticsearch/issues/118208
@@ -212,8 +209,6 @@ tests:
212209
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncEnrichStopIT
213210
method: testEnrichAfterStop
214211
issue: https://github.com/elastic/elasticsearch/issues/120757
215-
- class: org.elasticsearch.search.fieldcaps.FieldCapabilitiesIT
216-
issue: https://github.com/elastic/elasticsearch/issues/120772
217212
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
218213
method: test {p0=ml/3rd_party_deployment/Test start deployment fails while model download in progress}
219214
issue: https://github.com/elastic/elasticsearch/issues/120810
@@ -434,6 +429,12 @@ tests:
434429
- class: org.elasticsearch.xpack.esql.action.CrossClusterQueryUnavailableRemotesIT
435430
method: testRemoteOnlyCCSAgainstDisconnectedRemoteWithSkipUnavailableTrue
436431
issue: https://github.com/elastic/elasticsearch/issues/121578
432+
- class: org.elasticsearch.xpack.esql.action.CrossClustersCancellationIT
433+
method: testTasks
434+
issue: https://github.com/elastic/elasticsearch/issues/121626
435+
- class: org.elasticsearch.xpack.esql.action.CrossClustersCancellationIT
436+
method: testCloseSkipUnavailable
437+
issue: https://github.com/elastic/elasticsearch/issues/121627
437438

438439
# Examples:
439440
#

server/src/internalClusterTest/java/org/elasticsearch/search/fieldcaps/FieldCapabilitiesIT.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.elasticsearch.client.Cancellable;
2929
import org.elasticsearch.client.Request;
3030
import org.elasticsearch.client.Response;
31+
import org.elasticsearch.cluster.ClusterState;
3132
import org.elasticsearch.cluster.metadata.IndexMetadata;
3233
import org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand;
3334
import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider;
@@ -73,6 +74,7 @@
7374
import java.util.Collection;
7475
import java.util.Collections;
7576
import java.util.HashMap;
77+
import java.util.HashSet;
7678
import java.util.List;
7779
import java.util.Map;
7880
import java.util.concurrent.CancellationException;
@@ -591,21 +593,31 @@ public void testNoActiveCopy() throws Exception {
591593

592594
private void moveOrCloseShardsOnNodes(String nodeName) throws Exception {
593595
final IndicesService indicesService = internalCluster().getInstance(IndicesService.class, nodeName);
596+
final ClusterState clusterState = clusterService().state();
594597
for (IndexService indexService : indicesService) {
595598
for (IndexShard indexShard : indexService) {
596599
if (randomBoolean()) {
597600
closeShardNoCheck(indexShard, randomBoolean());
598601
} else if (randomBoolean()) {
599602
final ShardId shardId = indexShard.shardId();
600-
603+
final var assignedNodes = new HashSet<>();
604+
clusterState.routingTable().shardRoutingTable(shardId).allShards().forEach(shr -> {
605+
if (shr.currentNodeId() != null) {
606+
assignedNodes.add(shr.currentNodeId());
607+
}
608+
if (shr.relocatingNodeId() != null) {
609+
assignedNodes.add(shr.relocatingNodeId());
610+
}
611+
});
601612
final var targetNodes = new ArrayList<String>();
602613
for (final var targetIndicesService : internalCluster().getInstances(IndicesService.class)) {
603614
final var targetNode = targetIndicesService.clusterService().localNode();
604-
if (targetNode.canContainData() && targetIndicesService.getShardOrNull(shardId) == null) {
615+
if (targetNode.canContainData()
616+
&& targetIndicesService.getShardOrNull(shardId) == null
617+
&& assignedNodes.contains(targetNode.getId()) == false) {
605618
targetNodes.add(targetNode.getId());
606619
}
607620
}
608-
609621
if (targetNodes.isEmpty()) {
610622
continue;
611623
}

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/exchange/ExchangeServiceTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ public void testExchangeSourceContinueOnFailure() {
436436
exchangeSink
437437
);
438438
assertThat(actualSeqNos, equalTo(expectedSeqNos));
439+
safeGet(sourceCompletionFuture);
439440
assertThat(completedSinks.get() + failedSinks.get(), equalTo(totalSinks.get()));
440-
sourceCompletionFuture.actionGet();
441441
if (failedRequests.get() > 0) {
442442
assertThat(failedSinks.get(), greaterThan(0));
443443
} else {

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/EsqlActionTaskIT.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,9 @@ protected void doRun() throws Exception {
462462
}
463463
Exception failure = expectThrows(Exception.class, () -> future.actionGet().close());
464464
EsqlTestUtils.assertEsqlFailure(failure);
465-
assertThat(failure.getMessage(), containsString("failed to fetch pages"));
465+
Throwable cause = ExceptionsHelper.unwrap(failure, IOException.class);
466+
assertNotNull(cause);
467+
assertThat(cause.getMessage(), containsString("failed to fetch pages"));
466468
// If we proceed without waiting for pages, we might cancel the main request before starting the data-node request.
467469
// As a result, the exchange sinks on data-nodes won't be removed until the inactive_timeout elapses, which is
468470
// longer than the assertBusy timeout.

0 commit comments

Comments
 (0)