mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
[MNT-24939] Reindexing rollback fix during on error conditions (#2241)
This commit is contained in:
+11
-1
@@ -315,7 +315,17 @@ public abstract class AbstractTracker implements Tracker
|
||||
|
||||
private void continueState()
|
||||
{
|
||||
infoSrv.continueState(state);
|
||||
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
|
||||
|
||||
+13
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user