-
Notifications
You must be signed in to change notification settings - Fork 147
go/oasis-node/cmd/storage: Add command that flattens consensus dbs #6311
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
go/oasis-node/cmd/storage: Add command that flattens consensus dbs #6311
Conversation
✅ Deploy Preview for oasisprotocol-oasis-core canceled.
|
5fd1136 to
4d3e8f9
Compare
9a12d7f to
c07cc2b
Compare
| if err := cmdCommon.Init(); err != nil { | ||
| cmdCommon.EarlyLogAndExit(err) | ||
| } |
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.
Commands above don't initialize this, thus all the logs are lost as logger is not initialized. Note this redirects logs to stdout, which depending on the configuration may produce a lot of logs on the operator terminal.
Should this be actually written to stderr by default?
update: related to #6311 (comment)
7ab7813 to
66fe975
Compare
|
Added a docs section as requested yesterday. |
66fe975 to
c4616bb
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #6311 +/- ##
==========================================
- Coverage 64.82% 64.19% -0.63%
==========================================
Files 698 698
Lines 67826 67908 +82
==========================================
- Hits 43968 43594 -374
- Misses 18860 19297 +437
- Partials 4998 5017 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c4616bb to
9c2b25b
Compare
9c2b25b to
ac4c227
Compare
Part of #6309.
This command has been thoroughly tested and is able to immediately reclaim all the disk space even if enabling pruning late.
Unfortunately, there is a known corner case where disk space used during the peak of the compaction may be double the original size - see. It is for this reason that I suggest to release this as experimental command.
Performance:
Currently it takes less then
1hto compact all the consensus databases (with all the state/blocks from the genesis) on my2TBplayground.I haven't observed that increasing number of the
Flattenworkers would increase the overall disk usage during the peak of the compaction (as warned by the badger cli documentation). How about adding this as an optional parameter?This way users with spare disk space could e.g. configure it to use 8 workers, and thus speed-up compaction significantly.
3-5times as from my experiments.We may also explore the impact of increasing
BlockCacheSize...Follow-up
Given that I was testing this only on the consensus DB instances, I suggest to add compaction of the runtime DB instances as a follow-up. The testing there is also complicated as runtime state pruning is very slow, making it hard to prepare realistic samples.
I suggest the following order of follow-ups:
compactcommand.