struct AccountsToCombine<'a> {
accounts_keep_slots: HashMap<Slot, AliveAccounts<'a>>,
accounts_to_combine: Vec<ShrinkCollect<'a, ShrinkCollectAliveSeparatedByRefs<'a>>>,
target_slots_sorted: Vec<Slot>,
}
Expand description
hold all alive accounts to be shrunk and/or combined
Fields§
§accounts_keep_slots: HashMap<Slot, AliveAccounts<'a>>
slots and alive accounts that must remain in the slot they are currently in because the account exists in more than 1 slot in accounts db This hashmap contains an entry for each slot that contains at least one account with ref_count > 1. The value of the entry is all alive accounts in that slot whose ref_count > 1. Any OTHER accounts in that slot whose ref_count = 1 are in ‘accounts_to_combine’ because they can be moved to any slot. We want to keep the ref_count > 1 accounts by themselves, expecting the multiple ref_counts will be resolved soon and we can clean the duplicates up (which maybe THIS one).
accounts_to_combine: Vec<ShrinkCollect<'a, ShrinkCollectAliveSeparatedByRefs<'a>>>
all the rest of alive accounts that can move slots and should be combined This includes all accounts with ref_count = 1 from the slots in ‘accounts_keep_slots’. There is one entry here for each storage we are processing. Even if all accounts are in ‘accounts_keep_slots’.
target_slots_sorted: Vec<Slot>
slots that contain alive accounts that can move into ANY other ancient slot these slots will NOT be in ‘accounts_keep_slots’ Some of these slots will have ancient append vecs created at them to contain everything in ‘accounts_to_combine’ The rest will become dead slots with no accounts in them.