Skip to content

Commit 52ae79a

Browse files
committed
Merge branch 'main' into mtv24
2 parents 6328937 + daf5ddc commit 52ae79a

File tree

8 files changed

+41
-24
lines changed

8 files changed

+41
-24
lines changed

muted-tests.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -591,21 +591,12 @@ tests:
591591
- class: org.elasticsearch.xpack.esql.qa.multi_node.GenerativeIT
592592
method: test
593593
issue: https://github.com/elastic/elasticsearch/issues/134407
594-
- class: org.elasticsearch.action.admin.cluster.stats.SearchUsageStatsTests
595-
method: testToXContent
596-
issue: https://github.com/elastic/elasticsearch/issues/135558
597-
- class: org.elasticsearch.search.ccs.SparseVectorQueryBuilderCrossClusterSearchIT
598-
method: testSparseVectorQueryWithCcsMinimizeRoundTripsFalse
599-
issue: https://github.com/elastic/elasticsearch/issues/135559
600594
- class: org.elasticsearch.cluster.routing.allocation.decider.RestoreInProgressAllocationDeciderTests
601595
method: testCanAllocatePrimaryExistingInRestoreInProgress
602596
issue: https://github.com/elastic/elasticsearch/issues/135566
603597
- class: org.elasticsearch.xpack.esql.inference.textembedding.TextEmbeddingOperatorTests
604598
method: testSimpleCircuitBreaking
605599
issue: https://github.com/elastic/elasticsearch/issues/135569
606-
- class: org.elasticsearch.search.ccs.KnnVectorQueryBuilderCrossClusterSearchIT
607-
method: testKnnQueryWithCcsMinimizeRoundTripsFalse
608-
issue: https://github.com/elastic/elasticsearch/issues/135573
609600
- class: org.elasticsearch.multiproject.test.XpackWithMultipleProjectsClientYamlTestSuiteIT
610601
method: test {yaml=esql/60_usage/Basic ESQL usage output (telemetry) snapshot version}
611602
issue: https://github.com/elastic/elasticsearch/issues/135579

server/src/main/java/org/elasticsearch/action/admin/cluster/stats/SearchUsageStats.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public SearchUsageStats() {
5151
this.sections = new HashMap<>();
5252
this.rescorers = new HashMap<>();
5353
this.retrievers = new HashMap<>();
54-
this.extendedSearchUsageStats = ExtendedSearchUsageStats.EMPTY;
54+
this.extendedSearchUsageStats = new ExtendedSearchUsageStats();
5555
}
5656

