-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Experiment with removing zero lamport accounts from non-empty storages #19420
Conversation
} | ||
} | ||
no_delete | ||
assert_eq!(account_infos.len(), 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why account_infos.len(). would be = 1?
I thought the issue could be the pub key for some 0 lamports are not returned at all in construct_candidate_clean_keys and hence we will not catch them either.
Remember that we already decremented the ref counts here. So if it was 1 originally, it should be 0 here. |
Sorry but I didn't understand the command. Please consult the commands documentation 📚. Hey, I reacted but my real name is @Mergifyio |
466042e
to
69be52c
Compare
69be52c
to
d4dbdf1
Compare
while !pending_store_ids.is_empty() { | ||
let id = pending_store_ids.iter().next().cloned().unwrap(); | ||
pending_store_ids.remove(&id); | ||
if already_counted.contains(&id) { | ||
continue; | ||
} | ||
store_counts.get_mut(&id).unwrap().0 += 1; | ||
already_counted.insert(id); | ||
|
||
let affected_pubkeys = &store_counts.get(&id).unwrap().1; | ||
for key in affected_pubkeys { | ||
for (_slot, account_info) in &purges.get(key).unwrap().0 { | ||
if !already_counted.contains(&account_info.store_id) { | ||
pending_store_ids.insert(account_info.store_id); | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report
@@ Coverage Diff @@
## v1.7 #19420 +/- ##
=======================================
Coverage 82.3% 82.3%
=======================================
Files 436 436
Lines 123572 123549 -23
=======================================
- Hits 101746 101728 -18
+ Misses 21826 21821 -5 |
9d1299a
to
74957a8
Compare
Closed in favor of #19570 which will merge to master, as 1.7 has no urgency to be fixed currently |
Problem
As a refresher, we add keys to the candidate set on:
So a zero lamport key will never be cleaned if there ever is ever a scenario where:
I think this can happen if:
Summary of Changes
Remove zero lamport keys if ref_count is 1, even if the storage entry is not empty
Fixes #