Skip to content

Commit aa9f39d

Browse files
committed
Merge remote-tracking branch 'es/main' into es87_tsdb_doc_values_format_change_1
2 parents cb44dde + 6048d26 commit aa9f39d

File tree

30 files changed

+674
-585
lines changed

30 files changed

+674
-585
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/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: 15 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,21 @@ 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
386+
- class: org.elasticsearch.xpack.downsample.DataStreamLifecycleDownsampleDisruptionIT
387+
method: testDataStreamLifecycleDownsampleRollingRestart
388+
issue: https://github.com/elastic/elasticsearch/issues/123769
389+
- class: org.elasticsearch.multiproject.test.CoreWithMultipleProjectsClientYamlTestSuiteIT
390+
method: test {yaml=search.vectors/41_knn_search_bbq_hnsw/Test index configured rescore vector score consistency}
391+
issue: https://github.com/elastic/elasticsearch/issues/125902
392+
- class: org.elasticsearch.smoketest.SmokeTestMultiNodeClientYamlTestSuiteIT
393+
method: test {yaml=cat.allocation/10_basic/Node forecasts}
394+
issue: https://github.com/elastic/elasticsearch/issues/125848
395+
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
396+
method: test {p0=ml/start_data_frame_analytics/Test start given dest index is not empty}
397+
issue: https://github.com/elastic/elasticsearch/issues/125909
398+
- class: org.elasticsearch.indices.stats.IndexStatsIT
399+
method: testThrottleStats
400+
issue: https://github.com/elastic/elasticsearch/issues/125910
395401

396402
# Examples:
397403
#

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 }

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -884,22 +884,3 @@ setup:
884884
- match: { hits.hits.1._score: $default_rescore1 }
885885
- match: { hits.hits.2._score: $override_score2 }
886886
- match: { hits.hits.2._score: $default_rescore2 }
887-
888-
- do:
889-
headers:
890-
Content-Type: application/json
891-
search:
892-
rest_total_hits_as_int: true
893-
index: int8_rescore_zero_hnsw
894-
body:
895-
knn:
896-
field: vector
897-
query_vector: [-0.5, 90.0, -10, 14.8]
898-
k: 3
899-
num_candidates: 3
900-
901-
# Compare scores as hit IDs may change depending on how things are distributed
902-
- match: { hits.total: 3 }
903-
- match: { hits.hits.0._score: $raw_score0 }
904-
- match: { hits.hits.1._score: $raw_score1 }
905-
- match: { hits.hits.2._score: $raw_score2 }

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -916,22 +916,3 @@ setup:
916916
- match: { hits.hits.1._score: $default_rescore1 }
917917
- match: { hits.hits.2._score: $override_score2 }
918918
- match: { hits.hits.2._score: $default_rescore2 }
919-
920-
- do:
921-
headers:
922-
Content-Type: application/json
923-
search:
924-
rest_total_hits_as_int: true
925-
index: int4_rescore_zero_hnsw
926-
body:
927-
knn:
928-
field: vector
929-
query_vector: [-0.5, 90.0, -10, 14.8]
930-
k: 3
931-
num_candidates: 3
932-
933-
# Compare scores as hit IDs may change depending on how things are distributed
934-
- match: { hits.total: 3 }
935-
- match: { hits.hits.0._score: $raw_score0 }
936-
- match: { hits.hits.1._score: $raw_score1 }
937-
- match: { hits.hits.2._score: $raw_score2 }

server/src/internalClusterTest/java/org/elasticsearch/indices/stats/IndexStatsIT.java

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
import java.util.concurrent.TimeUnit;
8080
import java.util.concurrent.atomic.AtomicBoolean;
8181
import java.util.concurrent.atomic.AtomicInteger;
82+
import java.util.concurrent.atomic.AtomicLong;
8283
import java.util.concurrent.atomic.AtomicReference;
8384

