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

validators always skip clean/shrink on startup #30710

Merged
merged 2 commits into from
Mar 14, 2023

Conversation

jeffwashington
Copy link
Contributor

@jeffwashington jeffwashington commented Mar 14, 2023

Problem

See
discord discussion

When starting a validator, we currently skip startup clean and shrink if the snapshot was generated locally. As of 1.13 or 1.14?, we now start accounts background service much earlier in the startup process. Accounts background service does a clean and shrink concurrently with tx processing.

Note that clean is probably slower with a disk index than without. This synchronous clean thus has a bigger penalty on startup when disk index is enabled.

Summary of Changes

Always skip the synchronous initial clean/shrink on validator startup. Make the cli arg obsolete.

Fixes #

@jeffwashington jeffwashington marked this pull request as ready for review March 14, 2023 16:06
brooksprumo
brooksprumo previously approved these changes Mar 14, 2023
Comment on lines 1192 to 1193
.hidden(true),
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like cargo-fmt borked here. Can be fixed here in this PR or in a subsequent one. Minimally, can it be fixed in the backport?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, fixed it. I was relying on fmt to fix this and it did not...

bw-solana
bw-solana previously approved these changes Mar 14, 2023
Copy link
Contributor

@bw-solana bw-solana 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 previously approved these changes Mar 14, 2023
validator/src/cli.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

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

thanks!

@codecov
Copy link

codecov bot commented Mar 14, 2023

Codecov Report

Merging #30710 (9a914f0) into master (89d5efa) will decrease coverage by 0.1%.
The diff coverage is 0.0%.

@@            Coverage Diff            @@
##           master   #30710     +/-   ##
=========================================
- Coverage    81.7%    81.6%   -0.1%     
=========================================
  Files         723      723             
  Lines      201656   201655      -1     
=========================================
- Hits       164761   164749     -12     
- Misses      36895    36906     +11     

@jeffwashington jeffwashington merged commit 62fe6ea into solana-labs:master Mar 14, 2023
mergify bot pushed a commit that referenced this pull request Mar 14, 2023
* validators always skip clean/shrink on startup

* move arg to get_deprecated_arguments

(cherry picked from commit 62fe6ea)

# Conflicts:
#	validator/src/cli.rs
@steviez
Copy link
Contributor

steviez commented Mar 15, 2023

Should we do the same (change default behavior / maybe deprecate arg) in ledger-tool as well ?

jeffwashington added a commit that referenced this pull request Mar 15, 2023
…0710) (#30714)

* validators always skip clean/shrink on startup (#30710)

* validators always skip clean/shrink on startup

* move arg to get_deprecated_arguments

(cherry picked from commit 62fe6ea)

# Conflicts:
#	validator/src/cli.rs

* adapt to master changes

* add deprecated log

---------

Co-authored-by: Jeff Washington (jwash) <[email protected]>
@jeffwashington
Copy link
Contributor Author

Should we do the same (change default behavior / maybe deprecate arg) in ledger-tool as well ?

we could. We'd need to be sure it is what we want in all cases. I imagine create-snapshot, for example, does a clean/shrink before it creates a snapshot? Otherwise, we'd want this first one probably?

@steviez
Copy link
Contributor

steviez commented Mar 15, 2023

Should we do the same (change default behavior / maybe deprecate arg) in ledger-tool as well ?

we could. We'd need to be sure it is what we want in all cases. I imagine create-snapshot, for example, does a clean/shrink before it creates a snapshot? Otherwise, we'd want this first one probably?

Hmm, good point on different behavior for different command. If create-snapshot does a clean before snapshot creation, that seems sufficient and can skip. For all other commands (such as verify), do we even need clean/shrink at all since that AccountsDb will only live as long as the command? Would skipping the clean/shrink have perf impact on replay speed of a command like verify ?

@jeffwashington
Copy link
Contributor Author

not cleaning does slow down operations somewhat since there are more index entries to filter out. I expect this is negligible. Clean will catch up in the back ground.

We don't need it for verify. It does serve to verify the clean/shrink algorithm is correct. It is just another can of worms to get rid of it in ledger-tool. I wanted to keep the 1.14 backport pr simple and just get rid of it for validator. Ripping the code and all args out from ledger-tool and verifying bank at startup is something we could do in master if we're comfortable with the ledger-tool side effects.

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.

5 participants