-
Notifications
You must be signed in to change notification settings - Fork 608
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
Valnodes forceprune #1262
Valnodes forceprune #1262
Conversation
Add forceprune to CLI (Ability to compact/prune via CLI)
Forceprune provides options to prune blockstore.db and state.db. By default, it would prune blockstore.db and state.db up to 14 days (unbounding period). In state.db while it keeps validator and consensus information up to 14 days it prunes abci responses (keeping only last 1000 blocks abci response). If required, one can override 14 days of blocks. Forceprune does not touch application.db or indexer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for PR'ing this! It will be really helpful for node operators!
@czarcas7ic tested it on nodes I believe. The PR lgtm once it passes linting. (Most of these should get fixed if you run make format
. Any remaining ones will come up in make lint
)
Codecov Report
@@ Coverage Diff @@
## main #1262 +/- ##
=======================================
Coverage 19.81% 19.81%
=======================================
Files 210 210
Lines 27884 27884
=======================================
Hits 5525 5525
Misses 21333 21333
Partials 1026 1026 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this change. I left some comments, please take a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is similar to how i setup cosmprund, while it works perfectly fine its super slow, interested to hear your speeds on 100GB+.
My next design was going to create a new db and migrate the blocks over, while more complex you can do it in a fraction of the time.
That'll fix ci for this. I am actually going to test this code right now, here's the scenario: I have a machine at hetzner where I have been struggling to make a rocksdb image for distribution. When the state gets too big it slows to the pace of a camel. I am going to combine this with some of my other recent work and see where it gets us. |
@marbar3778 and @moniya12 I'm trying cosmosprund on rocksdb v7 now, I'll make a draft PR into there. Right now, it does not seem that this supports rocks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@moniya12 Thank you for addressing my comments and questions. I took another look and, mostly, had minor style suggestions.
Currently, my only concern is not having defer db_bs.Close()
, please let me know what you think
Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com>
Moved to const values, added defer close db
I did this on a 106GB image and it completed in ~15 minutes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defer db_bs.Close()
is added in the logic! I suggest we merge this in, and then do a second follow-up PR, to make the db openings / closings match the desired idioms a bit more
Thanks for adding this @moniya12 / Valnodes team!
* Update root.go Add forceprune to CLI (Ability to compact/prune via CLI) * Added Forceprune.go Forceprune provides options to prune blockstore.db and state.db. By default, it would prune blockstore.db and state.db up to 14 days (unbounding period). In state.db while it keeps validator and consensus information up to 14 days it prunes abci responses (keeping only last 1000 blocks abci response). If required, one can override 14 days of blocks. Forceprune does not touch application.db or indexer. * Added description for Forceprune option * Update forceprune.go * Fix db close * Update cmd/osmosisd/cmd/forceprune.go Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com> * Update forceprune.go Moved to const values, added defer close db * Fix lint Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com> Co-authored-by: Dev Ojha <dojha@berkeley.edu> (cherry picked from commit 15f131e)
Forceprune provides options to prune blockstore.db and state.db. By default, it would prune blockstore.db and state.db up to 14 days (unbounding period). In state.db while it keeps validator and consensus information up to 14 days it prunes abci responses (keeping only last 1000 blocks abci response). If required, one can override 14 days of blocks. Forceprune does not touch application.db or indexer.
* Update root.go Add forceprune to CLI (Ability to compact/prune via CLI) * Added Forceprune.go Forceprune provides options to prune blockstore.db and state.db. By default, it would prune blockstore.db and state.db up to 14 days (unbounding period). In state.db while it keeps validator and consensus information up to 14 days it prunes abci responses (keeping only last 1000 blocks abci response). If required, one can override 14 days of blocks. Forceprune does not touch application.db or indexer. * Added description for Forceprune option * Update forceprune.go * Fix db close * Update cmd/osmosisd/cmd/forceprune.go Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com> * Update forceprune.go Moved to const values, added defer close db * Fix lint Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com> Co-authored-by: Dev Ojha <dojha@berkeley.edu> (cherry picked from commit 15f131e)
* Valnodes forceprune (#1262) * Update root.go Add forceprune to CLI (Ability to compact/prune via CLI) * Added Forceprune.go Forceprune provides options to prune blockstore.db and state.db. By default, it would prune blockstore.db and state.db up to 14 days (unbounding period). In state.db while it keeps validator and consensus information up to 14 days it prunes abci responses (keeping only last 1000 blocks abci response). If required, one can override 14 days of blocks. Forceprune does not touch application.db or indexer. * Added description for Forceprune option * Update forceprune.go * Fix db close * Update cmd/osmosisd/cmd/forceprune.go Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com> * Update forceprune.go Moved to const values, added defer close db * Fix lint Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com> Co-authored-by: Dev Ojha <dojha@berkeley.edu> (cherry picked from commit 15f131e) * Update docker.yml * Update lint.yml * Update Makefile * Update lint.yml * Update Makefile Co-authored-by: moniya12 <91159097+moniya12@users.noreply.github.com> Co-authored-by: Adam Tucker <adam@osmosis.team>
* Update root.go Add forceprune to CLI (Ability to compact/prune via CLI) * Added Forceprune.go Forceprune provides options to prune blockstore.db and state.db. By default, it would prune blockstore.db and state.db up to 14 days (unbounding period). In state.db while it keeps validator and consensus information up to 14 days it prunes abci responses (keeping only last 1000 blocks abci response). If required, one can override 14 days of blocks. Forceprune does not touch application.db or indexer. * Added description for Forceprune option * Update forceprune.go * Fix db close * Update cmd/osmosisd/cmd/forceprune.go Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com> * Update forceprune.go Moved to const values, added defer close db * Fix lint Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com> Co-authored-by: Dev Ojha <dojha@berkeley.edu> (cherry picked from commit 15f131e)
* Update root.go Add forceprune to CLI (Ability to compact/prune via CLI) * Added Forceprune.go Forceprune provides options to prune blockstore.db and state.db. By default, it would prune blockstore.db and state.db up to 14 days (unbounding period). In state.db while it keeps validator and consensus information up to 14 days it prunes abci responses (keeping only last 1000 blocks abci response). If required, one can override 14 days of blocks. Forceprune does not touch application.db or indexer. * Added description for Forceprune option * Update forceprune.go * Fix db close * Update cmd/osmosisd/cmd/forceprune.go Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com> * Update forceprune.go Moved to const values, added defer close db * Fix lint Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com> Co-authored-by: Dev Ojha <dojha@berkeley.edu> (cherry picked from commit 15f131e) Co-authored-by: moniya12 <91159097+moniya12@users.noreply.github.com>
* Update root.go Add forceprune to CLI (Ability to compact/prune via CLI) * Added Forceprune.go Forceprune provides options to prune blockstore.db and state.db. By default, it would prune blockstore.db and state.db up to 14 days (unbounding period). In state.db while it keeps validator and consensus information up to 14 days it prunes abci responses (keeping only last 1000 blocks abci response). If required, one can override 14 days of blocks. Forceprune does not touch application.db or indexer. * Added description for Forceprune option * Update forceprune.go * Fix db close * Update cmd/osmosisd/cmd/forceprune.go Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com> * Update forceprune.go Moved to const values, added defer close db * Fix lint Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com> Co-authored-by: Dev Ojha <dojha@berkeley.edu> (cherry picked from commit 15f131e)
* Update root.go Add forceprune to CLI (Ability to compact/prune via CLI) * Added Forceprune.go Forceprune provides options to prune blockstore.db and state.db. By default, it would prune blockstore.db and state.db up to 14 days (unbounding period). In state.db while it keeps validator and consensus information up to 14 days it prunes abci responses (keeping only last 1000 blocks abci response). If required, one can override 14 days of blocks. Forceprune does not touch application.db or indexer. * Added description for Forceprune option * Update forceprune.go * Fix db close * Update cmd/osmosisd/cmd/forceprune.go Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com> * Update forceprune.go Moved to const values, added defer close db * Fix lint Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com> Co-authored-by: Dev Ojha <dojha@berkeley.edu> (cherry picked from commit 15f131e) Co-authored-by: moniya12 <91159097+moniya12@users.noreply.github.com>
Closes: #XXX
Description
Add forceprune to CLI (Ability to compact/prune via CLI)
Please review cmd/osmosisd/cmd/forceprune.go
Forceprune provides options to prune blockstore.db and state.db. By default, it would prune blockstore.db and state.db up to 14 days (unbounding period). In state.db while it keeps validator and consensus information up to 14 days it prunes abci responses (keeping only last 1000 blocks abci response).
Forceprune does not touch application.db or indexer.
ABCI Responses are stored in index db and so redundant especially if one is running pruned nodes. As a result we are removing ABCI data from state.db aggressively by default. One can override height for blockstore.db and state.db by using -f option and for abci response by using -m option.
Example osmosisd forceprune -f 188000 -m 1000.
For contributor use:
docs/
) or specification (x/<module>/spec/
)Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorer