-
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
Accounts checkpoint is too slow and big #2499
Comments
So serde serialize/deserialize are not all that fast. Ideally we can use something like this
The VM would need a writable entry, so we could clone it to a new location or just copy it locally into a structure that has a Vec for userdata. @jackcmay is CoW in the VM easy to implement? |
I experimented a bit with sakridge@aea2639 I used |
I think this can be considered done.. @aeyakovenko do you agree? |
Problem
Overlayed accounts, see #2289, is going to be slow. Get requests require a check in every checkpoint before failing. For testnet-perf, each checkpoint is going to have a full copy of the accounts in memory, which is going to get really huge, so persistent storage might be necessary.
This proposes a single data structure for all the accounts and forks without a need to do the overlay merge/fork that #2289 is doing.
Proposed Solution
A data structure that allows for this mode of operation:
Lets call it AppendVec. The underlying memory can be memory mapped to a file if T is serializable. Multiple AppendVecs with a shared index will allow for concurrent commits without blocking reads, which will sequentially write to memory, ssd or disk, and should be as fast as the hardware allow for. The only required in memory data structure with a write lock is the index, which should be fast to update.
To garbage collect, data can be re-appended to defrag and truncated from the start.
The proposed AccountDB would allow for
AccountDB::acquire_append_storage() -> Arc<AppendVec<Account>>
So the latest commit for each fork entry would be indexed.
This might be a speedier way to write to the ledger too.
tag: @garious @sambley @rob-solana @carllin @sakridge
The text was updated successfully, but these errors were encountered: