Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix finalize_dead_slot_removal() of cached slots decrementing refcount #15534

Merged
merged 2 commits into from
Feb 27, 2021

Conversation

carllin
Copy link
Contributor

@carllin carllin commented Feb 25, 2021

Problem

finalize_dead_slot_removal() decrements the ref count of deleted account for cached slots, even though the ref count was never incremented for accounts in the cache anyways.

Summary of Changes

Don't decrement the ref count when purging dead cached slots

Fixes #

@codecov
Copy link

codecov bot commented Feb 25, 2021

Codecov Report

Merging #15534 (95144f2) into master (b8f1ffb) will decrease coverage by 0.0%.
The diff coverage is 86.5%.

@@            Coverage Diff            @@
##           master   #15534     +/-   ##
=========================================
- Coverage    80.2%    80.2%   -0.1%     
=========================================
  Files         406      406             
  Lines      103911   104179    +268     
=========================================
+ Hits        83374    83587    +213     
- Misses      20537    20592     +55     

@@ -3946,17 +3946,19 @@ impl AccountsDb {
&'a self,
dead_slots_iter: impl Iterator<Item = &'a Slot> + Clone,
purged_slot_pubkeys: HashSet<(Slot, Pubkey)>,
mut purged_account_slots: Option<&mut AccountSlots>,
// If the slot being are not cached, return
is_cached: Option<&mut AccountSlots>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits: keep original var name? This paused me a whil because the type isn't bool.

@carllin carllin merged commit 97eaf3c into solana-labs:master Feb 27, 2021
mergify bot pushed a commit that referenced this pull request Feb 27, 2021
mergify bot added a commit that referenced this pull request Feb 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants