Skip to content

Commit 7f7a927

Browse files
authored
Avoid creating a green index in RetentionLeaseIT (#39347)
In #39224 we made shard history retention lease syncing ignore the `index.write.wait_for_active_shards` setting on the index, and added a test that showed that it was ignored. However the test as merged actually creates a green index, so the `wait_for_active_shards` setting has no effect. This change adjusts the test to create a yellow index to verify that `wait_for_active_shards` really is ignored.
1 parent 413ce1c commit 7f7a927

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/test/java/org/elasticsearch/index/seqno/RetentionLeaseIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ private void runWaitForShardsTest(
551551
final int numDataNodes = internalCluster().numDataNodes();
552552
final Settings settings = Settings.builder()
553553
.put("index.number_of_shards", 1)
554-
.put("index.number_of_replicas", numDataNodes == 1 ? 0 : numDataNodes - 1)
554+
.put("index.number_of_replicas", numDataNodes)
555555
.put(IndexService.RETENTION_LEASE_SYNC_INTERVAL_SETTING.getKey(), TimeValue.timeValueSeconds(1))
556556
.build();
557557
assertAcked(prepareCreate("index").setSettings(settings));
@@ -570,7 +570,7 @@ private void runWaitForShardsTest(
570570
primary.addRetentionLease(idForInitialRetentionLease, initialRetainingSequenceNumber, source, listener);
571571
latch.await();
572572

573-
final String waitForActiveValue = randomBoolean() ? "all" : Integer.toString(numDataNodes);
573+
final String waitForActiveValue = randomBoolean() ? "all" : Integer.toString(numDataNodes + 1);
574574

575575
client()
576576
.admin()

0 commit comments

Comments
 (0)