Skip to content

Commit 2a43003

Browse files
authored
Merge branch 'main' into fix/reenable_concurrency_top_hits_sorted
2 parents fdf7997 + f37564d commit 2a43003

File tree

32 files changed

+803
-964
lines changed

32 files changed

+803
-964
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/DockerBase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ public enum DockerBase {
2626
"-wolfi",
2727
"apk"
2828
),
29-
30-
FIPS("docker.elastic.co/wolfi/chainguard-base-fips:sha256-feb7aeb1bbcb331afa089388f2fa1e81997fc24642ca4fa06b7e502ff599a4cf", "-fips", "apk"),
29+
FIPS("docker.elastic.co/wolfi/chainguard-base-fips:sha256-ebfc3f1d7dba992231747a2e05ad1b859843e81b5e676ad342859d7cf9e425a7", "-fips", "apk"),
3130
// spotless:on
3231
// Based on WOLFI above, with more extras. We don't set a base image because
3332
// we programmatically extend from the wolfi image.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+

modules/data-streams/src/main/java/org/elasticsearch/datastreams/DataStreamsPlugin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ public Collection<?> createComponents(PluginServices services) {
211211
errorStoreInitialisationService.get(),
212212
services.allocationService(),
213213
dataStreamLifecycleErrorsPublisher.get(),
214-
services.dataStreamGlobalRetentionSettings()
214+
services.dataStreamGlobalRetentionSettings(),
215+
services.projectResolver()
215216
)
216217
);
217218
dataLifecycleInitialisationService.get().init();

modules/data-streams/src/main/java/org/elasticsearch/datastreams/lifecycle/DataStreamLifecycleService.java

Lines changed: 144 additions & 106 deletions
Large diffs are not rendered by default.

