Skip to content

Commit 2152d86

Browse files
committed
Merge remote-tracking branch 'es/main' into LuceneSyntheticSourceChangesSnapshot_forceSequentialReader
2 parents 80708ce + 2134a1e commit 2152d86

File tree

77 files changed

+1455
-226
lines changed

Some content is hidden

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

77 files changed

+1455
-226
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public void execute(Task t) {
120120
"--add-opens=java.base/java.nio.file=ALL-UNNAMED",
121121
"--add-opens=java.base/java.time=ALL-UNNAMED",
122122
"--add-opens=java.management/java.lang.management=ALL-UNNAMED",
123+
"--enable-native-access=ALL-UNNAMED",
123124
"-XX:+HeapDumpOnOutOfMemoryError"
124125
);
125126

docs/changelog/126581.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pr: 126581
2+
summary: "Optimize shared blob cache evictions on shard removal
3+
Shared blob cache evictions occur on the cluster applier thread when shards are
4+
removed from a node. These can be expensive if a large number of shards are
5+
being removed. This change uses the context of the removal to avoid unnecessary
6+
evictions that might hold up the applier thread.
7+
"
8+
area: Snapshot/Restore
9+
type: enhancement
10+
issues: []

docs/reference/elasticsearch/mapping-reference/parent-join.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
---
2+
applies_to:
3+
serverless: unavailable
24
navigation_title: "Join"
35
mapped_pages:
46
- https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html
57
---
68

79
# Join field type [parent-join]
810

9-
1011
The `join` data type is a special field that creates parent/child relation within documents of the same index. The `relations` section defines a set of possible relations within the documents, each relation being a parent name and a child name.
1112

1213
::::{warning}

modules/repository-s3/src/javaRestTest/java/org/elasticsearch/repositories/s3/RepositoryS3MinioBasicCredentialsRestIT.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121

2222
import java.util.Locale;
2323

