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

Eviction scan fix #4173

Merged
merged 2 commits into from
Jan 30, 2024
Merged

Eviction scan fix #4173

merged 2 commits into from
Jan 30, 2024

Conversation

SirTyson
Copy link
Contributor

Description

Fixes a bug where more than maxEntriesToEvict would be evicted in a single ledger. Also adds an optimization where Buckets with protocol version < 20 are not scanned for eviction. This will improve eviction throughput in the short term after the initial upgrade.

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v8.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

Copy link
Contributor

@marta-lokhova marta-lokhova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just a few nits

@@ -925,6 +927,10 @@ Bucket::scanForEviction(AbstractLedgerTxn& ltx, EvictionIterator& iter,
bytesToScan = 0;
return true;
}
else if (maxEntriesToEvict == 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: rename to remianingEntriesToEvict for clarity? (there's a comment in Buckets.h as well)

if (isEmpty())
if (isEmpty() ||
protocolVersionIsBefore(getBucketVersion(shared_from_this()),
ProtocolVersion::V_20))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use SOROBAN_PROTOCOL_VERSION for clarity?

@marta-lokhova
Copy link
Contributor

r+ b2038d5

@latobarita latobarita merged commit 7324b22 into stellar:master Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants