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

Minor eviction scan bugfix #3916

Merged
merged 1 commit into from
Sep 8, 2023
Merged
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: 3 additions & 1 deletion src/bucket/Bucket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -873,14 +873,15 @@ Bucket::scanForEviction(AbstractLedgerTxn& ltx, EvictionIterator& iter,
auto expirationKey = getExpirationKey(le);
auto shouldEvict = [&] {
auto entryLtxe = ltx.loadWithoutRecord(LedgerEntryKey(le));
auto expirationLtxe = ltx.loadWithoutRecord(expirationKey);
if (!entryLtxe)
{
// Entry was already deleted either manually or by an
// earlier eviction scan, do nothing
releaseAssert(!expirationLtxe);
return false;
}

auto expirationLtxe = ltx.loadWithoutRecord(expirationKey);
releaseAssert(expirationLtxe);

return !isLive(expirationLtxe.current(), ledgerSeq);
Expand All @@ -905,6 +906,7 @@ Bucket::scanForEviction(AbstractLedgerTxn& ltx, EvictionIterator& iter,
if (bytesRead >= bytesToScan)
{
// Reached end of scan region
bytesToScan = 0;
return true;
}

Expand Down