Skip to content

Commit 1dc98ad

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 6a3d1a0 commit 1dc98ad

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
@@ -1142,6 +1142,7 @@ public void ensurePeerRecoveryRetentionLeasesRenewedAndSynced(String index) thro
11421142
for (Map<String, ?> copy : shard) {
11431143
Integer globalCheckpoint = (Integer) XContentMapValues.extractValue("seq_no.global_checkpoint", copy);
11441144
assertNotNull(globalCheckpoint);
1145+
assertThat(XContentMapValues.extractValue("seq_no.max_seq_no", copy), equalTo(globalCheckpoint));
11451146
@SuppressWarnings("unchecked") List<Map<String, ?>> retentionLeases =
11461147
(List<Map<String, ?>>) XContentMapValues.extractValue("retention_leases.leases", copy);
11471148
if (retentionLeases == null) {

0 commit comments

Comments
 (0)