[MNT-24939] Reindexing rollback fix during on error conditions (#2241)

This commit is contained in:
tathagta15
2026-03-17 13:10:40 +05:30
committed by GitHub
parent 77c126b54c
commit 73217c0ea3
2 changed files with 24 additions and 1 deletions
@@ -314,8 +314,18 @@ public abstract class AbstractTracker implements Tracker
}
private void continueState()
{
/*
* If a rollback is pending then skip advancing the tracker state to avoid
* continueState() jumping the commit time forward and skipping historical
* transactions. We still increment trackerCycles so the checkRepoAndIndexConsistency where initial repo/index consistency
* check is not triggered again after every rollback.
*/
if (!this.rollback)
{
infoSrv.continueState(state);
}
state.incrementTrackerCycles();
}
@@ -405,4 +405,17 @@ public class MetadataTrackerTest
verify(this.metadataTracker, times(1)).doTrack("AnIterationId");
}
@Test
public void trackDoesNotAdvanceStateWhenRollbackIsPending() throws Exception
{
TrackerState state = new TrackerState();
metadataTracker.state = state;
metadataTracker.setRollback(true, new RuntimeException("simulated 403 error"));
metadataTracker.track();
verify(srv, never()).continueState(any());
assertEquals(1L, state.getTrackerCycles());
}
}