|
@@ -5419,7 +5419,6 @@ public class InternalEngineTests extends EngineTestCase {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/36470")
|
|
|
public void testRebuildLocalCheckpointTracker() throws Exception {
|
|
|
Settings.Builder settings = Settings.builder()
|
|
|
.put(defaultSettings.getSettings())
|
|
@@ -5453,19 +5452,20 @@ public class InternalEngineTests extends EngineTestCase {
|
|
|
docs = getDocIds(engine, true);
|
|
|
}
|
|
|
trimUnsafeCommits(config);
|
|
|
- List<Engine.Operation> safeCommit = null;
|
|
|
+ Set<Long> seqNosInSafeCommit = null;
|
|
|
for (int i = commits.size() - 1; i >= 0; i--) {
|
|
|
if (commits.get(i).stream().allMatch(op -> op.seqNo() <= globalCheckpoint.get())) {
|
|
|
- safeCommit = commits.get(i);
|
|
|
+ seqNosInSafeCommit = commits.get(i).stream().map(Engine.Operation::seqNo).collect(Collectors.toSet());
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- assertThat(safeCommit, notNullValue());
|
|
|
+ assertThat(seqNosInSafeCommit, notNullValue());
|
|
|
try (InternalEngine engine = new InternalEngine(config)) { // do not recover from translog
|
|
|
final LocalCheckpointTracker tracker = engine.getLocalCheckpointTracker();
|
|
|
for (Engine.Operation op : operations) {
|
|
|
- assertThat("seq_no=" + op.seqNo() + " max_seq_no=" + tracker.getMaxSeqNo() +
|
|
|
- " checkpoint=" + tracker.getCheckpoint(), tracker.contains(op.seqNo()), equalTo(safeCommit.contains(op)));
|
|
|
+ assertThat(
|
|
|
+ "seq_no=" + op.seqNo() + " max_seq_no=" + tracker.getMaxSeqNo() + "checkpoint=" + tracker.getCheckpoint(),
|
|
|
+ tracker.contains(op.seqNo()), equalTo(seqNosInSafeCommit.contains(op.seqNo())));
|
|
|
}
|
|
|
engine.initializeMaxSeqNoOfUpdatesOrDeletes();
|
|
|
engine.recoverFromTranslog(translogHandler, Long.MAX_VALUE);
|