24-
import static org.elasticsearch.repositories.s3.S3Service.REPOSITORY_S3_CAS_ANTI_CONTENTION_DELAY_SETTING;
25-
import static org.elasticsearch.repositories.s3.S3Service.REPOSITORY_S3_CAS_TTL_SETTING;
26-
2724
@ThreadLeakFilters(filters = { TestContainersThreadFilter.class })
2825
@ThreadLeakScope(ThreadLeakScope.Scope.NONE) // https://github.com/elastic/elasticsearch/issues/102482
2926
public class RepositoryS3MinioBasicCredentialsRestIT extends AbstractRepositoryS3RestTestCase {
@@ -42,10 +39,6 @@ public class RepositoryS3MinioBasicCredentialsRestIT extends AbstractRepositoryS
4239
.keystore("s3.client." + CLIENT + ".access_key", ACCESS_KEY)
4340
.keystore("s3.client." + CLIENT + ".secret_key", SECRET_KEY)
4441
.setting("s3.client." + CLIENT + ".endpoint", minioFixture::getAddress)
45-
// Skip listing of pre-existing uploads during a CAS because MinIO sometimes leaks them; also reduce the delay before proceeding
46-
// TODO do not set these if running a MinIO version in which https://github.com/minio/minio/issues/21189 is fixed
47-
.setting(REPOSITORY_S3_CAS_TTL_SETTING.getKey(), "-1")
48-
.setting(REPOSITORY_S3_CAS_ANTI_CONTENTION_DELAY_SETTING.getKey(), "100ms")
4942
.build();
5043

5144
@ClassRule

muted-tests.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,6 @@ tests:
426426
- class: org.elasticsearch.xpack.esql.action.CrossClusterQueryWithPartialResultsIT
427427
method: testOneRemoteClusterPartial
428428
issue: https://github.com/elastic/elasticsearch/issues/124055
429-
- class: org.elasticsearch.compute.aggregation.SampleDoubleAggregatorFunctionTests
430-
method: testSimpleWithCranky
431-
issue: https://github.com/elastic/elasticsearch/issues/128024
432429
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
433430
method: test {lookup-join.MvJoinKeyOnTheLookupIndex ASYNC}
434431
issue: https://github.com/elastic/elasticsearch/issues/128030
@@ -474,9 +471,6 @@ tests:
474471
- class: org.elasticsearch.packaging.test.TemporaryDirectoryConfigTests
475472
method: test21AcceptsCustomPathInDocker
476473
issue: https://github.com/elastic/elasticsearch/issues/128114
477-
- class: org.elasticsearch.xpack.esql.qa.single_node.PushQueriesIT
478-
method: testEqualityAndOther {semantic_text}
479-
issue: https://github.com/elastic/elasticsearch/issues/128414
480474
- class: org.elasticsearch.xpack.ml.integration.InferenceIngestIT
481475
method: testPipelineIngestWithModelAliases
482476
issue: https://github.com/elastic/elasticsearch/issues/128417

server/src/internalClusterTest/java/org/elasticsearch/plugins/IndexFoldersDeletionListenerIT.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.elasticsearch.index.IndexSettings;
2323
import org.elasticsearch.index.shard.ShardId;
2424
import org.elasticsearch.indices.IndicesService;
25+
import org.elasticsearch.indices.cluster.IndexRemovalReason;
2526
import org.elasticsearch.test.ESIntegTestCase;
2627
import org.elasticsearch.test.junit.annotations.TestLogging;
2728

@@ -345,12 +346,22 @@ public static class IndexFoldersDeletionListenerPlugin extends Plugin implements
345346
public List<IndexFoldersDeletionListener> getIndexFoldersDeletionListeners() {
346347
return List.of(new IndexFoldersDeletionListener() {
347348
@Override
348-
public void beforeIndexFoldersDeleted(Index index, IndexSettings indexSettings, Path[] indexPaths) {
349+
public void beforeIndexFoldersDeleted(
350+
Index index,
351+
IndexSettings indexSettings,
352+
Path[] indexPaths,
353+
IndexRemovalReason reason
354+
) {
349355
deletedIndices.add(index);
350356
}
351357

352358
@Override
353-
public void beforeShardFoldersDeleted(ShardId shardId, IndexSettings indexSettings, Path[] shardPaths) {
359+
public void beforeShardFoldersDeleted(
360+
ShardId shardId,
361+
IndexSettings indexSettings,
362+
Path[] shardPaths,
363+
IndexRemovalReason reason
364+
) {
354365
deletedShards.computeIfAbsent(shardId.getIndex(), i -> Collections.synchronizedList(new ArrayList<>())).add(shardId);
355366
}
356367
});

server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexAliasesService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
import static java.util.Collections.emptyList;
5050
import static java.util.Collections.emptyMap;
51-
import static org.elasticsearch.indices.cluster.IndicesClusterStateService.AllocatedIndices.IndexRemovalReason.NO_LONGER_ASSIGNED;
51+
import static org.elasticsearch.indices.cluster.IndexRemovalReason.NO_LONGER_ASSIGNED;
5252

5353
/**
5454
* Service responsible for submitting add and remove aliases requests

server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383

8484
import static java.util.Collections.emptyMap;
8585
import static org.elasticsearch.cluster.metadata.MetadataCreateDataStreamService.validateTimestampFieldMapping;
86-
import static org.elasticsearch.indices.cluster.IndicesClusterStateService.AllocatedIndices.IndexRemovalReason.NO_LONGER_ASSIGNED;
86+
import static org.elasticsearch.indices.cluster.IndexRemovalReason.NO_LONGER_ASSIGNED;
8787

8888
/**
8989
* Service responsible for submitting index templates updates

server/src/main/java/org/elasticsearch/index/CompositeIndexEventListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import org.elasticsearch.index.shard.IndexShard;
2222
import org.elasticsearch.index.shard.IndexShardState;
2323
import org.elasticsearch.index.shard.ShardId;
24-
import org.elasticsearch.indices.cluster.IndicesClusterStateService.AllocatedIndices.IndexRemovalReason;
24+
import org.elasticsearch.indices.cluster.IndexRemovalReason;
2525
import org.elasticsearch.threadpool.ThreadPool;
2626

2727
import java.util.Collection;

server/src/main/java/org/elasticsearch/index/IndexService.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
import org.elasticsearch.index.store.Store;
8484
import org.elasticsearch.index.translog.Translog;
8585
import org.elasticsearch.indices.breaker.CircuitBreakerService;
86+
import org.elasticsearch.indices.cluster.IndexRemovalReason;
8687
import org.elasticsearch.indices.cluster.IndicesClusterStateService;
8788
import org.elasticsearch.indices.fielddata.cache.IndicesFieldDataCache;
8889
import org.elasticsearch.indices.recovery.RecoveryState;
@@ -494,7 +495,12 @@ public synchronized IndexShard createShard(
494495
nodeEnv,
495496
lock,
496497
this.indexSettings,
497-
shardPaths -> indexFoldersDeletionListener.beforeShardFoldersDeleted(shardId, this.indexSettings, shardPaths)
498+
shardPaths -> indexFoldersDeletionListener.beforeShardFoldersDeleted(
499+
shardId,
500+
this.indexSettings,
501+
shardPaths,
502+
IndexRemovalReason.FAILURE
503+
)
498504
);
499505
path = ShardPath.loadShardPath(logger, nodeEnv, shardId, this.indexSettings.customDataPath());
500506
} catch (Exception inner) {
@@ -704,11 +710,11 @@ private void onShardClose(ShardLock lock) {
704710
try {
705711
eventListener.beforeIndexShardDeleted(lock.getShardId(), indexSettings.getSettings());
706712
} finally {
707-
shardStoreDeleter.deleteShardStore("delete index", lock, indexSettings);
713+
shardStoreDeleter.deleteShardStore("delete index", lock, indexSettings, IndexRemovalReason.DELETED);
708714
eventListener.afterIndexShardDeleted(lock.getShardId(), indexSettings.getSettings());
709715
}
710716
} catch (IOException e) {
711-
shardStoreDeleter.addPendingDelete(lock.getShardId(), indexSettings);
717+
shardStoreDeleter.addPendingDelete(lock.getShardId(), indexSettings, IndexRemovalReason.DELETED);
712718
logger.debug(() -> "[" + lock.getShardId().id() + "] failed to delete shard content - scheduled a retry", e);
713719
}
714720
}
@@ -1062,9 +1068,9 @@ public static Function<String, String> dateMathExpressionResolverAt(long instant
10621068
}
10631069

10641070
public interface ShardStoreDeleter {
1065-
void deleteShardStore(String reason, ShardLock lock, IndexSettings indexSettings) throws IOException;
1071+
void deleteShardStore(String reasonText, ShardLock lock, IndexSettings indexSettings, IndexRemovalReason reason) throws IOException;
10661072

1067-
void addPendingDelete(ShardId shardId, IndexSettings indexSettings);
1073+
void addPendingDelete(ShardId shardId, IndexSettings indexSettings, IndexRemovalReason reason);
10681074
}
10691075

10701076
public final EngineFactory getEngineFactory() {

0 commit comments

Comments
 (0)