Skip to content

Commit 56a837e

Browse files
Fix testCloseOrReallocateDuringPartialSnapshot (#132049)
There's a race between setting a shard as failed and a concurrent non-partial snapshot, resulting in a snapshot failure because a primary shard is not available for backup. Since the intention of the test is to verify shard close/failc can proceed while a snapshot is in progress, there's no need for this extra randomization. Closes #131900
1 parent b4c2c2e commit 56a837e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,12 +1447,11 @@ public void run() {
14471447
safeAwait(barrier);
14481448

14491449
final var snapshotName = randomIdentifier();
1450-
final var partialSnapshot = randomBoolean();
14511450
ActionFuture<CreateSnapshotResponse> snapshotFuture = clusterAdmin().prepareCreateSnapshot(
14521451
TEST_REQUEST_TIMEOUT,
14531452
repoName,
14541453
snapshotName
1455-
).setIndices(indexName).setWaitForCompletion(true).setPartial(partialSnapshot).execute();
1454+
).setIndices(indexName).setWaitForCompletion(true).setPartial(true).execute();
14561455

14571456
// we have currently blocked the start-snapshot task from running, and it will be followed by at least three blob uploads
14581457
// (segments_N, .cfe, .cfs), executed one-at-a-time because of throttling to the max threadpool size, so it's safe to let up to
@@ -1466,7 +1465,7 @@ public void run() {
14661465
assertFalse(snapshotFuture.isDone());
14671466

14681467
try {
1469-
if (partialSnapshot && randomBoolean()) {
1468+
if (randomBoolean()) {
14701469
logger.info("--> closing index [{}]", indexName);
14711470
safeGet(indicesAdmin().prepareClose(indexName).execute());
14721471
ensureGreen(indexName);

0 commit comments

Comments
 (0)