Skip to content

Commit

Permalink
Add pinned timestamp setting in integ tests
Browse files Browse the repository at this point in the history
Signed-off-by: Anshu Agarwal <[email protected]>
  • Loading branch information
Anshu Agarwal committed Aug 28, 2024
1 parent 0289d67 commit fb48a2d
Showing 1 changed file with 31 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.opensearch.index.remote.RemoteStoreEnums.PathType;
import org.opensearch.index.shard.IndexShard;
import org.opensearch.indices.IndicesService;
import org.opensearch.indices.RemoteStoreSettings;
import org.opensearch.indices.replication.common.ReplicationType;
import org.opensearch.repositories.RepositoriesService;
import org.opensearch.repositories.Repository;
Expand Down Expand Up @@ -756,10 +757,9 @@ public void testInvalidRestoreRequestScenarios() throws Exception {
}

public void testCreateSnapshotV2() throws Exception {

internalCluster().startClusterManagerOnlyNode();
internalCluster().startDataOnlyNode();
internalCluster().startDataOnlyNode();
internalCluster().startClusterManagerOnlyNode(pinnedTimestampSettings());
internalCluster().startDataOnlyNode(pinnedTimestampSettings());
internalCluster().startDataOnlyNode(pinnedTimestampSettings());
String indexName1 = "testindex1";
String indexName2 = "testindex2";
String indexName3 = "testindex3";
Expand Down Expand Up @@ -826,9 +826,9 @@ public void testCreateSnapshotV2() throws Exception {

public void testMixedSnapshotCreationWithV2RepositorySetting() throws Exception {

internalCluster().startClusterManagerOnlyNode();
internalCluster().startDataOnlyNode();
internalCluster().startDataOnlyNode();
internalCluster().startClusterManagerOnlyNode(pinnedTimestampSettings());
internalCluster().startDataOnlyNode(pinnedTimestampSettings());
internalCluster().startDataOnlyNode(pinnedTimestampSettings());
String indexName1 = "testindex1";
String indexName2 = "testindex2";
String indexName3 = "testindex3";
Expand Down Expand Up @@ -908,9 +908,9 @@ public void testMixedSnapshotCreationWithV2RepositorySetting() throws Exception
}

public void testConcurrentSnapshotV2CreateOperation() throws InterruptedException, ExecutionException {
internalCluster().startClusterManagerOnlyNode();
internalCluster().startDataOnlyNode();
internalCluster().startDataOnlyNode();
internalCluster().startClusterManagerOnlyNode(pinnedTimestampSettings());
internalCluster().startDataOnlyNode(pinnedTimestampSettings());
internalCluster().startDataOnlyNode(pinnedTimestampSettings());
String indexName1 = "testindex1";
String indexName2 = "testindex2";
String snapshotRepoName = "test-create-snapshot-repo";
Expand Down Expand Up @@ -989,9 +989,9 @@ public void testConcurrentSnapshotV2CreateOperation() throws InterruptedExceptio
}

public void testCreateSnapshotV2WithRedIndex() throws Exception {
internalCluster().startClusterManagerOnlyNode();
internalCluster().startDataOnlyNode();
internalCluster().startDataOnlyNode();
internalCluster().startClusterManagerOnlyNode(pinnedTimestampSettings());
internalCluster().startDataOnlyNode(pinnedTimestampSettings());
internalCluster().startDataOnlyNode(pinnedTimestampSettings());
String indexName1 = "testindex1";
String indexName2 = "testindex2";
String snapshotRepoName = "test-create-snapshot-repo";
Expand Down Expand Up @@ -1043,9 +1043,9 @@ public void testCreateSnapshotV2WithRedIndex() throws Exception {
}

public void testCreateSnapshotV2WithIndexingLoad() throws Exception {
internalCluster().startClusterManagerOnlyNode();
internalCluster().startDataOnlyNode();
internalCluster().startDataOnlyNode();
internalCluster().startClusterManagerOnlyNode(pinnedTimestampSettings());
internalCluster().startDataOnlyNode(pinnedTimestampSettings());
internalCluster().startDataOnlyNode(pinnedTimestampSettings());
String indexName1 = "testindex1";
String indexName2 = "testindex2";
String snapshotRepoName = "test-create-snapshot-repo";
Expand Down Expand Up @@ -1117,9 +1117,9 @@ public void testCreateSnapshotV2WithIndexingLoad() throws Exception {
}

public void testCreateSnapshotV2WithShallowCopySettingDisabled() throws Exception {
internalCluster().startClusterManagerOnlyNode();
internalCluster().startDataOnlyNode();
internalCluster().startDataOnlyNode();
internalCluster().startClusterManagerOnlyNode(pinnedTimestampSettings());
internalCluster().startDataOnlyNode(pinnedTimestampSettings());
internalCluster().startDataOnlyNode(pinnedTimestampSettings());
String indexName1 = "testindex1";
String indexName2 = "testindex2";
String snapshotRepoName = "test-create-snapshot-repo";
Expand Down Expand Up @@ -1173,8 +1173,8 @@ public void testCreateSnapshotV2WithShallowCopySettingDisabled() throws Exceptio

public void testClusterManagerFailoverDuringSnapshotCreation() throws Exception {

internalCluster().startClusterManagerOnlyNodes(3, Settings.EMPTY);
internalCluster().startDataOnlyNode();
internalCluster().startClusterManagerOnlyNodes(3, pinnedTimestampSettings());
internalCluster().startDataOnlyNode(pinnedTimestampSettings());
String indexName1 = "testindex1";
String indexName2 = "testindex2";
String snapshotRepoName = "test-create-snapshot-repo";
Expand Down Expand Up @@ -1253,9 +1253,9 @@ public void testClusterManagerFailoverDuringSnapshotCreation() throws Exception
}

public void testConcurrentV1SnapshotAndV2RepoSettingUpdate() throws Exception {
internalCluster().startClusterManagerOnlyNode();
internalCluster().startDataOnlyNode();
internalCluster().startDataOnlyNode();
internalCluster().startClusterManagerOnlyNode(pinnedTimestampSettings());
internalCluster().startDataOnlyNode(pinnedTimestampSettings());
internalCluster().startDataOnlyNode(pinnedTimestampSettings());
String snapshotRepoName = "test-create-snapshot-repo";
String snapshotName1 = "test-create-snapshot-v1";
Path absolutePath1 = randomRepoPath().toAbsolutePath();
Expand Down Expand Up @@ -1341,4 +1341,11 @@ public void testConcurrentV1SnapshotAndV2RepoSettingUpdate() throws Exception {
createV1SnapshotThread.join();
}

private Settings pinnedTimestampSettings() {
Settings settings = Settings.builder()
.put(RemoteStoreSettings.CLUSTER_REMOTE_STORE_PINNED_TIMESTAMP_ENABLED.getKey(), true)
.build();
return settings;
}

}

0 comments on commit fb48a2d

Please sign in to comment.