Skip to content

Commit

Permalink
Use current term in initial leases in engine test (#38285)
Browse files Browse the repository at this point in the history
We need to use the current primary term instead of 1L for the initial
retention leases; otherwise, the primary term of the committed
retention leases won't match the current primary term if the
retention leases never gets updated.
  • Loading branch information
dnhatn authored Feb 11, 2019
1 parent 0cc8b12 commit ed73bb7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5297,7 +5297,6 @@ private void assertOperationHistoryInLucene(List<Engine.Operation> operations) t
}
}

@AwaitsFix(bugUrl="https://github.com/elastic/elasticsearch/pull/38285")
public void testKeepMinRetainedSeqNoByMergePolicy() throws IOException {
IOUtils.close(engine, store);
Settings.Builder settings = Settings.builder()
Expand All @@ -5309,7 +5308,8 @@ public void testKeepMinRetainedSeqNoByMergePolicy() throws IOException {
final AtomicLong globalCheckpoint = new AtomicLong(SequenceNumbers.NO_OPS_PERFORMED);
final long primaryTerm = randomLongBetween(1, Long.MAX_VALUE);
final AtomicLong retentionLeasesVersion = new AtomicLong();
final AtomicReference<RetentionLeases> retentionLeasesHolder = new AtomicReference<>(RetentionLeases.EMPTY);
final AtomicReference<RetentionLeases> retentionLeasesHolder = new AtomicReference<>(
new RetentionLeases(primaryTerm, retentionLeasesVersion.get(), Collections.emptyList()));
final List<Engine.Operation> operations = generateSingleDocHistory(true,
randomFrom(VersionType.INTERNAL, VersionType.EXTERNAL), 2, 10, 300, "2");
Randomness.shuffle(operations);
Expand Down

0 comments on commit ed73bb7

Please sign in to comment.