Skip to content

Commit

Permalink
Fix condition for getting srcRecordInfo (use HasMainLogSrc instead of…
Browse files Browse the repository at this point in the history
… HeadAddress comparison).
  • Loading branch information
badrishc committed Mar 7, 2025
1 parent 9e1427e commit dac62d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ internal OperationStatus InternalRMW<TInput, TOutput, TContext, TSessionFunction
case LatchDestination.Retry:
goto LatchRelease;
case LatchDestination.CreateNewRecord:
if (stackCtx.recSrc.LogicalAddress >= hlogBase.HeadAddress)
if (stackCtx.recSrc.HasMainLogSrc)
srcRecordInfo = ref stackCtx.recSrc.GetInfo();

goto CreateNewRecord;

default:
Debug.Assert(latchDestination == LatchDestination.NormalProcessing, "Unknown latchDestination value; expected NormalProcessing");
break;
Expand Down Expand Up @@ -325,7 +325,7 @@ private LatchDestination CheckCPRConsistencyRMW(Phase phase, ref OperationStackC
if (IsRecordVersionNew(stackCtx.recSrc.LogicalAddress))
break; // Normal Processing; V+1 thread encountered a record in V+1

if (stackCtx.recSrc.LogicalAddress >= hlogBase.HeadAddress)
if (stackCtx.recSrc.HasMainLogSrc)
return LatchDestination.CreateNewRecord; // Record is in memory so force creation of a (V+1) record
break; // Normal Processing; the record is below HeadAddress so the operation will go pending

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ internal OperationStatus InternalUpsert<TInput, TOutput, TContext, TSessionFunct
case LatchDestination.Retry:
goto LatchRelease;
case LatchDestination.CreateNewRecord:
if (stackCtx.recSrc.LogicalAddress >= hlogBase.HeadAddress)
if (stackCtx.recSrc.HasMainLogSrc)
srcRecordInfo = ref stackCtx.recSrc.GetInfo();

goto CreateNewRecord;

default:
Debug.Assert(latchDestination == LatchDestination.NormalProcessing, "Unknown latchDestination value; expected NormalProcessing");
break;
Expand Down

0 comments on commit dac62d7

Please sign in to comment.