-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
BigtableUploadService: increment start_slot to prevent rechecks #33870
BigtableUploadService: increment start_slot to prevent rechecks #33870
Conversation
Codecov Report
@@ Coverage Diff @@
## master #33870 +/- ##
=========================================
- Coverage 81.8% 81.8% -0.1%
=========================================
Files 809 809
Lines 217824 217824
=========================================
- Hits 178387 178327 -60
- Misses 39437 39497 +60 |
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.
I was also following this issue.
The change looks good to me.
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.
Looks good to me and makes sense given that upload_confirmed_blocks()
is inclusive of ending_slot
:
solana/ledger/src/bigtable_upload.rs
Lines 61 to 67 in a799a90
let blockstore_slots: Vec<_> = blockstore | |
.rooted_slot_iterator(starting_slot) | |
.map_err(|err| { | |
format!("Failed to load entries starting from slot {starting_slot}: {err:?}") | |
})? | |
.take_while(|slot| *slot <= ending_slot) | |
.collect(); |
Increment start_slot (cherry picked from commit 22503f0)
…s (backport of solana-labs#33870) (solana-labs#33886) BigtableUploadService: increment start_slot to prevent rechecks (solana-labs#33870) Increment start_slot (cherry picked from commit 22503f0) Co-authored-by: Tyera <tyera@solana.com>
…s (backport of solana-labs#33870) (solana-labs#33886) BigtableUploadService: increment start_slot to prevent rechecks (solana-labs#33870) Increment start_slot (cherry picked from commit 22503f0) Co-authored-by: Tyera <tyera@solana.com>
Problem
Both
solana-ledger-tool bigtable upload
and the BigtableUploadService callsolana_ledger::bigtable_upload::upload_confirmed_blocks()
in a loop. However, they treat the return value (last slot checked) slightly differently.Ledger tool increments the value to start checking on a fresh slot:
solana/ledger-tool/src/bigtable.rs
Line 83 in 70107e2
The BigtableUploadService does not:
solana/ledger/src/bigtable_upload_service.rs
Line 120 in 70107e2
This means that the BigtablUploadService is rechecking the starting slot of a range on every iteration of the loop. It's probably not a lot of wasted work, but not nothing.
I don't think there is a specific reason the BigtableUploadService doesn't increment; I think I probably just missed it when putting together #26030
Summary of Changes
Add increment
Incidentally, this change should be enough to fix the infinite loop in #33831, but I still want to land the fix in #33861.