Skip to content

Commit 162cf77

Browse files
committed
Add test for persistence after recovery
1 parent 9739244 commit 162cf77

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ public void testRetentionLeasesSyncOnRecovery() throws Exception {
368368
.getShardOrNull(new ShardId(resolveIndex("index"), 0));
369369
final Map<String, RetentionLease> retentionLeasesOnReplica = RetentionLeases.toMap(replica.getRetentionLeases());
370370
assertThat(retentionLeasesOnReplica, equalTo(currentRetentionLeases));
371+
372+
// check retention leases have been written on the replica; see RecoveryTarget#finalizeRecovery
373+
assertThat(currentRetentionLeases, equalTo(RetentionLeases.toMap(replica.loadRetentionLeases())));
371374
}
372375
}
373376

0 commit comments

Comments
 (0)