5757
/**

server/src/main/java/org/elasticsearch/action/support/replication/ReplicationRequest.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ public abstract class ReplicationRequest<Request extends ReplicationRequest<Requ
3838
implements
3939
IndicesRequest {
4040

41+
// superseded
4142
private static final TransportVersion INDEX_RESHARD_SHARDCOUNT_SUMMARY = TransportVersion.fromName("index_reshard_shardcount_summary");
43+
// bumped to use VInt instead of Int
44+
private static final TransportVersion INDEX_RESHARD_SHARDCOUNT_SMALL = TransportVersion.fromName("index_reshard_shardcount_small");
4245

4346
public static final TimeValue DEFAULT_TIMEOUT = TimeValue.timeValueMinutes(1);
4447

@@ -126,14 +129,16 @@ public ReplicationRequest(@Nullable ShardId shardId, int reshardSplitShardCountS
126129
index = in.readString();
127130
}
128131
routedBasedOnClusterVersion = in.readVLong();
129-
if (in.getTransportVersion().supports(INDEX_RESHARD_SHARDCOUNT_SUMMARY)) {
130-
if (thinRead) {
131-
this.reshardSplitShardCountSummary = reshardSplitShardCountSummary;
132-
} else {
132+
if (thinRead) {
133+
this.reshardSplitShardCountSummary = reshardSplitShardCountSummary;
134+
} else {
135+
if (in.getTransportVersion().supports(INDEX_RESHARD_SHARDCOUNT_SMALL)) {
136+
this.reshardSplitShardCountSummary = in.readVInt();
137+
} else if (in.getTransportVersion().supports(INDEX_RESHARD_SHARDCOUNT_SUMMARY)) {
133138
this.reshardSplitShardCountSummary = in.readInt();
139+
} else {
140+
this.reshardSplitShardCountSummary = 0;
134141
}
135-
} else {
136-
this.reshardSplitShardCountSummary = 0;
137142
}
138143
}
139144

@@ -262,7 +267,9 @@ public void writeTo(StreamOutput out) throws IOException {
262267
out.writeTimeValue(timeout);
263268
out.writeString(index);
264269
out.writeVLong(routedBasedOnClusterVersion);
265-
if (out.getTransportVersion().supports(INDEX_RESHARD_SHARDCOUNT_SUMMARY)) {
270+
if (out.getTransportVersion().supports(INDEX_RESHARD_SHARDCOUNT_SMALL)) {
271+
out.writeVInt(reshardSplitShardCountSummary);
272+
} else if (out.getTransportVersion().supports(INDEX_RESHARD_SHARDCOUNT_SUMMARY)) {
266273
out.writeInt(reshardSplitShardCountSummary);
267274
}
268275
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9181000
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
elastic_reranker_chunking_configuration,9180000
1+
index_reshard_shardcount_small,9181000

x-pack/plugin/inference/src/internalClusterTest/java/org/elasticsearch/search/ccs/AbstractSemanticCrossClusterSearchTestCase.java

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
package org.elasticsearch.search.ccs;
99

1010
import org.elasticsearch.action.DocWriteResponse;
11+
import org.elasticsearch.action.admin.cluster.remote.RemoteInfoRequest;
12+
import org.elasticsearch.action.admin.cluster.remote.RemoteInfoResponse;
13+
import org.elasticsearch.action.admin.cluster.remote.TransportRemoteInfoAction;
1114
import org.elasticsearch.action.search.OpenPointInTimeRequest;
1215
import org.elasticsearch.action.search.OpenPointInTimeResponse;
1316
import org.elasticsearch.action.search.SearchRequest;
@@ -35,6 +38,7 @@
3538
import org.elasticsearch.search.SearchHit;
3639
import org.elasticsearch.search.builder.SearchSourceBuilder;
3740
import org.elasticsearch.test.AbstractMultiClustersTestCase;
41+
import org.elasticsearch.transport.RemoteConnectionInfo;
3842
import org.elasticsearch.xcontent.XContentBuilder;
3943
import org.elasticsearch.xcontent.XContentFactory;
4044
import org.elasticsearch.xcontent.XContentType;
@@ -56,6 +60,7 @@
5660
import java.util.List;
5761
import java.util.Map;
5862
import java.util.Set;
63+
import java.util.concurrent.TimeUnit;
5964
import java.util.function.Consumer;
6065
import java.util.stream.Collectors;
6166

@@ -92,14 +97,16 @@ protected Collection<Class<? extends Plugin>> nodePlugins(String clusterAlias) {
9297
return List.of(LocalStateInferencePlugin.class, TestInferenceServicePlugin.class, FakeMlPlugin.class);
9398
}
9499

95-
protected void setupTwoClusters(TestIndexInfo localIndexInfo, TestIndexInfo remoteIndexInfo) throws IOException {
100+
protected void setupTwoClusters(TestIndexInfo localIndexInfo, TestIndexInfo remoteIndexInfo) throws Exception {
96101
setupCluster(LOCAL_CLUSTER, localIndexInfo);
97102
setupCluster(REMOTE_CLUSTER, remoteIndexInfo);
103+
waitUntilRemoteClusterConnected(REMOTE_CLUSTER);
98104
}
99105

100106
protected void setupCluster(String clusterAlias, TestIndexInfo indexInfo) throws IOException {
101107
final Client client = client(clusterAlias);
102108
final String indexName = indexInfo.name();
109+
final int dataNodeCount = cluster(clusterAlias).numDataNodes();
103110

104111
for (var entry : indexInfo.inferenceEndpoints().entrySet()) {
105112
String inferenceId = entry.getKey();
@@ -117,13 +124,13 @@ protected void setupCluster(String clusterAlias, TestIndexInfo indexInfo) throws
117124
createInferenceEndpoint(client, minimalServiceSettings.taskType(), inferenceId, serviceSettings);
118125
}
119126

120-
Settings indexSettings = indexSettings(randomIntBetween(2, 5), randomIntBetween(0, 1)).build();
127+
Settings indexSettings = indexSettings(randomIntBetween(1, dataNodeCount), 0).build();
121128
assertAcked(client.admin().indices().prepareCreate(indexName).setSettings(indexSettings).setMapping(indexInfo.mappings()));
122129
assertFalse(
123130
client.admin()
124131
.cluster()
125132
.prepareHealth(TEST_REQUEST_TIMEOUT, indexName)
126-
.setWaitForYellowStatus()
133+
.setWaitForGreenStatus()
127134
.setTimeout(TimeValue.timeValueSeconds(10))
128135
.get()
129136
.isTimedOut()
@@ -140,6 +147,18 @@ protected void setupCluster(String clusterAlias, TestIndexInfo indexInfo) throws
140147
assertThat(refreshResponse.getStatus(), is(RestStatus.OK));
141148
}
142149

150+
protected void waitUntilRemoteClusterConnected(String clusterAlias) throws Exception {
151+
RemoteInfoRequest request = new RemoteInfoRequest();
152+
assertBusy(() -> {
153+
RemoteInfoResponse response = client().execute(TransportRemoteInfoAction.TYPE, request).actionGet(TEST_REQUEST_TIMEOUT);
154+
boolean connected = response.getInfos()
155+
.stream()
156+
.filter(i -> i.getClusterAlias().equals(clusterAlias))
157+
.anyMatch(RemoteConnectionInfo::isConnected);
158+
assertThat(connected, is(true));
159+
}, 30, TimeUnit.SECONDS);
160+
}
161+
143162
protected BytesReference openPointInTime(String[] indices, TimeValue keepAlive) {
144163
OpenPointInTimeRequest request = new OpenPointInTimeRequest(indices).keepAlive(keepAlive);
145164
final OpenPointInTimeResponse response = client().execute(TransportOpenPointInTimeAction.TYPE, request).actionGet();

x-pack/plugin/inference/src/internalClusterTest/java/org/elasticsearch/search/ccs/MatchQueryBuilderCrossClusterSearchIT.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import org.elasticsearch.search.builder.SearchSourceBuilder;
1818
import org.junit.Before;
1919

20-
import java.io.IOException;
2120
import java.util.List;
2221
import java.util.Map;
2322
import java.util.Set;
@@ -151,7 +150,7 @@ public void testMatchQueryWithCcsMinimizeRoundTripsFalse() throws Exception {
151150
);
152151
}
153152

154-
private void configureClusters() throws IOException {
153+
private void configureClusters() throws Exception {
155154
final String commonInferenceId = "common-inference-id";
156155
final String localInferenceId = "local-inference-id";
157156
final String remoteInferenceId = "remote-inference-id";

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/60_usage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ setup:
201201
- gt: { esql.queries._all.total: $all_total_counter }
202202
- match: { esql.queries._all.failed: $all_failed_counter }
203203
- gt: { esql.functions.min: $functions_min }
204-
- gt: { esql.functions.min: $functions_avg_over_time }
204+
- gt: { esql.functions.avg_over_time: $functions_avg_over_time }
205205

206206
# There's one of these per function but that's a ton of things to check. So we just spot check that a few exist.
207207
- exists: esql.functions.delay

0 commit comments

Comments
 (0)