Skip to content

Commit debd040

Browse files
authored
[Snapshot V2] Support pinned timestamp in clone flow (opensearch-project#15524)
Signed-off-by: Anshu Agarwal <anshukag@amazon.com>
1 parent 6f45a74 commit debd040

File tree

4 files changed

+713
-14
lines changed

4 files changed

+713
-14
lines changed

server/src/internalClusterTest/java/org/opensearch/snapshots/CloneSnapshotIT.java

+7-8
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
import java.util.List;
6565
import java.util.concurrent.ExecutionException;
6666

67-
import static org.opensearch.remotestore.RemoteStoreBaseIntegTestCase.remoteStoreClusterSettings;
6867
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked;
6968
import static org.hamcrest.Matchers.containsString;
7069
import static org.hamcrest.Matchers.hasSize;
@@ -127,7 +126,7 @@ public void testShardClone() throws Exception {
127126
}
128127

129128
public void testCloneSnapshotIndex() throws Exception {
130-
internalCluster().startClusterManagerOnlyNode();
129+
internalCluster().startClusterManagerOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS);
131130
internalCluster().startDataOnlyNode();
132131
final String repoName = "repo-name";
133132
createRepository(repoName, "fs");
@@ -318,7 +317,7 @@ public void testClonePreventsSnapshotDelete() throws Exception {
318317
indexRandomDocs(indexName, randomIntBetween(20, 100));
319318

320319
final String targetSnapshot = "target-snapshot";
321-
blockNodeOnAnyFiles(repoName, clusterManagerName);
320+
blockClusterManagerOnWriteIndexFile(repoName);
322321
final ActionFuture<AcknowledgedResponse> cloneFuture = startClone(repoName, sourceSnapshot, targetSnapshot, indexName);
323322
waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L));
324323
assertFalse(cloneFuture.isDone());
@@ -426,7 +425,7 @@ public void testLongRunningSnapshotAllowsConcurrentClone() throws Exception {
426425
}
427426

428427
public void testDeletePreventsClone() throws Exception {
429-
final String clusterManagerName = internalCluster().startClusterManagerOnlyNode();
428+
final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS);
430429
internalCluster().startDataOnlyNode();
431430
final String repoName = "repo-name";
432431
createRepository(repoName, "mock");
@@ -439,7 +438,7 @@ public void testDeletePreventsClone() throws Exception {
439438
indexRandomDocs(indexName, randomIntBetween(20, 100));
440439

441440
final String targetSnapshot = "target-snapshot";
442-
blockNodeOnAnyFiles(repoName, clusterManagerName);
441+
blockClusterManagerOnWriteIndexFile(repoName);
443442
final ActionFuture<AcknowledgedResponse> deleteFuture = startDeleteSnapshot(repoName, sourceSnapshot);
444443
waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L));
445444
assertFalse(deleteFuture.isDone());
@@ -591,7 +590,7 @@ public void testClusterManagerFailoverDuringCloneStep2() throws Exception {
591590

592591
public void testExceptionDuringShardClone() throws Exception {
593592
// large snapshot pool so blocked snapshot threads from cloning don't prevent concurrent snapshot finalizations
594-
internalCluster().startClusterManagerOnlyNodes(3, LARGE_SNAPSHOT_POOL_SETTINGS);
593+
internalCluster().startClusterManagerOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS);
595594
internalCluster().startDataOnlyNode();
596595
final String repoName = "test-repo";
597596
createRepository(repoName, "mock");
@@ -602,7 +601,7 @@ public void testExceptionDuringShardClone() throws Exception {
602601
createFullSnapshot(repoName, sourceSnapshot);
603602

604603
final String targetSnapshot = "target-snapshot";
605-
blockClusterManagerFromFinalizingSnapshotOnSnapFile(repoName);
604+
blockClusterManagerFromFinalizingSnapshotOnIndexFile(repoName);
606605
final ActionFuture<AcknowledgedResponse> cloneFuture = startCloneFromDataNode(repoName, sourceSnapshot, targetSnapshot, testIndex);
607606
awaitNumberOfSnapshotsInProgress(1);
608607
final String clusterManagerNode = internalCluster().getClusterManagerName();
@@ -680,7 +679,7 @@ public void testStartSnapshotWithSuccessfulShardClonePendingFinalization() throw
680679
}
681680

682681
public void testStartCloneWithSuccessfulShardClonePendingFinalization() throws Exception {
683-
final String clusterManagerName = internalCluster().startClusterManagerOnlyNode();
682+
final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS);
684683
internalCluster().startDataOnlyNode();
685684
final String repoName = "test-repo";
686685
createRepository(repoName, "mock");

0 commit comments

Comments
 (0)