From 5f49689f920d3aa477ed81f5923a53516fc49f02 Mon Sep 17 00:00:00 2001 From: jeff washington Date: Tue, 14 Mar 2023 17:35:26 -0500 Subject: [PATCH] throttle writes to occur one bucket at a time --- runtime/src/bucket_map_holder.rs | 2 ++ runtime/src/in_mem_accounts_index.rs | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/runtime/src/bucket_map_holder.rs b/runtime/src/bucket_map_holder.rs index aca0b0e57a9656..d7184859987019 100644 --- a/runtime/src/bucket_map_holder.rs +++ b/runtime/src/bucket_map_holder.rs @@ -68,6 +68,8 @@ pub struct BucketMapHolder + Into> /// Note startup is an optimization and is not required for correctness. startup: AtomicBool, _phantom: PhantomData, + + pub(crate) write_active: AtomicBool, } impl + Into> Debug for BucketMapHolder { diff --git a/runtime/src/in_mem_accounts_index.rs b/runtime/src/in_mem_accounts_index.rs index 5b80a83d18fea0..6ee6e4606d9c6e 100644 --- a/runtime/src/in_mem_accounts_index.rs +++ b/runtime/src/in_mem_accounts_index.rs @@ -1128,7 +1128,10 @@ impl + Into> InMemAccountsIndex + Into> InMemAccountsIndex