-
Notifications
You must be signed in to change notification settings - Fork 890
Rework and optimize AccountIndexIterator #4729
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
Conversation
1b9589c to
4ed42d0
Compare
4ed42d0 to
1bfd02e
Compare
|
I have been running this PR for the past 3 days on mainnet with out any issues. |
1bfd02e to
0fe2226
Compare
|
I pushed a commit to fix the conflicts after rebasing to master. |
|
I kinda feel that the sorted vs unsorted iterators are fundamentally different enough where we could (should?) have two separate iterator types and implementations. Wdyt? |
yes. i think it is good idea. |
be2f7b3 to
33a74c6
Compare
56078ca to
9cfe2ab
Compare
9cfe2ab to
7ae7553
Compare
|
@brooksprumo can you help to review this PR again? |
Sure, will do! |
brooksprumo
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 need to go through the core of the implementation still. There's some code organization that is making the review a bit challenging for me in Github. I'll pull the code locally and see if that helps.
|
@brooksprumo I pushed a commit to implement sorted/unsorted iterator in a different way. Can you take a look again? thanks! |
I like this direction. Can we go one step further and remove |
|
ok. pushed another change to remove the trait and unshare the common code between two types of iterators. let me know wdyt. |
brooksprumo
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.
Wow, ok, I've spent a lot of time staring at all this. Sorry for all the refactor/nit questions/comments. Let me know your thoughts on how to proceed. Some things of the code currently in master feel broken and I'm not sure if/when/where to fix it all.
|
pushed one more commit to save two copies of pubkey in hold_range_in memory. After inlining the hold_range_in memory, we already have a ref of Range. so we can use |
|
one more change on the iterator to take ref of pubkey range instead of copy. |
|
After #4729 is merged, we can optimize the account index iterator more by using the |
|
Sorry - I'm missing context. What is the problem? Soon, we'll stop iterating during rent collection. Who else does these index scans? |
On mnb activation schedule: skip rewrites is #3 and stop collecting rent is #4. |
Yes, it is correct. There is another SIMD, which exclude rent_epoch field changes in rent scan. When that SIMD be active, we can then safely disable rent scan. The account index iterator is used for account range scan, which is used by RPC method to scan accounts from index. We have received complains from rpc admins about account's scan is slow. |
|
These are the relevant SIMDS for disable rent scan. |
|
@brooksprumo Iast week, I rework the PR in a different direction. |
2aebfe1 to
34b9bbd
Compare
brooksprumo
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.
Can the PR description be updated with the new direction this PR has gone?
5190652 to
295bca1
Compare
done. |
|
@HaoranYi Are you running this current version on mnb? Can you share relevant perf info, please? |
59c9a3d to
1bed279
Compare
I have started running this pr on shared-dev11. will report the perf info soon. |
brooksprumo
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.
![]()
This looks right to me!
|
I have been running and monitoring this PR on dev11. It has been running for 1 epoch and all major matrices are normal. |
Problem
AccountIndexIterator has several issues.
Therefore, we would like to rework and optimize the code.
Summary of Changes
AccountIndexIteratortoAccountIndex. This reflects the appropriate ownership of bin maps byAccountIndex.u32::maxas a proxy for the actual bin map count has been eliminated, preventing potential inaccuracies and errors. The iterator layer should not be responsible for knowing the total number of binmaps.hold_range_in_memoryRelocation:hold_range_in_memoryfunction has been moved fromAccountIndexIteratortoAccountIndex, aligning its location with the appropriate level of abstraction.Fixes #