Repository navigation
refactor: move snapshot IO options from AccountsDbConfig to SnapshotConfig - #12144
Conversation
Remove `bank_snapshots_dir` from `bank_from_snapshot_archives` and the three dir params from `bank_from_latest_snapshot_archives`; read them from the `snapshot_config` that is now threaded through both functions. `snapshot_config` is inserted before `genesis_config`.
02e4432 to
4f49934
Compare
4f49934 to
22b8ba3
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #12144 +/- ##
=========================================
- Coverage 83.4% 83.4% -0.1%
=========================================
Files 861 861
Lines 322807 322802 -5
=========================================
- Hits 269324 269299 -25
- Misses 53483 53503 +20 🚀 New features to boost your workflow:
|
brooksprumo
left a comment
There was a problem hiding this comment.
Looks straight forward overall. I agree about keeping the two commits together here. Having them separate was helpful for reviewing too, thanks!
| maximum_incremental_snapshot_archives_to_retain: | ||
| DEFAULT_MAX_INCREMENTAL_SNAPSHOT_ARCHIVES_TO_RETAIN, | ||
| use_direct_io: false, | ||
| use_registered_io_uring_buffers: true, |
There was a problem hiding this comment.
Noting that when use_registered_io_uring_buffers was in AccountsDbConfig, its default was false, whereas now here it's true.
Also noting that the ACCOUNTS_DB_CONFIG_FOR_TESTING set the value to true though too, so I think behavior is approximately the same as before.
There was a problem hiding this comment.
hm, right... though I guess after Steve's change we no longer use default for accounts db config anymore? maybe we can try to remove the derive
| maximum_full_snapshot_archives_to_retain: DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN, | ||
| maximum_incremental_snapshot_archives_to_retain: | ||
| DEFAULT_MAX_INCREMENTAL_SNAPSHOT_ARCHIVES_TO_RETAIN, | ||
| use_direct_io: false, |
There was a problem hiding this comment.
In the same vein, snapshots_use_direct_io used to be true in ACCOUNTS_DB_CONFIG_FOR_TESTING. Is there a reason to set the default here to false?
There was a problem hiding this comment.
ok, made both true by default except for test-validator (which maybe could use same values, but it didn't, so let's keep the same sematics for now)
and now I can see that impl Default for SnapshotConfig is probably going to have its TTL set soon ;)
Problem
Functions that load a bank from snapshot archives (
bank_from_snapshot_archives,bank_from_latest_snapshot_archives,bank_fields_from_snapshot_archives) accept explicit directory path parameters (bank_snapshots_dir,full_snapshot_archives_dir,incremental_snapshot_archives_dir) that are available on theSnapshotConfig, which can be passed to them directly.Having snapshot config at hand enables cleaning up IO options controlling direct I/O (
O_DIRECT) and io_uring buffer registration for snapshot operations, which are inAccountsDbConfigdespite only being relevant to preparing data for accounts-db during snapshot archive unpacking.Summary of Changes
SnapshotConfiginstead of explicit path params - removesbank_snapshots_dir,full_snapshot_archives_dir, andincremental_snapshot_archives_dirparameters frombank_from_snapshot_archives,bank_from_latest_snapshot_archives, andbank_fields_from_snapshot_archives; callers now pass&SnapshotConfigand the functions read paths directly from itAccountsDbConfigtoSnapshotConfiguse_direct_io: boolanduse_registered_io_uring_buffers: booltoSnapshotConfig(defaults:true/trueexcept test-validator)AccountsDbConfigand itsFOR_TESTING/FOR_BENCHMARKSconstantsvalidate_account_paths_for_direct_ioto takeuse_direct_io: booldirectly instead of&AccountsDbConfigSnapshotConfigin the validator, ledger-tool, and test-validator;io_setupconstruction insidebank_from_snapshot_archives/bank_fields_from_snapshot_archivesnow reads fromsnapshot_config(those could be split into 2 PRs, but since second commit provides context/motivation for the first, it should be fine to merge together)