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

Marks old storages as dirty and uncleaned in clean_accounts() #3737

Conversation

brooksprumo
Copy link

@brooksprumo brooksprumo commented Nov 21, 2024

Problem

Copied from #3702

We do not clean up old storages.

More context: when calculating a full accounts hash, we call mark_old_slots_as_dirty() as a way to ensure we do not forget or miss cleaning up really old storages (i.e. ones that are older than an epoch old). But, when we enable skipping rewrites, we don't want to clean up those old storages, as they'll intentionally be treated as ancient append vecs. So inside mark_old_slots_as_dirty() we conditionally mark old slots as dirty. This is based on the value of ancient_append_vec_offset, which should be None unless ancient append vecs are enabled.

Unfortunately, normal running validators, we end up never marking old slots as dirty, because the ancient append vec offset is always Some. And thus we don't clean up old storages.

Summary of Changes

Mark old storages as dirty, and add to the uncleaned roots list in clean_accounts().

We still check if ancient append vecs are enabled, but not with the ancient_append_vec_offset. Instead we look at the skipping rewrites feature gate and the cli arg.

By moving this marking into clean_accounts(), we also decouple it from accounts hash calculation, which is not necessary anymore. This also removes behavioral differences based on if snapshots are enabled or not.

jeffwashington
jeffwashington previously approved these changes Nov 22, 2024
Copy link

@jeffwashington jeffwashington left a comment

Choose a reason for hiding this comment

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

lgtm

@brooksprumo brooksprumo force-pushed the excessive-storages/add-old-slots-to-uncleaned-roots-after-revert branch from 8ba7606 to 132b2f4 Compare November 22, 2024 15:19
@brooksprumo brooksprumo added v2.0 Backport to v2.0 branch v2.1 Backport to v2.1 branch labels Nov 22, 2024
Copy link

mergify bot commented Nov 22, 2024

Backports to the stable branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule.

Copy link

mergify bot commented Nov 22, 2024

Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis.

@brooksprumo brooksprumo marked this pull request as ready for review November 22, 2024 15:30
@brooksprumo
Copy link
Author

Force-pushed to rebase now that #3735 has merged. No code changes were done.

Copy link

@jeffwashington jeffwashington left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

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

lgtm

@brooksprumo brooksprumo merged commit 31742ca into anza-xyz:master Nov 22, 2024
43 checks passed
@brooksprumo brooksprumo deleted the excessive-storages/add-old-slots-to-uncleaned-roots-after-revert branch November 22, 2024 18:03
mergify bot pushed a commit that referenced this pull request Nov 22, 2024
(cherry picked from commit 31742ca)

# Conflicts:
#	accounts-db/src/accounts_db.rs
#	accounts-db/src/accounts_db/tests.rs
#	runtime/src/bank.rs
mergify bot pushed a commit that referenced this pull request Nov 22, 2024
(cherry picked from commit 31742ca)

# Conflicts:
#	accounts-db/src/accounts_db/tests.rs
brooksprumo added a commit that referenced this pull request Nov 25, 2024
…backport of #3737) (#3748)

* Marks old storages as dirty and uncleaned in clean_accounts() (#3737)

(cherry picked from commit 31742ca)

# Conflicts:
#	accounts-db/src/accounts_db/tests.rs

* fixes merge conflict

---------

Co-authored-by: Brooks <[email protected]>
brooksprumo added a commit that referenced this pull request Nov 25, 2024
…backport of #3737) (#3747)

* Marks old storages as dirty and uncleaned in clean_accounts() (#3737)

(cherry picked from commit 31742ca)

# Conflicts:
#	accounts-db/src/accounts_db.rs
#	accounts-db/src/accounts_db/tests.rs
#	runtime/src/bank.rs

* fixup merge conflict

---------

Co-authored-by: Brooks <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2.0 Backport to v2.0 branch v2.1 Backport to v2.1 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants