Skip to content

disable read cache while populating stakes cache on load#482

Merged
jeffwashington merged 6 commits intoanza-xyz:masterfrom
jeffwashington:4m18
Mar 29, 2024
Merged

disable read cache while populating stakes cache on load#482
jeffwashington merged 6 commits intoanza-xyz:masterfrom
jeffwashington:4m18

Conversation

@jeffwashington
Copy link
Copy Markdown

Problem

stakes cache reads tons of accounts. These fill up the read cache. We then spend time evicting all these accounts, which hurts performance of startup and tx processing.

Summary of Changes

skip populating the read cache while loading stake accounts.

Fixes #

@jeffwashington jeffwashington marked this pull request as ready for review March 28, 2024 22:30
Comment thread accounts-db/src/accounts_db.rs Outdated
Comment thread accounts-db/src/accounts_db.rs Outdated
@jeffwashington jeffwashington changed the title dsiable read cache while populating stakes cache on load disable read cache while populating stakes cache on load Mar 28, 2024
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.8%. Comparing base (e261e27) to head (f566b04).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master     #482     +/-   ##
=========================================
- Coverage    81.8%    81.8%   -0.1%     
=========================================
  Files         842      842             
  Lines      228436   228442      +6     
=========================================
- Hits       187063   187026     -37     
- Misses      41373    41416     +43     

@alessandrod
Copy link
Copy Markdown

Adding the disable_read_cache_updates field seems fine for this use case, but how about adding it as an explicit parameter to some load_account*() variant? Tx execution will likely want something like this too to implement #180, and there I don't think we can set a db-global bool

@brooksprumo
Copy link
Copy Markdown

[..] how about adding it as an explicit parameter to some load_account*() variant?

This also sounds good to me.

HaoranYi
HaoranYi previously approved these changes Mar 29, 2024
Copy link
Copy Markdown

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.
It is a tradeoff. I like the simplicity of this change, which will be easy to backport.

@brooksprumo
Copy link
Copy Markdown

[..] which will be easy to backport.

Probably not a candidate to backport. v1.18 is rolling out to mnb very soon. So we should only be backporting critical bug fixes. More details in Discord: https://discord.com/channels/428295358100013066/439194979856809985/1222663250206789673.

Comment thread runtime/src/bank.rs Outdated
Comment thread accounts-db/src/accounts_db.rs Outdated
Copy link
Copy Markdown

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jeffwashington jeffwashington merged commit 18c32ab into anza-xyz:master Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants