Skip to content

Fix CloneSnapshotIT.testRemoveFailedCloneFromCSWithQueuedSnapshotInProgress #89914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.lessThan;

@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0)
public class CloneSnapshotIT extends AbstractSnapshotIntegTestCase {
Expand Down Expand Up @@ -760,7 +761,7 @@ public void testRemoveFailedCloneFromCSWithQueuedSnapshotInProgress() throws Exc
final String masterNode = internalCluster().startMasterOnlyNode(
Settings.builder().put("thread_pool.snapshot.core", 1).put("thread_pool.snapshot.max", 1).build()
);
final String dataNode = internalCluster().startDataOnlyNode();
final String dataNode = internalCluster().startDataOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS);
final String repoName = "test-repo";
createRepository(repoName, "mock");
final String testIndex = "index-test";
Expand All @@ -778,6 +779,16 @@ public void testRemoveFailedCloneFromCSWithQueuedSnapshotInProgress() throws Exc
blockDataNode(repoName, dataNode);
final ActionFuture<CreateSnapshotResponse> fullSnapshotFuture1 = startFullSnapshot(repoName, "full-snapshot-1");
waitForBlock(dataNode, repoName);
// make sure we don't have so many files in the shard that will get blocked to fully clog up the snapshot pool on the data node
final var files = admin().indices()
.prepareStats("test-index-3")
.setSegments(true)
.setIncludeSegmentFileSizes(true)
.get()
.getPrimaries()
.getSegments()
.getFiles();
assertThat(files.size(), lessThan(LARGE_POOL_SIZE));
final ActionFuture<AcknowledgedResponse> cloneFuture = startClone(repoName, sourceSnapshot, targetSnapshot, testIndex, testIndex2);
awaitNumberOfSnapshotsInProgress(2);
waitForBlock(masterNode, repoName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ public abstract class AbstractSnapshotIntegTestCase extends ESIntegTestCase {

public static final String OLD_VERSION_SNAPSHOT_PREFIX = "old-version-snapshot-";

protected static final int LARGE_POOL_SIZE = 5;

// Large snapshot pool settings to set up nodes for tests involving multiple repositories that need to have enough
// threads so that blocking some threads on one repository doesn't block other repositories from doing work
protected static final Settings LARGE_SNAPSHOT_POOL_SETTINGS = Settings.builder()
.put("thread_pool.snapshot.core", 5)
.put("thread_pool.snapshot.max", 5)
.put("thread_pool.snapshot.core", LARGE_POOL_SIZE)
.put("thread_pool.snapshot.max", LARGE_POOL_SIZE)
.build();

@Override
Expand Down