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

Startup only sets latest_full_snapshot_slot if generating snapshots #3633

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

brooksprumo
Copy link

@brooksprumo brooksprumo commented Nov 14, 2024

Problem

AccountsDb uses the latest full snapshot slot to gate how much, and what, to clean/etc. The latest full snapshot slot is updated every time a new full snapshot is taken.

If snapshots are disabled, then the latest full snapshot slot is never updated, and we cannot purge zero lamport accounts past the latest full snapshot slot.

The accounts-db code is aware of this though. If latest_full_snapshot_slot is None, we can clean everything. Yay!

The problem is that we always set the latest full snapshot slot at startup to Some, thus we never clean zero lamport accounts past the startup full snapshot slot!

Summary of Changes

If we're not generating snapshots, the latest full snapshot slot should be None.

@brooksprumo brooksprumo self-assigned this Nov 14, 2024
@brooksprumo brooksprumo marked this pull request as ready for review November 14, 2024 16:53
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.

maybe backport to 2.0?

@brooksprumo
Copy link
Author

maybe backport to 2.0?

Yes, we'll backport to v2.1 and v.20

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. wow. good catch.

@brooksprumo brooksprumo added v2.0 Backport to v2.0 branch v2.1 Backport to v2.1 branch labels Nov 15, 2024
@brooksprumo brooksprumo merged commit 4ea10c2 into anza-xyz:master Nov 15, 2024
42 checks passed
Copy link

mergify bot commented Nov 15, 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 15, 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.

mergify bot pushed a commit that referenced this pull request Nov 15, 2024
…3633)

(cherry picked from commit 4ea10c2)

# Conflicts:
#	accounts-db/src/accounts_db.rs
#	ledger/src/bank_forks_utils.rs
mergify bot pushed a commit that referenced this pull request Nov 15, 2024
@brooksprumo brooksprumo deleted the latest-full-snapshot-slot branch November 15, 2024 16:43
brooksprumo added a commit that referenced this pull request Nov 17, 2024
…hots (backport of #3633) (#3668)

Startup only sets latest_full_snapshot_slot if generating snapshots (#3633)

(cherry picked from commit 4ea10c2)

Co-authored-by: Brooks <brooks@anza.xyz>
brooksprumo added a commit that referenced this pull request Nov 19, 2024
…hots (backport of #3633) (#3667)

* Startup only sets latest_full_snapshot_slot if generating snapshots (#3633)

(cherry picked from commit 4ea10c2)

# Conflicts:
#	accounts-db/src/accounts_db.rs
#	ledger/src/bank_forks_utils.rs

* fix backport 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
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