Skip to content

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

Merged
brooksprumo merged 1 commit intoanza-xyz:masterfrom
brooksprumo:excessive-storages/add-old-slots-to-uncleaned-roots-after-revert
Nov 22, 2024
Merged

Marks old storages as dirty and uncleaned in clean_accounts()#3737
brooksprumo merged 1 commit intoanza-xyz:masterfrom
brooksprumo:excessive-storages/add-old-slots-to-uncleaned-roots-after-revert

Conversation

@brooksprumo
Copy link
Copy Markdown

@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
Copy Markdown

@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
@mergify
Copy link
Copy Markdown

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.

@mergify
Copy link
Copy Markdown

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
Copy Markdown
Author

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

Copy link
Copy Markdown

@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
Copy Markdown

@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
@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 <brooks@anza.xyz>
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 <brooks@anza.xyz>
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