Skip to content

Commit fbfc45c

Browse files
committed
Ensure global checkpoint was advanced and synced
We need to make sure that the global checkpoints and peer recovery retention leases were advanced to the max_seq_no and synced; otherwise, we can risk expiring some peer recovery retention leases because of the file-based recovery threshold. Relates #49448
1 parent 2714c02 commit fbfc45c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/RecoveryIT.java

+1
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,7 @@ public void testOperationBasedRecovery() throws Exception {
750750
|| nodeName.startsWith(CLUSTER_NAME + "-0")
751751
|| (nodeName.startsWith(CLUSTER_NAME + "-1") && Booleans.parseBoolean(System.getProperty("tests.first_round")) == false));
752752
indexDocs(index, randomIntBetween(0, 100), randomIntBetween(0, 3));
753+
ensurePeerRecoveryRetentionLeasesRenewedAndSynced(index);
753754
}
754755
}
755756

test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java

+1
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,7 @@ public void ensurePeerRecoveryRetentionLeasesRenewedAndSynced(String index) thro
11291129
for (Map<String, ?> copy : shard) {
11301130
Integer globalCheckpoint = (Integer) XContentMapValues.extractValue("seq_no.global_checkpoint", copy);
11311131
assertNotNull(globalCheckpoint);
1132+
assertThat(XContentMapValues.extractValue("seq_no.max_seq_no", copy), equalTo(globalCheckpoint));
11321133
@SuppressWarnings("unchecked") List<Map<String, ?>> retentionLeases =
11331134
(List<Map<String, ?>>) XContentMapValues.extractValue("retention_leases.leases", copy);
11341135
if (retentionLeases == null) {

0 commit comments

Comments
 (0)