-
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
Support opening an in-use rocksdb as secondary #10209
Support opening an in-use rocksdb as secondary #10209
Conversation
ledger-tool/src/main.rs
Outdated
@@ -873,7 +881,7 @@ fn main() { | |||
let starting_slot = value_t_or_exit!(arg_matches, "starting_slot", Slot); | |||
let allow_dead_slots = arg_matches.is_present("allow_dead_slots"); | |||
output_ledger( | |||
open_blockstore(&ledger_path), | |||
open_blockstore(&ledger_path, AccessType::AllowSecondary), |
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.
TODO: carefully audit for the appropriate AccessType for all of subcommands.
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.
Done, I've tested all the subcommands and they worked as intended.
@mvines FYI, I found graph
to be very useful to create a graph right from a still running validator's ledger. :)
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.
totally, this is gonna be yuuuuge!
|
CI is broken... ;) |
TODO: maybe don't fallback by default; instead explicit |
This looks very promising, thanks @ryoqun |
3be691a
to
e88a3c9
Compare
Codecov Report
@@ Coverage Diff @@
## master #10209 +/- ##
=========================================
- Coverage 81.3% 81.3% -0.1%
=========================================
Files 288 288
Lines 67000 67135 +135
=========================================
+ Hits 54510 54603 +93
- Misses 12490 12532 +42 |
I've tested enough. Be confident to start using the secondary fallback by default. |
1042882
to
890e823
Compare
@mvines This is ready for review!! :) |
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.
It looks like solana-validator
opens with AccessType::OnlyPrimary
(Blockstore::open_with_signal
)?
ledger/src/blockstore.rs
Outdated
Self::do_open_with_signal(ledger_path, AccessType::OnlyPrimary) | ||
} | ||
|
||
pub fn open_with_signal_with_access_type( |
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.
pub fn open_with_signal_with_access_type( | |
pub fn open_with_signal_and_access_type( |
@mvines Yeah, I deliberately do so because...:
|
Co-authored-by: Michael Vines <[email protected]>
automerge (cherry picked from commit caa7f7a) # Conflicts: # ledger-tool/Cargo.toml # ledger-tool/src/main.rs
automerge (cherry picked from commit caa7f7a)
Problem
it seems that the rocksdb's notorious limitation is now lifted: facebook/rocksdb#4899 ㊗️
Maybe our bitter experience caused blindness for the rocksdb; it's certainly improving. ;)
Summary of Changes
Fallback to secondary access when primary failed from
ledget-tool
's read-only subcommands.solana-validator
and other subcommands behavior hasn't been changed.This realizes to run
create-snapshot
while a validator is running and other various debugging subcommands.PS: I know my half-backed
ledger-tool
pr #9490 is laying around... Sorry for our longer pr queue. ;) I thought this worth to interrupt. :)