Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

unref accounts from destroyed forks#19402

Closed
jeffwashington wants to merge 2 commits intosolana-labs:v1.6from
jeffwashington:non-clean-1.6_jwash2
Closed

unref accounts from destroyed forks#19402
jeffwashington wants to merge 2 commits intosolana-labs:v1.6from
jeffwashington:non-clean-1.6_jwash2

Conversation

@jeffwashington
Copy link
Copy Markdown
Contributor

@jeffwashington jeffwashington commented Aug 24, 2021

Problem

@sakridge 's original pr:
#19398

Summary of Changes

Fixes #

@jeffwashington jeffwashington changed the base branch from master to v1.6 August 24, 2021 18:43
@jeffwashington jeffwashington changed the title Non clean 1.6 jwash2 unref accounts from destroyed forks Aug 24, 2021

for s in &all_removed_slot_storages {
for (_store_id, store) in s.read().unwrap().iter() {
if !store.unref_done.swap(true, Ordering::Relaxed) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@sakridge here's my first attempt. All tests pass with the exception of a race condition I'm debugging in:
test_store_scan_consistency_unrooted

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see. So if we may go through the unref path twice in some cases. This would prevent that by keeping a bool per store to prevent it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

All runtime tests now pass locally. I wasn't handling AccountStorageEntry::recycle.

for slot in dead_slots.iter() {
if let Some(slot_storage) = self.storage.get_slot_stores(*slot) {
for store in slot_storage.read().unwrap().values() {
let already_unrefd = store.unref_done.swap(true, Ordering::Relaxed);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@sakridge here's the other path I found.

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 24, 2021

Codecov Report

Merging #19402 (97e1193) into v1.6 (45e3cd3) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@           Coverage Diff           @@
##             v1.6   #19402   +/-   ##
=======================================
  Coverage    82.2%    82.3%           
=======================================
  Files         423      423           
  Lines      118114   118176   +62     
=======================================
+ Hits        97197    97265   +68     
+ Misses      20917    20911    -6     

@jeffwashington
Copy link
Copy Markdown
Contributor Author

#19406 #19407
running ci for 1.7 and master

@jeffwashington
Copy link
Copy Markdown
Contributor Author

we believe @carllin has a 1.7 solution for this that he will back port to 1.6. I have separated the test out for consideration separately in 1.7 and master.

@carllin
Copy link
Copy Markdown
Contributor

carllin commented Aug 25, 2021

Here is the proposed backport: #19414. It was a bit of a messy merge as there are quite a few fixes on 1.7 that had not been backported to 1.6

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants