Skip to content

Commit 08e2b50

Browse files
committed
enable publication by default
Signed-off-by: Shivansh Arora <[email protected]>
1 parent f94a99e commit 08e2b50

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@
213213
import static org.opensearch.core.common.util.CollectionUtils.eagerPartition;
214214
import static org.opensearch.discovery.DiscoveryModule.DISCOVERY_SEED_PROVIDERS_SETTING;
215215
import static org.opensearch.discovery.SettingsBasedSeedHostsProvider.DISCOVERY_SEED_HOSTS_SETTING;
216+
import static org.opensearch.gateway.remote.RemoteClusterStateService.REMOTE_CLUSTER_STATE_ENABLED_SETTING;
216217
import static org.opensearch.index.IndexSettings.INDEX_DOC_ID_FUZZY_SET_ENABLED_SETTING;
217218
import static org.opensearch.index.IndexSettings.INDEX_DOC_ID_FUZZY_SET_FALSE_POSITIVE_PROBABILITY_SETTING;
218219
import static org.opensearch.index.IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING;
@@ -396,6 +397,8 @@ public abstract class OpenSearchIntegTestCase extends OpenSearchTestCase {
396397
private ReplicationType randomReplicationType;
397398

398399
private String randomStorageType;
400+
private Path translogRepoPath;
401+
private Path segmentRepoPath;
399402

400403
@BeforeClass
401404
public static void beforeClass() throws Exception {
@@ -690,7 +693,7 @@ protected Settings featureFlagSettings() {
690693
// Enabling Telemetry setting by default
691694
featureSettings.put(FeatureFlags.TELEMETRY_SETTING.getKey(), true);
692695
featureSettings.put(FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES_SETTING.getKey(), true);
693-
696+
featureSettings.put(FeatureFlags.REMOTE_PUBLICATION_EXPERIMENTAL, true);
694697
return featureSettings.build();
695698
}
696699

@@ -1944,6 +1947,27 @@ protected Settings nodeSettings(int nodeOrdinal) {
19441947
builder.put(CLUSTER_REPLICATION_TYPE_SETTING.getKey(), randomReplicationType);
19451948
}
19461949
}
1950+
1951+
if (segmentRepoPath == null || translogRepoPath == null) {
1952+
segmentRepoPath = randomRepoPath().toAbsolutePath();
1953+
translogRepoPath = randomRepoPath().toAbsolutePath();
1954+
}
1955+
builder.put(remoteStoreClusterSettings("test-remote-store-repo", segmentRepoPath, "test-remote-store-repo-2", translogRepoPath));
1956+
String routingTableRepoName = "remote-routing-repo";
1957+
String routingTableRepoTypeAttributeKey = String.format(
1958+
Locale.getDefault(),
1959+
"node.attr." + REMOTE_STORE_REPOSITORY_TYPE_ATTRIBUTE_KEY_FORMAT,
1960+
routingTableRepoName
1961+
);
1962+
String routingTableRepoSettingsAttributeKeyPrefix = String.format(
1963+
Locale.getDefault(),
1964+
"node.attr." + REMOTE_STORE_REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX,
1965+
routingTableRepoName
1966+
);
1967+
builder.put(REMOTE_CLUSTER_STATE_ENABLED_SETTING.getKey(), true)
1968+
.put("node.attr." + REMOTE_STORE_ROUTING_TABLE_REPOSITORY_NAME_ATTRIBUTE_KEY, routingTableRepoName)
1969+
.put(routingTableRepoTypeAttributeKey, ReloadableFsRepository.TYPE)
1970+
.put(routingTableRepoSettingsAttributeKeyPrefix + "location", segmentRepoPath);
19471971
return builder.build();
19481972
}
19491973

0 commit comments

Comments
 (0)