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 @@ -838,6 +838,10 @@ public static void assertConsistentHistoryBetweenTranslogAndLuceneIndex(Engine e
838
838
if (mapper .types ().isEmpty () || engine .config ().getIndexSettings ().isSoftDeleteEnabled () == false ) {
839
839
return ;
840
840
}
841
+ final long maxSeqNo = ((InternalEngine ) engine ).getLocalCheckpointTracker ().getMaxSeqNo ();
842
+ if (maxSeqNo < 0 ) {
843
+ return ; // nothing to check
844
+ }
841
845
final Map <Long , Translog .Operation > translogOps = new HashMap <>();
842
846
try (Translog .Snapshot snapshot = EngineTestCase .getTranslog (engine ).newSnapshot ()) {
843
847
Translog .Operation op ;
@@ -849,7 +853,6 @@ public static void assertConsistentHistoryBetweenTranslogAndLuceneIndex(Engine e
849
853
.collect (Collectors .toMap (Translog .Operation ::seqNo , Function .identity ()));
850
854
final long globalCheckpoint = EngineTestCase .getTranslog (engine ).getLastSyncedGlobalCheckpoint ();
851
855
final long retainedOps = engine .config ().getIndexSettings ().getSoftDeleteRetentionOperations ();
852
- long maxSeqNo = Math .max (0 , ((InternalEngine )engine ).getLocalCheckpointTracker ().getMaxSeqNo ());
853
856
final long seqNoForRecovery ;
854
857
try (Engine .IndexCommitRef safeCommit = engine .acquireSafeIndexCommit ()) {
855
858
seqNoForRecovery = Long .parseLong (safeCommit .getIndexCommit ().getUserData ().get (SequenceNumbers .LOCAL_CHECKPOINT_KEY )) + 1 ;
You can’t perform that action at this time.
0 commit comments