File tree 1 file changed +4
-1
lines changed
test/framework/src/main/java/org/elasticsearch/index/engine
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -827,6 +827,10 @@ public static void assertConsistentHistoryBetweenTranslogAndLuceneIndex(Engine e
827
827
if (mapper .documentMapper () == null || engine .config ().getIndexSettings ().isSoftDeleteEnabled () == false ) {
828
828
return ;
829
829
}
830
+ final long maxSeqNo = ((InternalEngine ) engine ).getLocalCheckpointTracker ().getMaxSeqNo ();
831
+ if (maxSeqNo < 0 ) {
832
+ return ; // nothing to check
833
+ }
830
834
final Map <Long , Translog .Operation > translogOps = new HashMap <>();
831
835
try (Translog .Snapshot snapshot = EngineTestCase .getTranslog (engine ).newSnapshot ()) {
832
836
Translog .Operation op ;
@@ -838,7 +842,6 @@ public static void assertConsistentHistoryBetweenTranslogAndLuceneIndex(Engine e
838
842
.collect (Collectors .toMap (Translog .Operation ::seqNo , Function .identity ()));
839
843
final long globalCheckpoint = EngineTestCase .getTranslog (engine ).getLastSyncedGlobalCheckpoint ();
840
844
final long retainedOps = engine .config ().getIndexSettings ().getSoftDeleteRetentionOperations ();
841
- long maxSeqNo = Math .max (0 , ((InternalEngine )engine ).getLocalCheckpointTracker ().getMaxSeqNo ());
842
845
final long seqNoForRecovery ;
843
846
try (Engine .IndexCommitRef safeCommit = engine .acquireSafeIndexCommit ()) {
844
847
seqNoForRecovery = Long .parseLong (safeCommit .getIndexCommit ().getUserData ().get (SequenceNumbers .LOCAL_CHECKPOINT_KEY )) + 1 ;
You can’t perform that action at this time.
0 commit comments