Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoganand Rajasekaran committed Apr 18, 2024
1 parent 497a1e7 commit 4d5fbb7
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions libs/storage/Tsavorite/cs/src/core/Index/Recovery/Recovery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ private void RecoverHybridLog(long scanFromAddress, long recoverFromAddress, lon
// We make an extra pass to clear locks when reading every page back into memory
ClearLocksOnPage(p, options);

ProcessReadPage(recoverFromAddress, untilAddress, nextVersion, options, recoveryStatus, endPage, capacity, numPagesToReadFirst, p, pageIndex);
ProcessReadPageAndFlush(recoverFromAddress, untilAddress, nextVersion, options, recoveryStatus, p, pageIndex);
}
}

Expand Down Expand Up @@ -705,7 +705,7 @@ private async ValueTask RecoverHybridLogAsync(long scanFromAddress, long recover
// We make an extra pass to clear locks when reading every page back into memory
ClearLocksOnPage(p, options);

ProcessReadPage(recoverFromAddress, untilAddress, nextVersion, options, recoveryStatus, endPage, capacity, numPagesToReadFirst, p, pageIndex);
ProcessReadPageAndFlush(recoverFromAddress, untilAddress, nextVersion, options, recoveryStatus, p, pageIndex);
}
}

Expand All @@ -729,7 +729,7 @@ private RecoveryStatus GetPageRangesToRead(long scanFromAddress, long untilAddre
return new RecoveryStatus(capacity, capacity - hlog.MinEmptyPageCount, endPage, untilAddress, checkpointType);
}

private void ProcessReadPage(long recoverFromAddress, long untilAddress, long nextVersion, RecoveryOptions options, RecoveryStatus recoveryStatus, long endPage, int capacity, int numPagesToRead, long page, int pageIndex)
private void ProcessReadPageAndFlush(long recoverFromAddress, long untilAddress, long nextVersion, RecoveryOptions options, RecoveryStatus recoveryStatus, long page, int pageIndex)
{
if (ProcessReadPage(recoverFromAddress, untilAddress, nextVersion, options, recoveryStatus, page, pageIndex))
{
Expand Down Expand Up @@ -1063,13 +1063,6 @@ private void AsyncFlushPageCallbackForRecovery(uint errorCode, uint numBytes, ob
{
int pageIndex = hlog.GetPageIndexForPage(result.page);

// If full capacity cannot be utilized, free the page to ensure memory size constraint is maintained
if (result.page + result.context.usableCapacity < result.context.endPage &&
result.context.usableCapacity < result.context.capacity)
{
hlog.FreePage(result.page);
}

if (errorCode != 0)
result.context.SignalFlushedError(pageIndex);
else
Expand Down

0 comments on commit 4d5fbb7

Please sign in to comment.