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

v2.0: Startup only sets latest_full_snapshot_slot if generating snapshots (backport of #3633) #3667

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

mergify[bot]
Copy link

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


This is an automatic backport of pull request #3633 done by Mergify.

…3633)

(cherry picked from commit 4ea10c2)

# Conflicts:
#	accounts-db/src/accounts_db.rs
#	ledger/src/bank_forks_utils.rs
@mergify mergify bot requested a review from a team as a code owner November 15, 2024 16:35
@mergify mergify bot added the conflicts label Nov 15, 2024
Copy link
Author

mergify bot commented Nov 15, 2024

Cherry-pick of 4ea10c2 has failed:

On branch mergify/bp/v2.0/pr-3633
Your branch is up to date with 'origin/v2.0'.

You are currently cherry-picking commit 4ea10c224a.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   accounts-db/src/accounts_db.rs
	both modified:   ledger/src/bank_forks_utils.rs

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

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

Comment on lines +815 to +816
// If we're not generating snapshots, ensure ABS's last full snapshot slot is None to
// ensure we handle zero lamport accounts correctly.

Choose a reason for hiding this comment

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

this comment implies that there is yet more implicit logic in this area? can we just eliminate it?

Choose a reason for hiding this comment

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

can we just eliminate it?

What is the "it" here?

@brooksprumo brooksprumo merged commit aab790b into v2.0 Nov 19, 2024
38 checks passed
@brooksprumo brooksprumo deleted the mergify/bp/v2.0/pr-3633 branch November 19, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants