Skip to content

Commit 00abaac

Browse files
authored
Change defaults for remote store and snapshot settings (#18163)
Signed-off-by: Ashish Singh <ssashish@amazon.com>
1 parent 2b3eb26 commit 00abaac

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

server/src/main/java/org/opensearch/indices/RemoteStoreSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public class RemoteStoreSettings {
7575
@ExperimentalApi
7676
public static final Setting<RemoteStoreEnums.PathType> CLUSTER_REMOTE_STORE_PATH_TYPE_SETTING = new Setting<>(
7777
"cluster.remote_store.index.path.type",
78-
RemoteStoreEnums.PathType.FIXED.toString(),
78+
RemoteStoreEnums.PathType.HASHED_PREFIX.toString(),
7979
RemoteStoreEnums.PathType::parseString,
8080
Property.NodeScope,
8181
Property.Dynamic

server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ protected static long calculateMaxWithinIntLimit(long defaultThresholdOfHeap, lo
362362

363363
public static final Setting<PathType> SHARD_PATH_TYPE = new Setting<>(
364364
"shard_path_type",
365-
PathType.FIXED.toString(),
365+
PathType.HASHED_PREFIX.toString(),
366366
PathType::parseString
367367
);
368368

server/src/test/java/org/opensearch/index/remote/RemoteStoreCustomMetadataResolverTests.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
public class RemoteStoreCustomMetadataResolverTests extends OpenSearchTestCase {
3030

3131
RepositoriesService repositoriesService = mock(RepositoriesService.class);
32-
Settings settings = Settings.EMPTY;
3332

3433
public void testGetPathStrategyMinVersionOlder() {
3534
Settings settings = Settings.builder().put(CLUSTER_REMOTE_STORE_PATH_TYPE_SETTING.getKey(), randomFrom(PathType.values())).build();
@@ -138,6 +137,12 @@ public void testGetPathStrategyStrategyWithDynamicUpdate() {
138137
() -> repositoriesService,
139138
settings
140139
);
140+
assertEquals(PathType.HASHED_PREFIX, resolver.getPathStrategy().getType());
141+
assertNotNull(resolver.getPathStrategy().getHashAlgorithm());
142+
assertEquals(PathHashAlgorithm.FNV_1A_COMPOSITE_1, resolver.getPathStrategy().getHashAlgorithm());
143+
144+
// Set FIXED with null hash algorithm
145+
clusterSettings.applySettings(Settings.builder().put(CLUSTER_REMOTE_STORE_PATH_TYPE_SETTING.getKey(), PathType.FIXED).build());
141146
assertEquals(PathType.FIXED, resolver.getPathStrategy().getType());
142147
assertNull(resolver.getPathStrategy().getHashAlgorithm());
143148

0 commit comments

Comments
 (0)