Skip to content

Commit

Permalink
Make sure object log segment offets are written out to the recovery i…
Browse files Browse the repository at this point in the history
…nfo in RelaxedCPR mode.
  • Loading branch information
badrishc committed Jan 13, 2020
1 parent 518a133 commit 796a837
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cs/src/core/Index/Recovery/Checkpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,6 @@ private bool GlobalMoveToNextState(SystemState currentState, SystemState nextSta
}
case Phase.WAIT_PENDING:
{
var seg = hlog.GetSegmentOffsets();
if (seg != null)
{
_hybridLogCheckpoint.info.objectLogSegmentOffsets = new long[seg.Length];
Array.Copy(seg, _hybridLogCheckpoint.info.objectLogSegmentOffsets, seg.Length);
}
MakeTransition(intermediateState, nextState);
break;
}
Expand All @@ -252,6 +246,13 @@ private bool GlobalMoveToNextState(SystemState currentState, SystemState nextSta
_hybridLogCheckpoint.info.headAddress = hlog.HeadAddress;
_hybridLogCheckpoint.info.beginAddress = hlog.BeginAddress;

var seg = hlog.GetSegmentOffsets();
if (seg != null)
{
_hybridLogCheckpoint.info.objectLogSegmentOffsets = new long[seg.Length];
Array.Copy(seg, _hybridLogCheckpoint.info.objectLogSegmentOffsets, seg.Length);
}

if (FoldOverSnapshot)
{
hlog.ShiftReadOnlyToTail(out long tailAddress);
Expand Down

0 comments on commit 796a837

Please sign in to comment.