Skip to content

Commit

Permalink
Make sure version switch is called for some checkpoint types
Browse files Browse the repository at this point in the history
  • Loading branch information
badrishc committed May 18, 2023
1 parent 8da1898 commit 3450702
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cs/src/core/Index/Synchronization/HybridLogCheckpointTask.cs
Expand Up @@ -148,6 +148,10 @@ internal sealed class FoldOverCheckpointTask : HybridLogCheckpointOrchestrationT
{
faster._lastSnapshotCheckpoint.Dispose();
}

if (next.Phase == Phase.IN_PROGRESS)
base.GlobalBeforeEnteringState(next, faster);

if (next.Phase != Phase.WAIT_FLUSH) return;

faster.hlog.ShiftReadOnlyToTail(out var tailAddress,
Expand Down Expand Up @@ -186,7 +190,7 @@ internal sealed class FoldOverCheckpointTask : HybridLogCheckpointOrchestrationT
if (ctx is not null)
ctx.prevCtx.markers[EpochPhaseIdx.WaitFlush] = true;
}

faster.epoch.Mark(EpochPhaseIdx.WaitFlush, current.Version);
if (faster.epoch.CheckIsComplete(EpochPhaseIdx.WaitFlush, current.Version))
faster.GlobalStateMachineStep(current);
Expand Down Expand Up @@ -288,7 +292,7 @@ internal sealed class SnapshotCheckpointTask : HybridLogCheckpointOrchestrationT
if (ctx is not null)
ctx.prevCtx.markers[EpochPhaseIdx.WaitFlush] = true;
}

faster.epoch.Mark(EpochPhaseIdx.WaitFlush, current.Version);
if (faster.epoch.CheckIsComplete(EpochPhaseIdx.WaitFlush, current.Version))
faster.GlobalStateMachineStep(current);
Expand All @@ -312,6 +316,9 @@ internal sealed class IncrementalSnapshotCheckpointTask : HybridLogCheckpointOrc
base.GlobalBeforeEnteringState(next, faster);
faster._hybridLogCheckpoint.prevVersion = next.Version;
break;
case Phase.IN_PROGRESS:
base.GlobalBeforeEnteringState(next, faster);
break;
case Phase.WAIT_FLUSH:
base.GlobalBeforeEnteringState(next, faster);
faster._hybridLogCheckpoint.info.finalLogicalAddress = faster.hlog.GetTailAddress();
Expand Down Expand Up @@ -381,7 +388,7 @@ internal sealed class IncrementalSnapshotCheckpointTask : HybridLogCheckpointOrc
if (ctx is not null)
ctx.prevCtx.markers[EpochPhaseIdx.WaitFlush] = true;
}

faster.epoch.Mark(EpochPhaseIdx.WaitFlush, current.Version);
if (faster.epoch.CheckIsComplete(EpochPhaseIdx.WaitFlush, current.Version))
faster.GlobalStateMachineStep(current);
Expand Down

0 comments on commit 3450702

Please sign in to comment.