Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix calls to TraceBack to use returned addresses correctly #781

Merged
merged 2 commits into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cs/src/core/Index/Common/FasterKVSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ public override string ToString()
internal long GetIndexSizeCacheLines()
{
long adjustedSize = Utility.PreviousPowerOf2(IndexSize);
if (adjustedSize < 64)
throw new FasterException($"{nameof(IndexSize)} should be at least of size one cache line (64 bytes)");
if (adjustedSize < 512)
throw new FasterException($"{nameof(IndexSize)} should be at least of size 8 cache line (512 bytes)");
if (IndexSize != adjustedSize)
logger?.LogInformation($"Warning: using lower value {adjustedSize} instead of specified {IndexSize} for {nameof(IndexSize)}");
return adjustedSize / 64;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal Status InternalContainsKeyInMemory<Input, Output, Context, FasterSessio
if (recordInfo.Invalid || !comparer.Equals(ref key, ref hlog.GetKey(physicalAddress)))
{
logicalAddress = recordInfo.PreviousAddress;
TraceBackForKeyMatch(ref key, logicalAddress, fromAddress, out _, out logicalAddress);
TraceBackForKeyMatch(ref key, logicalAddress, fromAddress, out logicalAddress, out _);
}

if (logicalAddress < fromAddress)
Expand Down
2 changes: 1 addition & 1 deletion cs/src/core/Index/FASTER/Implementation/ContinuePending.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ internal OperationStatus InternalTryCopyToTail<Input, Output, Context, FasterSes
if (ri.Invalid || !comparer.Equals(ref key, ref hlog.GetKey(physicalAddress)))
{
logicalAddress = ri.PreviousAddress;
TraceBackForKeyMatch(ref key, logicalAddress, hlog.HeadAddress, out physicalAddress, out logicalAddress);
TraceBackForKeyMatch(ref key, logicalAddress, hlog.HeadAddress, out logicalAddress, out physicalAddress);
}

if (logicalAddress > untilLogicalAddress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal OperationStatus InternalModifiedBitOperation(ref Key key, out RecordInf
if (recordInfo.Invalid || !comparer.Equals(ref key, ref hlog.GetKey(physicalAddress)))
{
logicalAddress = recordInfo.PreviousAddress;
TraceBackForKeyMatch(ref key, logicalAddress, hlog.HeadAddress, out physicalAddress, out logicalAddress);
TraceBackForKeyMatch(ref key, logicalAddress, hlog.HeadAddress, out logicalAddress, out physicalAddress);
}
}
#endregion
Expand Down
2 changes: 1 addition & 1 deletion cs/src/core/Index/FASTER/Implementation/ReadCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ private bool EnsureNoMainLogRecordWasAddedDuringReadCacheInsert(ref Key key, Rec
// Someone added a new record in the splice region. It won't be readcache; that would've been added at tail. See if it's our key.
// We want this whether it's Tentative or not, so don't wait for Tentative.
var minAddress = untilLogicalAddress > hlog.HeadAddress ? untilLogicalAddress : hlog.HeadAddress;
if (TraceBackForKeyMatch(ref key, lowest_rcri.PreviousAddress, minAddress + 1, out _, out long prevAddress, waitForTentative: false))
if (TraceBackForKeyMatch(ref key, lowest_rcri.PreviousAddress, minAddress + 1, out long prevAddress, out _, waitForTentative: false))
success = false;
else if (prevAddress > untilLogicalAddress && prevAddress < hlog.HeadAddress)
{
Expand Down