-
Notifications
You must be signed in to change notification settings - Fork 973
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
Convert live entries to init entries in lowest level of bucketlist #4492
base: master
Are you sure you want to change the base?
Conversation
3dc4da6
to
3956cd5
Compare
@SirTyson can you PTAL? |
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.
Overall LGTM. Just one logic cleanup and I think a higher level test would be more helpful here vs. a low level one.
a03be99
to
9a6176c
Compare
9a6176c
to
5d69fa4
Compare
4fbd14d
to
0e8f83b
Compare
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.
Sorry, I think I was a little unclear in my last comment. A little cleanup on the interface, and I think the test case still needs improving.
src/bucket/test/BucketListTests.cpp
Outdated
@@ -521,6 +522,22 @@ TEST_CASE_VERSIONS("live bucket tombstones expire at bottom level", | |||
REQUIRE(e0.nDead != 0); | |||
REQUIRE(e1.nDead != 0); | |||
REQUIRE(e2.nDead == 0); | |||
if (protocolVersionStartsFrom( |
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.
This doesn't actually test our fix. The problem is, in old bucketlist code that has long since been fixed, live entries where written to the bottom level. The current code doesn't exhibit this behavior. What you're testing here is if the current BucketList logic works, but not that your conversion code from the buggy BucketList -> good bucketlist actually works. What we should do is populate a BucketList, but specifically populate it with buggy contents such that the bottom level has live entries (see "live bucket tombstones expire at bottom level" for populating a bucketList without addBatch
). Then, add empty batched to your BucketList until all entries have coallesced in the bottom bucket (see "hot archive bucket tombstones expire at bottom level" for this example). Finally, scan the bottom bucket and make sure they're all init.
df3dc32
to
70bce90
Compare
0276edd
to
cacef0b
Compare
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.
Test looks great! One issue that I didn't notice (until your test case, which was super helpful), we need to gate this feature on protocol 23. Currently, we gate on FIRST_PROTOCOL_SUPPORTING_INITENTRY_AND_METAENTRY
, which is before p23. This means catchup will fail, as we'll change the bucket hashes for p22 for example. We need to add a new constexpr, like FIRST_PROTOCOL_CONVERTING_BOTTOM_LEVEL_LIVE_TO_INIT
or something like that which is equal to 23. Sorry I didn't catch this before!
cacef0b
to
994087f
Compare
Head branch was pushed to by a user without write access
994087f
to
85381f5
Compare
@SirTyson I had to rebase, can you re-enable automerge? |
Description
Resolves #193
Changes
BucketOutputIterator::put
to convertLIVEENTRY
toINITENTRY
in the lowest level ofLiveBucket
s.Checklist
clang-format
v8.0.0 (viamake format
or the Visual Studio extension)