Skip to content

Commit 1f55584

Browse files
committed
try running remote state without replication enabled
Signed-off-by: Shivansh Arora <[email protected]>
1 parent 214f929 commit 1f55584

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

server/src/main/java/org/opensearch/node/Node.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@
305305
import static org.opensearch.common.util.FeatureFlags.TELEMETRY;
306306
import static org.opensearch.env.NodeEnvironment.collectFileCacheDataPath;
307307
import static org.opensearch.index.ShardIndexingPressureSettings.SHARD_INDEXING_PRESSURE_ENABLED_ATTRIBUTE_KEY;
308+
import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.isRemoteDataAttributePresent;
308309
import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.isRemoteStoreAttributePresent;
309310
import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.isRemoteStoreClusterStateEnabled;
310311

@@ -812,7 +813,7 @@ protected Node(
812813
remoteClusterStateCleanupManager = null;
813814
}
814815
final RemoteStorePinnedTimestampService remoteStorePinnedTimestampService;
815-
if (isRemoteStoreAttributePresent(settings)) {
816+
if (isRemoteDataAttributePresent(settings)) {
816817
remoteStorePinnedTimestampService = new RemoteStorePinnedTimestampService(
817818
repositoriesServiceReference::get,
818819
settings,

test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,7 +1952,18 @@ protected Settings nodeSettings(int nodeOrdinal) {
19521952
segmentRepoPath = randomRepoPath().toAbsolutePath();
19531953
translogRepoPath = randomRepoPath().toAbsolutePath();
19541954
}
1955-
builder.put(remoteStoreClusterSettings("test-remote-store-repo", segmentRepoPath, "test-remote-store-repo-2", translogRepoPath));
1955+
String segmentRepoName = "test-remote-store-repo";
1956+
String stateRepoSettingsAttributeKeyPrefix = String.format(
1957+
Locale.getDefault(),
1958+
"node.attr." + REMOTE_STORE_REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX,
1959+
segmentRepoName
1960+
);
1961+
String prefixModeVerificationSuffix = BlobStoreRepository.PREFIX_MODE_VERIFICATION_SETTING.getKey();
1962+
String stateRepoTypeAttributeKey = String.format(
1963+
Locale.getDefault(),
1964+
"node.attr." + REMOTE_STORE_REPOSITORY_TYPE_ATTRIBUTE_KEY_FORMAT,
1965+
segmentRepoName
1966+
);
19561967
String routingTableRepoName = "remote-routing-repo";
19571968
String routingTableRepoTypeAttributeKey = String.format(
19581969
Locale.getDefault(),
@@ -1964,7 +1975,11 @@ protected Settings nodeSettings(int nodeOrdinal) {
19641975
"node.attr." + REMOTE_STORE_REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX,
19651976
routingTableRepoName
19661977
);
1967-
builder.put(REMOTE_CLUSTER_STATE_ENABLED_SETTING.getKey(), true)
1978+
builder.put("node.attr." + REMOTE_STORE_CLUSTER_STATE_REPOSITORY_NAME_ATTRIBUTE_KEY, segmentRepoName)
1979+
.put(stateRepoTypeAttributeKey, ReloadableFsRepository.TYPE)
1980+
.put(stateRepoSettingsAttributeKeyPrefix + "location", segmentRepoPath)
1981+
.put(stateRepoSettingsAttributeKeyPrefix + prefixModeVerificationSuffix, prefixModeVerificationEnable)
1982+
.put(REMOTE_CLUSTER_STATE_ENABLED_SETTING.getKey(), true)
19681983
.put("node.attr." + REMOTE_STORE_ROUTING_TABLE_REPOSITORY_NAME_ATTRIBUTE_KEY, routingTableRepoName)
19691984
.put(routingTableRepoTypeAttributeKey, ReloadableFsRepository.TYPE)
19701985
.put(routingTableRepoSettingsAttributeKeyPrefix + "location", segmentRepoPath);

0 commit comments

Comments
 (0)