8485
import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS;
@@ -466,7 +467,7 @@ public void testNonThrottleStats() throws Exception {
466467
assertThat(stats.getPrimaries().getIndexing().getTotal().getThrottleTime().millis(), equalTo(0L));
467468
}
468469

469-
public void testThrottleStats() throws Exception {
470+
public void testThrottleStats() {
470471
assertAcked(
471472
prepareCreate("test").setSettings(
472473
settingsBuilder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, "1")
@@ -479,31 +480,38 @@ public void testThrottleStats() throws Exception {
479480
)
480481
);
481482
ensureGreen();
482-
long termUpto = 0;
483-
IndicesStatsResponse stats;
484483
// make sure we see throttling kicking in:
485-
boolean done = false;
484+
AtomicBoolean done = new AtomicBoolean();
485+
AtomicLong termUpTo = new AtomicLong();
486486
long start = System.currentTimeMillis();
487-
while (done == false) {
488-
for (int i = 0; i < 100; i++) {
489-
// Provoke slowish merging by making many unique terms:
490-
StringBuilder sb = new StringBuilder();
491-
for (int j = 0; j < 100; j++) {
492-
sb.append(' ');
493-
sb.append(termUpto++);
494-
}
495-
prepareIndex("test").setId("" + termUpto).setSource("field" + (i % 10), sb.toString()).get();
496-
if (i % 2 == 0) {
487+
for (int threadIdx = 0; threadIdx < 5; threadIdx++) {
488+
int finalThreadIdx = threadIdx;
489+
new Thread(() -> {
490+
IndicesStatsResponse stats;
491+
while (done.get() == false) {
492+
for (int i = 0; i < 100; i++) {
493+
// Provoke slowish merging by making many unique terms:
494+
StringBuilder sb = new StringBuilder();
495+
for (int j = 0; j < 100; j++) {
496+
sb.append(' ');
497+
sb.append(termUpTo.incrementAndGet());
498+
}
499+
prepareIndex("test").setId("" + termUpTo.get()).setSource("field" + (i % 10), sb.toString()).get();
500+
if (i % 2 == 0) {
501+
refresh();
502+
}
503+
}
497504
refresh();
505+
if (finalThreadIdx == 0) {
506+
stats = indicesAdmin().prepareStats().get();
507+
done.set(stats.getPrimaries().getIndexing().getTotal().getThrottleTime().millis() > 0);
508+
}
509+
if (System.currentTimeMillis() - start > 300 * 1000) { // Wait 5 minutes for throttling to kick in
510+
done.set(true);
511+
fail("index throttling didn't kick in after 5 minutes of intense merging");
512+
}
498513
}
499-
}
500-
refresh();
501-
stats = indicesAdmin().prepareStats().get();
502-
// nodesStats = clusterAdmin().prepareNodesStats().setIndices(true).get();
503-
done = stats.getPrimaries().getIndexing().getTotal().getThrottleTime().millis() > 0;
504-
if (System.currentTimeMillis() - start > 300 * 1000) { // Wait 5 minutes for throttling to kick in
505-
fail("index throttling didn't kick in after 5 minutes of intense merging");
506-
}
514+
}).start();
507515
}
508516

509517
// Optimize & flush and wait; else we sometimes get a "Delete Index failed - not acked"

server/src/main/java/org/elasticsearch/index/engine/Engine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2371,7 +2371,7 @@ public record FlushResult(boolean flushPerformed, long generation) {
23712371
}
23722372

23732373
/**
2374-
* Ensures the engine is in a state that it can be closed by a call to {@link IndexShard#resetEngine(Consumer<Engine>)}.
2374+
* Ensures the engine is in a state that it can be closed by a call to {@link IndexShard#resetEngine()}.
23752375
*
23762376
* In general, resetting the engine should be done with care, to consider any
23772377
* in-progress operations and listeners (e.g., primary term and generation listeners).

0 commit comments

Comments
 (0)