-
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
Create bank snapshots #3671
Create bank snapshots #3671
Conversation
@sakridge, could you check on how this is looking |
Codecov Report
@@ Coverage Diff @@
## master #3671 +/- ##
========================================
+ Coverage 79.6% 79.7% +0.1%
========================================
Files 155 156 +1
Lines 24930 25266 +336
========================================
+ Hits 19855 20148 +293
- Misses 5075 5118 +43 |
Codecov Report
@@ Coverage Diff @@
## master #3671 +/- ##
========================================
+ Coverage 78.3% 78.5% +0.2%
========================================
Files 165 166 +1
Lines 28549 29133 +584
========================================
+ Hits 22368 22891 +523
- Misses 6181 6242 +61 |
@@ -16,7 +16,8 @@ pub trait BloomHashIndex { | |||
#[derive(Serialize, Deserialize, Default, Clone, Debug, PartialEq)] | |||
pub struct Bloom<T: BloomHashIndex> { | |||
pub keys: Vec<u64>, | |||
pub bits: BitVec<u8>, | |||
pub bits: BitVec<u64>, | |||
num_bits_set: u64, |
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.
Do we use this anywhere?
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.
its being used in crds gossip push and pull
1a9aaa6
to
a96876d
Compare
158c2d8
to
4d9845e
Compare
Is this PR still being worked on? |
@mvines, yes I am working on this one. |
@sambley I think scan + getting the root from blocktree should get you there |
@aeyakovenko, currently the frozen set of banks (32) are serialized (added/removed as they are pruned) with the serialized data containing the path to the append vec and when deserializing the accounts is restored back by pointing to the appropriate append vec. When you are referring to scan + getting root from blocktree, are you referring to the above or a different mechanism. |
https://github.com/solana-labs/solana/blob/master/runtime/src/accounts_db.rs#L196 There are examples of usage in accounts.rs. But basically the appendvec stores a single fork, so booting the checkpoint just means scanning all the vecs and reconstructing the index based on write_version. |
333eaf1
to
0fa5b6e
Compare
@aeyakovenko, currently AccountsIndex get serialized / deserialized and should restore back the index on deserialize. The bank snapshot are added / removed with below logic. Do you see any issue with this? |
@sambley, it doesn't need to be. if we recover from scanning the storage, we can also GC it in that step and recreate the index. Serializing the index adds another level of complexity, since it's hard to make sure the index is in sync with storage. |
2892e4c
to
44a6d31
Compare
runtime/Cargo.toml
Outdated
@@ -20,7 +20,7 @@ log = "0.4.2" | |||
memmap = "0.6.2" | |||
rand = "0.6.5" | |||
rayon = "1.0.0" | |||
serde = "1.0.88" | |||
serde = { version = "1.0.88", features = ["rc"] } |
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 looks like it might be a really nasty thing to turn on...
https://serde.rs/feature-flags.html#-features-rc
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 will work on serializing / deserializing with out having to turn on this feature.
@sambley so my goal with using AppendVec data directly without a saved index is that the bank can recover from a killed process, and the index can be fresh, basically garbage collected from boot. |
Yes, I will work on that as well to not have to serialize the index and instead recover from the appendvec. Still looking into an issue with the continuation once the bank snapshots are restored. |
003a4a0
to
deb5108
Compare
This reverts commit abf2b30.
sorry, Sathish: I fat-fingered the merge button |
* Revert "Revert "Create bank snapshots (#3671)" (#4243)" This reverts commit 81fa69d. * keep saved and unsaved copies of status cache * fix format check * bench for status cache serialize * misc cleanup * remove appendvec storage on purge * fix accounts restore * cleanup * Pass snapshot path as args * Fix clippy
* Remove SVM's dependency on vote crate * remove dep from json-rpc example * use callback to get epoch vote stake
* Remove SVM's dependency on vote crate * remove dep from json-rpc example * use callback to get epoch vote stake
Problem
Full node startup is slow when many transactions have been processed as this involved querying for the full ledger and replaying it.
Summary of Changes
Serialize bank state into a snapshot and try to restore from that on boot.
Fixes #2475