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
This commit is contained in:
Nhat Nguyen 2019-12-23 11:55:49 -05:00
parent 6a3d1a077e
commit 1dc98ad617
2 changed files with 2 additions and 0 deletions

View File

@ -750,6 +750,7 @@ public class RecoveryIT extends AbstractRollingTestCase {
|| nodeName.startsWith(CLUSTER_NAME + "-0")
|| (nodeName.startsWith(CLUSTER_NAME + "-1") && Booleans.parseBoolean(System.getProperty("tests.first_round")) == false));
indexDocs(index, randomIntBetween(0, 100), randomIntBetween(0, 3));
ensurePeerRecoveryRetentionLeasesRenewedAndSynced(index);
}
}

View File

@ -1142,6 +1142,7 @@ public abstract class ESRestTestCase extends ESTestCase {
for (Map<String, ?> copy : shard) {
Integer globalCheckpoint = (Integer) XContentMapValues.extractValue("seq_no.global_checkpoint", copy);
assertNotNull(globalCheckpoint);
assertThat(XContentMapValues.extractValue("seq_no.max_seq_no", copy), equalTo(globalCheckpoint));
@SuppressWarnings("unchecked") List<Map<String, ?>> retentionLeases =
(List<Map<String, ?>>) XContentMapValues.extractValue("retention_leases.leases", copy);
if (retentionLeases == null) {