-
Notifications
You must be signed in to change notification settings - Fork 989
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
Eviction scan fix #4173
Conversation
There was a problem hiding this 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
src/bucket/Bucket.cpp
Outdated
@@ -925,6 +927,10 @@ Bucket::scanForEviction(AbstractLedgerTxn& ltx, EvictionIterator& iter, | |||
bytesToScan = 0; | |||
return true; | |||
} | |||
else if (maxEntriesToEvict == 0) |
There was a problem hiding this comment.
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)
src/bucket/Bucket.cpp
Outdated
if (isEmpty()) | ||
if (isEmpty() || | ||
protocolVersionIsBefore(getBucketVersion(shared_from_this()), | ||
ProtocolVersion::V_20)) |
There was a problem hiding this comment.
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?
27d30f4
to
b2038d5
Compare
r+ b2038d5 |
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
clang-format
v8.0.0 (viamake format
or the Visual Studio extension)