Skip to content

Commit 9feff98

Browse files
committed
CCR side of #31213
Relates #31213
1 parent afe02a3 commit 9feff98

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ public void testForceMergeWithSoftDeletesRetention() throws Exception {
13611361
liveDocs.add(doc.id());
13621362
}
13631363
}
1364-
long localCheckpoint = engine.getLocalCheckpointTracker().getCheckpoint();
1364+
long localCheckpoint = engine.getLocalCheckpoint();
13651365
globalCheckpoint.set(randomLongBetween(0, localCheckpoint));
13661366
engine.getTranslog().sync();
13671367
engine.forceMerge(true, 1, false, false, false);
@@ -1427,7 +1427,7 @@ public void testForceMergeWithSoftDeletesRetentionAndRecoverySource() throws Exc
14271427
liveDocs.add(doc.id());
14281428
}
14291429
}
1430-
long localCheckpoint = engine.getLocalCheckpointTracker().getCheckpoint();
1430+
long localCheckpoint = engine.getLocalCheckpoint();
14311431
globalCheckpoint.set(randomLongBetween(0, localCheckpoint));
14321432
engine.getTranslog().sync();
14331433
long keptIndex = globalCheckpoint.get() + 1 - retainedExtraOps;

server/src/test/java/org/elasticsearch/index/engine/LuceneChangesSnapshotTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ class Follower extends Thread {
236236
}
237237

238238
void pullOperations(Engine follower) throws IOException {
239-
long leaderCheckpoint = leader.getLocalCheckpointTracker().getCheckpoint();
240-
long followerCheckpoint = follower.getLocalCheckpointTracker().getCheckpoint();
239+
long leaderCheckpoint = leader.getLocalCheckpoint();
240+
long followerCheckpoint = follower.getLocalCheckpoint();
241241
if (followerCheckpoint < leaderCheckpoint) {
242242
long fromSeqNo = followerCheckpoint + 1;
243243
long batchSize = randomLongBetween(0, 100);
@@ -255,7 +255,7 @@ public void run() {
255255
readLatch.countDown();
256256
readLatch.await();
257257
while (isDone.get() == false ||
258-
follower.getLocalCheckpointTracker().getCheckpoint() < leader.getLocalCheckpointTracker().getCheckpoint()) {
258+
follower.getLocalCheckpointTracker().getCheckpoint() < leader.getLocalCheckpoint()) {
259259
pullOperations(follower);
260260
}
261261
assertConsistentHistoryBetweenTranslogAndLuceneIndex(follower, mapperService);

test/framework/src/main/java/org/elasticsearch/index/engine/EngineTestCase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ public static Set<String> getDocIds(Engine engine, boolean refresh) throws IOExc
802802
*/
803803
public static List<Translog.Operation> readAllOperationsInLucene(Engine engine, MapperService mapper) throws IOException {
804804
final List<Translog.Operation> operations = new ArrayList<>();
805-
long maxSeqNo = Math.max(0, engine.getLocalCheckpointTracker().getMaxSeqNo());
805+
long maxSeqNo = Math.max(0, ((InternalEngine)engine).getLocalCheckpointTracker().getMaxSeqNo());
806806
try (Translog.Snapshot snapshot = engine.newLuceneChangesSnapshot("test", mapper, 0, maxSeqNo, false)) {
807807
Translog.Operation op;
808808
while ((op = snapshot.next()) != null){
@@ -838,7 +838,7 @@ public static void assertConsistentHistoryBetweenTranslogAndLuceneIndex(Engine e
838838
.collect(Collectors.toMap(Translog.Operation::seqNo, Function.identity()));
839839
final long globalCheckpoint = engine.getTranslog().getLastSyncedGlobalCheckpoint();
840840
final long retainedOps = engine.config().getIndexSettings().getSoftDeleteRetentionOperations();
841-
final long maxSeqNo = engine.getLocalCheckpointTracker().getMaxSeqNo();
841+
long maxSeqNo = Math.max(0, ((InternalEngine)engine).getLocalCheckpointTracker().getMaxSeqNo());
842842
for (Translog.Operation translogOp : translogOps.values()) {
843843
final Translog.Operation luceneOp = luceneOps.get(translogOp.seqNo());
844844
if (luceneOp == null) {

0 commit comments

Comments
 (0)