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
wip: eliminate accounts index arc and rwlock #18452
Conversation
b45eb86
to
d44228a
Compare
|
Index generation metrics: |
|
index READ metrics for reading every item in all storages in parallel: |
runtime/src/accounts_index.rs
Outdated
| true | ||
| } | ||
| }; | ||
| let w_account_maps = self.get_account_maps_write_lock(pubkey); |
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.
Primary concerns here are:
-
If a set of hotly updated pubkeys end up in the same bin, this could cause a performance degradation, especially if people are grinding for certain vanity pubkeys.
A good benchmark of this would be to generate a bunch of keys with the same first byte so they end up in the same bin, then run a set of transfers from those keys to another set of keys, and compare the perf to master. -
Contention with lookups in clean:
. The larger the active set grows, the more keys will need to be cleaned in every root, which means it's likely a significant number of keys per bin will need to be cleaned every iteration. For example if we assume the set of dirty keys per clean interval (100 slots) issolana/runtime/src/accounts_db.rs
Line 1809 in a64ad36
match self.accounts_index.get(pubkey, None, max_clean_root) { 100,000, then we will have in estimation100,000 / number of binsconflicting keys with the main replay index update here. This could be an issue if you are trying to update a key in a particular bin that is also currently being used by clean, which should happen every1/number of binsupdates, so likely at least once in a slot if there's an ongoing clean. Ideally in these cases replay would be prioritized over clean, but there's no guarantee of that. -
RPC lookups (not even scans) for existing accounts like
get_balanceorget_accountcan no longer run concurrently with updates, so a lot of RPC lookups may starve progress here. This would be another good thing to try with an RPC node. I think Stephen has set up a bench for this in the past to test RPC scan + index contention, which we could repurpose for other RPC queries.
The metric to look at for contention would be accounts_db_store_timings::update_index
c523204
to
2f3e99e
Compare
Codecov Report
@@ Coverage Diff @@
## master #18452 +/- ##
=========================================
- Coverage 82.8% 82.8% -0.1%
=========================================
Files 444 444
Lines 126568 126614 +46
=========================================
+ Hits 104859 104888 +29
- Misses 21709 21726 +17 |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
|
This stale pull request has been automatically closed. Thank you for your contributions. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
|
This stale pull request has been automatically closed. Thank you for your contributions. |
Problem
Prototyping moving to a disk-based accounts index. Working on 1B accounts. The disk-based accounts index model relies on higher level account index locks instead of locks per entry. Much more research to be done.
Summary of Changes
Eliminate arc and rwlock on slotlist. This results in more lock contention. But, recently we enabled binning of the accounts index. More bins means less lock contention.
Fixes #