This repository was archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
BigtableUploadService: increment start_slot to prevent rechecks #33870
Merged
CriesofCarrots
merged 1 commit into
solana-labs:master
from
CriesofCarrots:btu-increment
Oct 26, 2023
Merged
BigtableUploadService: increment start_slot to prevent rechecks #33870
CriesofCarrots
merged 1 commit into
solana-labs:master
from
CriesofCarrots:btu-increment
Oct 26, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
ilya-bobyr
approved these changes
Oct 26, 2023
Contributor
ilya-bobyr
left a comment
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.
steviez
approved these changes
Oct 26, 2023
Contributor
steviez
left a comment
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(); |
mergify bot
pushed a commit
that referenced
this pull request
Oct 26, 2023
Increment start_slot (cherry picked from commit 22503f0)
CriesofCarrots
pushed a commit
that referenced
this pull request
Oct 26, 2023
…s (backport of #33870) (#33886) BigtableUploadService: increment start_slot to prevent rechecks (#33870) Increment start_slot (cherry picked from commit 22503f0) Co-authored-by: Tyera <[email protected]>
anwayde
pushed a commit
to firedancer-io/solana
that referenced
this pull request
Nov 16, 2023
…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 <[email protected]>
anwayde
pushed a commit
to firedancer-io/solana
that referenced
this pull request
Nov 16, 2023
…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 <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Both
solana-ledger-tool bigtable uploadand 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.