modules/data-streams/src/test/java/org/elasticsearch/datastreams/lifecycle/DataStreamLifecycleFixtures.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import org.elasticsearch.cluster.metadata.DataStream;
1818
import org.elasticsearch.cluster.metadata.DataStreamLifecycle;
1919
import org.elasticsearch.cluster.metadata.IndexMetadata;
20-
import org.elasticsearch.cluster.metadata.Metadata;
2120
import org.elasticsearch.cluster.metadata.ProjectMetadata;
2221
import org.elasticsearch.cluster.metadata.ResettableValue;
2322
import org.elasticsearch.cluster.metadata.Template;
@@ -49,22 +48,6 @@
4948
*/
5049
public class DataStreamLifecycleFixtures {
5150

52-
public static DataStream createDataStream(
53-
Metadata.Builder builder,
54-
String dataStreamName,
55-
int backingIndicesCount,
56-
Settings.Builder backingIndicesSettings,
57-
@Nullable DataStreamLifecycle lifecycle,
58-
Long now
59-
) {
60-
var projectBuilder = builder.getProject(Metadata.DEFAULT_PROJECT_ID);
61-
if (projectBuilder == null) {
62-
projectBuilder = ProjectMetadata.builder(Metadata.DEFAULT_PROJECT_ID);
63-
builder.put(projectBuilder);
64-
}
65-
return createDataStream(projectBuilder, dataStreamName, backingIndicesCount, 0, backingIndicesSettings, lifecycle, now);
66-
}
67-
6851
public static DataStream createDataStream(
6952
ProjectMetadata.Builder builder,
7053
String dataStreamName,
@@ -76,31 +59,6 @@ public static DataStream createDataStream(
7659
return createDataStream(builder, dataStreamName, backingIndicesCount, 0, backingIndicesSettings, lifecycle, now);
7760
}
7861

79-
public static DataStream createDataStream(
80-
Metadata.Builder builder,
81-
String dataStreamName,
82-
int backingIndicesCount,
83-
int failureIndicesCount,
84-
Settings.Builder backingIndicesSettings,
85-
@Nullable DataStreamLifecycle lifecycle,
86-
Long now
87-
) {
88-
var projectBuilder = builder.getProject(Metadata.DEFAULT_PROJECT_ID);
89-
if (projectBuilder == null) {
90-
projectBuilder = ProjectMetadata.builder(Metadata.DEFAULT_PROJECT_ID);
91-
builder.put(projectBuilder);
92-
}
93-
return createDataStream(
94-
projectBuilder,
95-
dataStreamName,
96-
backingIndicesCount,
97-
failureIndicesCount,
98-
backingIndicesSettings,
99-
lifecycle,
100-
now
101-
);
102-
}
103-
10462
public static DataStream createDataStream(
10563
ProjectMetadata.Builder builder,
10664
String dataStreamName,

modules/data-streams/src/test/java/org/elasticsearch/datastreams/lifecycle/DataStreamLifecycleServiceTests.java

Lines changed: 209 additions & 252 deletions
Large diffs are not rendered by default.

modules/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public void testMetrics() throws Exception {
285285
final BlobStore blobStore = blobStoreRepository.blobStore();
286286
final BlobStore delegateBlobStore = ((BlobStoreWrapper) blobStore).delegate();
287287
final S3BlobStore s3BlobStore = (S3BlobStore) delegateBlobStore;
288-
final Map<S3BlobStore.StatsKey, S3BlobStore.IgnoreNoResponseMetricsCollector> statsCollectors = s3BlobStore
288+
final Map<S3BlobStore.StatsKey, S3BlobStore.ElasticsearchS3MetricsCollector> statsCollectors = s3BlobStore
289289
.getStatsCollectors().collectors;
290290

291291
final var plugins = internalCluster().getInstance(PluginsService.class, nodeName)

modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3BlobStore.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,17 @@ public TimeValue getCompareAndExchangeAntiContentionDelay() {
143143
return service.compareAndExchangeAntiContentionDelay;
144144
}
145145

146-
// metrics collector that ignores null responses that we interpret as the request not reaching the S3 endpoint due to a network
147-
// issue
148-
class IgnoreNoResponseMetricsCollector extends RequestMetricCollector {
146+
/**
147+
* A {@link RequestMetricCollector} that processes the metrics related to each API invocation attempt according to Elasticsearch's needs
148+
*/
149+
class ElasticsearchS3MetricsCollector extends RequestMetricCollector {
149150

150151
final LongAdder requests = new LongAdder();
151152
final LongAdder operations = new LongAdder();
152153
private final Operation operation;
153154
private final Map<String, Object> attributes;
154155

155-
private IgnoreNoResponseMetricsCollector(Operation operation, OperationPurpose purpose) {
156+
private ElasticsearchS3MetricsCollector(Operation operation, OperationPurpose purpose) {
156157
this.operation = operation;
157158
this.attributes = RepositoriesMetrics.createAttributesMap(repositoryMetadata, purpose, operation.getKey());
158159
}
@@ -582,7 +583,7 @@ public String toString() {
582583
}
583584

584585
class StatsCollectors {
585-
final Map<StatsKey, IgnoreNoResponseMetricsCollector> collectors = new ConcurrentHashMap<>();
586+
final Map<StatsKey, ElasticsearchS3MetricsCollector> collectors = new ConcurrentHashMap<>();
586587

587588
RequestMetricCollector getMetricCollector(Operation operation, OperationPurpose purpose) {
588589
return collectors.computeIfAbsent(new StatsKey(operation, purpose), k -> buildMetricCollector(k.operation(), k.purpose()));
@@ -605,8 +606,8 @@ Map<String, BlobStoreActionStats> statsMap(boolean isStateless) {
605606
}
606607
}
607608

608-
IgnoreNoResponseMetricsCollector buildMetricCollector(Operation operation, OperationPurpose purpose) {
609-
return new IgnoreNoResponseMetricsCollector(operation, purpose);
609+
ElasticsearchS3MetricsCollector buildMetricCollector(Operation operation, OperationPurpose purpose) {
610+
return new ElasticsearchS3MetricsCollector(operation, purpose);
610611
}
611612
}
612613

muted-tests.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,6 @@ tests:
233233
- class: org.elasticsearch.xpack.ilm.TimeSeriesLifecycleActionsIT
234234
method: testHistoryIsWrittenWithFailure
235235
issue: https://github.com/elastic/elasticsearch/issues/123203
236-
- class: org.elasticsearch.action.admin.indices.diskusage.IndexDiskUsageAnalyzerTests
237-
method: testCompletionField
238-
issue: https://github.com/elastic/elasticsearch/issues/123269
239236
- class: org.elasticsearch.packaging.test.DockerTests
240237
method: test151MachineDependentHeapWithSizeOverride
241238
issue: https://github.com/elastic/elasticsearch/issues/123437
@@ -377,9 +374,6 @@ tests:
377374
- class: org.elasticsearch.index.engine.ThreadPoolMergeExecutorServiceTests
378375
method: testIORateIsAdjustedForRunningMergeTasks
379376
issue: https://github.com/elastic/elasticsearch/issues/125842
380-
- class: org.elasticsearch.test.rest.yaml.RcsCcsCommonYamlTestSuiteIT
381-
method: test {p0=search.vectors/41_knn_search_bbq_hnsw/Test index configured rescore vector score consistency}
382-
issue: https://github.com/elastic/elasticsearch/issues/125851
383377
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
384378
method: test {p0=transform/transforms_start_stop/Verify start transform creates destination index with appropriate mapping}
385379
issue: https://github.com/elastic/elasticsearch/issues/125854
@@ -389,9 +383,6 @@ tests:
389383
- class: org.elasticsearch.xpack.ilm.TimeSeriesDataStreamsIT
390384
method: testSearchableSnapshotAction
391385
issue: https://github.com/elastic/elasticsearch/issues/125867
392-
- class: org.elasticsearch.xpack.inference.registry.ModelRegistryMetadataTests
393-
method: testUpgrade
394-
issue: https://github.com/elastic/elasticsearch/issues/125554
395386
- class: org.elasticsearch.xpack.downsample.DataStreamLifecycleDownsampleDisruptionIT
396387
method: testDataStreamLifecycleDownsampleRollingRestart
397388
issue: https://github.com/elastic/elasticsearch/issues/123769
@@ -407,6 +398,9 @@ tests:
407398
- class: org.elasticsearch.indices.stats.IndexStatsIT
408399
method: testThrottleStats
409400
issue: https://github.com/elastic/elasticsearch/issues/125910
401+
- class: org.elasticsearch.xpack.esql.action.ManyShardsIT
402+
method: testCancelUnnecessaryRequests
403+
issue: https://github.com/elastic/elasticsearch/issues/125947
410404

411405
# Examples:
412406
#

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.vectors/41_knn_search_bbq_hnsw.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -568,29 +568,3 @@ setup:
568568
- match: { hits.hits.1._score: $default_rescore1 }
569569
- match: { hits.hits.2._score: $override_score2 }
570570
- match: { hits.hits.2._score: $default_rescore2 }
571-
572-
- do:
573-
headers:
574-
Content-Type: application/json
575-
search:
576-
rest_total_hits_as_int: true
577-
index: bbq_rescore_zero_hnsw
578-
body:
579-
knn:
580-
field: vector
581-
query_vector: [0.128, 0.067, -0.08 , 0.395, -0.11 , -0.259, 0.473, -0.393,
582-
0.292, 0.571, -0.491, 0.444, -0.288, 0.198, -0.343, 0.015,
583-
0.232, 0.088, 0.228, 0.151, -0.136, 0.236, -0.273, -0.259,
584-
-0.217, 0.359, -0.207, 0.352, -0.142, 0.192, -0.061, -0.17 ,
585-
-0.343, 0.189, -0.221, 0.32 , -0.301, -0.1 , 0.005, 0.232,
586-
-0.344, 0.136, 0.252, 0.157, -0.13 , -0.244, 0.193, -0.034,
587-
-0.12 , -0.193, -0.102, 0.252, -0.185, -0.167, -0.575, 0.582,
588-
-0.426, 0.983, 0.212, 0.204, 0.03 , -0.276, -0.425, -0.158]
589-
k: 3
590-
num_candidates: 3
591-
592-
# Compare scores as hit IDs may change depending on how things are distributed
593-
- match: { hits.total: 3 }
594-
- match: { hits.hits.0._score: $raw_score0 }
595-
- match: { hits.hits.1._score: $raw_score1 }
596-
- match: { hits.hits.2._score: $raw_score2 }

0 commit comments

Comments
 (0)