From d7974e1c610c137e96fb1968401236bf0b54b333 Mon Sep 17 00:00:00 2001 From: jeff washington Date: Tue, 13 Dec 2022 16:08:38 -0600 Subject: [PATCH 1/2] fix tests broken by add_root change --- runtime/src/accounts_db.rs | 1 + runtime/src/accounts_index.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 6c528f01bc77a4..6f058ac90ee1e0 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -17970,6 +17970,7 @@ pub mod tests { db.storage.map.insert(slot0, Arc::default()); assert!(!db.bank_hashes.read().unwrap().is_empty()); db.accounts_index.add_root(slot0); + db.accounts_index.add_uncleaned_roots([slot0].into_iter()); assert!(db.accounts_index.is_uncleaned_root(slot0)); assert!(db.accounts_index.is_alive_root(slot0)); db.handle_dropped_roots_for_ancient(dropped_roots); diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index e9413c5d842a2d..a4aa01c462bc67 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -3139,6 +3139,7 @@ pub mod tests { assert_eq!(0, index.roots_tracker.read().unwrap().uncleaned_roots.len()); index.add_root(0); index.add_root(1); + index.add_uncleaned_roots([0, 1].into_iter()); assert_eq!(2, index.roots_tracker.read().unwrap().uncleaned_roots.len()); assert_eq!( @@ -3165,6 +3166,7 @@ pub mod tests { index.add_root(2); index.add_root(3); + index.add_uncleaned_roots([2, 3].into_iter()); assert_eq!(4, index.roots_tracker.read().unwrap().alive_roots.len()); assert_eq!(2, index.roots_tracker.read().unwrap().uncleaned_roots.len()); assert_eq!( From 2a9bea34eb97b25f9455d704f68cc030046257b4 Mon Sep 17 00:00:00 2001 From: jeff washington Date: Tue, 13 Dec 2022 13:43:45 -0600 Subject: [PATCH 2/2] remove rebuild_bank_from_snapshots(caching_enabled) --- runtime/src/snapshot_utils.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index 2ffa4a24120c38..11f349040d6c3b 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -1003,7 +1003,6 @@ pub fn bank_from_snapshot_archives( debug_keys, additional_builtins, account_secondary_indexes, - true, // caching_enabled limit_load_slot_count_from_snapshot, shrink_ratio, verify_index, @@ -1788,8 +1787,6 @@ fn rebuild_bank_from_snapshots( debug_keys: Option>>, additional_builtins: Option<&Builtins>, account_secondary_indexes: AccountSecondaryIndexes, - // this parameter will be removed when all plumbing for disabling write cache is removed - _accounts_db_caching_enabled: bool, limit_load_slot_count_from_snapshot: Option, shrink_ratio: AccountShrinkThreshold, verify_index: bool,