behzad nouri
4ec5ea6f7b
replaces assert!(matches!(...)) with assert_matches!(...) ( #33068 )
...
assert_matches!(...) provides more informative error message when it
fails and it is part of nightly rust:
https://doc.rust-lang.org/std/assert_matches/macro.assert_matches.html
2023-08-30 13:48:27 -04:00
Brooks
f9bc3cec24
Renames SnapshotType to SnapshotKind ( #32906 )
2023-08-19 19:55:29 -04:00
Pankaj Garg
f4287d70bb
Move accounts-db code to its own crate ( #32766 )
2023-08-09 13:03:36 -07:00
Brooks
16ec9a68c9
Unzips Option when deserializing snapshot data files ( #32652 )
2023-07-28 15:21:22 -04:00
Pankaj Garg
aba637d5d9
Split snapshot_utils.rs into snapshot_bank_utils.rs ( #32612 )
2023-07-24 16:31:03 -07:00
Brooks
de4ff348b4
Removes manual call to `.0.display()` with thiserror ( #32605 )
2023-07-24 12:02:55 -04:00
Brooks
faa002c2b6
Adds error types for all of `add_bank_snapshot()` ( #32564 )
2023-07-20 18:30:19 -04:00
Brooks
979913e1d5
Returns Self instead of Result<Self> for AccountsPackage::new_for_snapshot() ( #32545 )
2023-07-20 12:52:31 -04:00
Brooks
6d30429dd1
Replaces `unwrap` with `?` when writing snapshot version file ( #32542 )
2023-07-19 16:42:46 -04:00
Brooks
3c825f28a5
Uses next_back() ( #32478 )
2023-07-13 13:38:18 -04:00
Brooks
9fb105c801
Cleanup impl for remove_tmp_snapshot_archives() ( #32297 )
2023-06-27 15:51:28 -04:00
Brooks
13aff74f82
Cleanup filesystem error handling in snapshot_utils ( #32286 )
2023-06-27 13:08:47 -04:00
Brooks
4547549a73
Uses fs_err instead of SnapshotError::IoWithSourceAndFile ( #32267 )
2023-06-26 17:10:21 -04:00
steviez
77b587aa4d
Add constant for disabled snapshot interval ( #32236 )
...
Slot::MAX was used to specify that a type of snapshots should not be
created; define a constant to be that value and reference the constant
to have a single point of edit.
2023-06-26 12:26:56 -05:00
Brooks
95fae285a4
Introduces fs_err to snapshot_utils ( #32266 )
2023-06-26 13:14:27 -04:00
Brooks
394fc9b8fc
Adds "archive" to log when loading snapshot archives ( #32278 )
2023-06-26 12:32:28 -04:00
Brooks
814ea7ae9f
Removes file permission twiddling in snapshot test ( #32277 )
2023-06-26 12:17:14 -04:00
Brooks
644cdaaa48
Adds comments in BankSnapshotInfo::new_from_dir() when selecting Pre or Post ( #32261 )
2023-06-26 11:53:25 -04:00
Brooks
4fb6bbf92e
Refactors datapoints and logs in bank_from_xxx fns ( #32255 )
2023-06-26 11:33:58 -04:00
Andrew Fitzgerald
4a566ec938
create and canonicalize account_paths ( #32037 )
...
Co-authored-by: Brooks <brooks@prumo.org>
2023-06-09 10:04:25 -07:00
Brooks
afbb0fa92f
Removes init-time cleanup in add_bank_snapshot() ( #31997 )
2023-06-09 08:30:35 -04:00
Andrew Fitzgerald
3ba05d9c3d
Fix move_and_async_delete_path ( #32020 )
2023-06-08 10:55:52 -07:00
steviez
4b2db0d546
Add explaining comment for Err case in get_bank_snapshots() ( #31998 )
2023-06-08 12:54:24 -05:00
Brooks
ddbc35fcc3
Add logging to move_and_async_delete_path ( #32017 )
2023-06-07 16:31:16 -04:00
Brooks
f08fb3e158
Downgrades log to debug if reading bank snapshot from dir fails ( #31990 )
2023-06-06 15:07:45 -04:00
steviez
858ea5a143
chore: Add name string for bank_serialize measure! ( #31926 )
...
The measurement is later logged, so include a name to more clearly
identify what the measurement was.
2023-06-02 06:54:04 -05:00
steviez
debe794987
Replace improper &Arc<...> with Arc<...> in Bank and Accounts ( #31892 )
...
The callstack updated in this PR passed an &Arc<...> down only to have
the bottom level clone the reference. Thus, we are giving shared
ownership so the reference is a bit redundant and arguably obscures the
intention to clone further down the callstack.
2023-05-31 12:36:44 -05:00
Brooks
8e191bbc56
Downgrades log to warn if reading bank snapshot from dir fails ( #31885 )
2023-05-30 19:35:06 -04:00
Brooks
8a3f446db0
Removes MAX_BANK_SNAPSHOTS_TO_RETAIN constant ( #31827 )
2023-05-25 17:13:28 -04:00
Andrew Fitzgerald
f52ded35f4
async delete contents but leave directory ( #31737 )
...
* async delete contents but leave directory
* Clarified comment
2023-05-23 15:33:09 -07:00
Brooks
61afb07dbd
Purges old bank snapshots at startup ( #31656 )
...
Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
2023-05-23 13:18:05 -04:00
Yueh-Hsuan Chiang
c79a6e74e2
Add new error type AccountsFileError ( #31631 )
...
#### Problem
AccountsFile- and AppendVec-related code uses io::Error for their main error type. However, there're many errors under AccountsFile that don't belong to io::Error.
#### Summary of Changes
This PR introduces AccountsFileError and makes minimum changes to keep the PR small.
Subsequent changes related to this will be in separate PRs.
2023-05-22 14:09:09 -07:00
Alexander Meißner
520c647918
Refactor - Merges `BuiltinPrograms` into `LoadedPrograms` ( #31654 )
...
* Merges BuiltinPrograms into LoadedPrograms.
* Prevents built-ins from being pruned.
2023-05-18 22:18:28 +02:00
Brooks
8e5e66fdb4
Revert "Revert "SnapshotPackagerService purges old bank snapshots ( #31511 )" ( #31524 )" ( #31558 )
...
This reverts commit 775639c058
.
2023-05-12 15:39:14 -04:00
Brooks
7dbcf5a0fd
Do not remove bank snapshots in new_from_dir() ( #31556 )
2023-05-12 13:19:07 -04:00
Jeff Washington (jwash)
122b05b9f5
pass include_slot_in_hash through hash calcs to allow rehashing if hash is not stored ( #31579 )
...
* pass include_slot_in_hash through hash calcs to allow rehashing
* tests use each include_slot_in_hash value
* move include_slot_in_hash
* typo
* reorder struct init
* spelling is hard
2023-05-11 13:23:29 -07:00
Brooks
3bb2e3b546
Purges incomplete snapshot dirs at startup ( #31555 )
2023-05-09 14:08:12 -04:00
Brooks
775639c058
Revert "SnapshotPackagerService purges old bank snapshots ( #31511 )" ( #31524 )
...
This reverts commit a6c39ded8e
.
2023-05-06 09:18:03 -04:00
Brooks
a6c39ded8e
SnapshotPackagerService purges old bank snapshots ( #31511 )
2023-05-05 17:22:48 -04:00
Brooks
39a092c3dc
Adds snapshot_utils::purge_bank_snapshot() ( #31500 )
...
Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
2023-05-05 14:01:08 -04:00
Brooks
c7d922f229
Uses SNAPSHOT_VERSION_FILENAME constant ( #31508 )
2023-05-05 14:00:08 -04:00
Brooks
1d861ad558
Removes solana_logger from snapshot_utils unit tests ( #31510 )
2023-05-05 12:52:36 -04:00
Brooks
10b8b32a31
Uses SNAPSHOT_ARCHIVE_DOWNLOAD_DIR constant ( #31507 )
2023-05-05 12:36:32 -04:00
Brooks
ab6094a94f
Uses SNAPSHOT_ACCOUNTS_HARDLINKS constant ( #31499 )
2023-05-05 12:36:21 -04:00
Brooks
4196dbcbf4
Replaces snapshot_utils::remove_bank_snapshot() ( #31498 )
2023-05-05 07:43:28 -04:00
Brooks
0e0c91faac
Adds snapshot_utils::purge_bank_snapshot() ( #31497 )
2023-05-04 19:19:26 -04:00
Brooks
fdf7bdae1a
Fixes name of snapshot_utils::get_bank_snapshot_dir() ( #31432 )
2023-05-01 19:28:35 +00:00
Xiang Zhu
0a2e897f16
Clean up the outdated SnapshotPackage snapshot_links field ( #31360 )
...
* Remove snapshot_links
* Change the function name from snapshot_dir to bank_snapshot_dir
* Format fix
* Fix test_concurrent_snapshot_packaging
* Fix clippy error
* Fix nits
* Fix nits 2nd try
* Use get_bank_snapshots_dir
* Use slot_dir
* Revert "Use get_bank_snapshots_dir" because get_bank_snapshots_dir is private to crate
This reverts commit 1ed9b3b2c8e84689a918beee7159f63c56500a96.
2023-05-01 11:24:59 -07:00
steviez
1a995ade3f
Combine multiple snapshot_utils metrics ( #31406 )
...
Within the contents of snapshot_utils::add_bank_snapshot(), metrics were
being reported in several datapoints and counters. This adds extra
overhead, and makes it harder to correlate fields that correspond to the
same snapshot.
So, combine the counters and multiple datapoints into a single
datapoint.
2023-04-30 16:36:08 -04:00
Xiang Zhu
bb95d44328
Check incomplete file flag first ( #31409 )
...
* Check incomplete file flag first
* Use the simple is_file call, no need for metadata
2023-04-28 15:44:59 -07:00