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

State pruner running even when on minimal mode #8749

Open
gfukushima opened this issue Oct 18, 2024 · 2 comments
Open

State pruner running even when on minimal mode #8749

gfukushima opened this issue Oct 18, 2024 · 2 comments

Comments

@gfukushima
Copy link
Contributor

gfukushima commented Oct 18, 2024

Restarted my dev node with some of the changes in master and saw this line come up.

{"@timestamp":"2024-10-18T05:20:37,165","level":"INFO","thread":"main","class":"StorageService","message":"State pruner will run every: 5 minute(s), retaining states for the last 0 finalized slots. Limited to 1 state prune per execution.","throwable":""}

I think we're enabling the state pruner even when we're running on minimal mode, which doesn't make much sense since we don't even store more than 1 finalized states in that mode.

We can probably run some checks and find a way to not enable the state pruner when it's not needed.

I believe that was introduced intentionally for the use case where users migrate from Archive->Minimal but minimal->minimal won't benefit from this at all.

@gfukushima gfukushima changed the title State pruner running even when we're on minimal mode State pruner running even when on minimal mode Oct 18, 2024
@zilm13
Copy link
Contributor

zilm13 commented Oct 18, 2024

Current master behavior sounds good for me. It doesn't use any resources, it's something like 5ms/1 thread job. If there is something to cleanup, it will clean it up, if nothing, ok, go further, it's cheap.
There is no simple way to check whether we were using any other DB modes before and if there is something to cleanup other than trying to do the job. The only optimization possible here is to check on first run if there is something to cleanup, if nothing and the mode is MINIMAL, stop scheduling next pruner jobs, but I'd prefer simplicity over complexity as long as running this job is very cheap.

@rolfyone
Copy link
Contributor

rolfyone commented Oct 20, 2024

we're pruning to cleanup states that may have been left around from a previous Archive mode, so we want to be careful here

Even Minimal -> minimal is possible we've got left overs from an earlier archive mode, we'd need to detect there's no archive states and shut it down, or have the pruner shut down once its done, or something. or just let it run and see there's nothing...

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

No branches or pull requests

4 participants
@rolfyone @zilm13 @gfukushima and others