-
Notifications
You must be signed in to change notification settings - Fork 38.8k
leveldb: show non-default options during init #31644
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
base: master
Are you sure you want to change the base?
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31644. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsNo conflicts as of last run. |
64b1bf4 to
8af25b0
Compare
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
|
How is this useful? |
I've extended the description with more details. Details2025-01-16T10:47:35Z Opening LevelDB in /Users/lorinc/Library/Application Support/Bitcoin/blocks/index
2025-01-16T10:47:35Z Opened LevelDB successfully with options: options.compression=NoCompression, options.create_if_missing=true, options.max_file_size=33554432, options.paranoid_checks=true, options.write_buffer_size=524288, readoptions.fill_cache=false, readoptions.verify_checksums=true, writeoptions.sync=true
...
2025-01-16T10:47:51Z Opening LevelDB in /Users/lorinc/Library/Application Support/Bitcoin/chainstate
2025-01-16T10:47:51Z Opened LevelDB successfully with options: options.compression=NoCompression, options.create_if_missing=true, options.max_file_size=33554432, options.paranoid_checks=true, options.write_buffer_size=2097152, readoptions.fill_cache=false, readoptions.verify_checksums=true, writeoptions.sync=trueE.g. options.compression=NoCompression, options.create_if_missing=true, options.max_file_size=33554432, options.paranoid_checks=true, options.write_buffer_size=262144, readoptions.fill_cache=false, readoptions.verify_checksums=true, writeoptions.sync=trueLogging the non-default LevelDB options during initialization makes it easier to understand and debug database behavior. For example, the Logging these differences helps trace configuration changes, especially when command-line arguments (such as |
8af25b0 to
aac1585
Compare
pablomartin4btc
left a comment
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.
Concept ACK
Perhaps the legend "with options: ..." could be debug log? Ideally in the same line but I don't think we support it actually. As an alternative (haven't tested it) maybe:
const bool log_options = LogAcceptCategory(BCLog::LEVELDB, BCLog::Level::Debug);
LogInfo("Opened LevelDB successfully%s",
log_options
? tfm::format(" with options: %s", GetChangedOptions(DBContext()))
: "");
aac1585 to
583645c
Compare
|
Thanks for the hint @pablomartin4btc, I kept the original line and added and extra debug log, when starting with |
Example output, if started with `-debug=leveldb`: > Opened LevelDB successfully > [leveldb] startup options: options.compression=NoCompression, options.create_if_missing=true, options.max_file_size=33554432, options.paranoid_checks=true, options.write_buffer_size=524288, readoptions.fill_cache=false, readoptions.verify_checksums=true, writeoptions.sync=true
583645c to
897a578
Compare
To help with to debugging and traceability (in alignment with displaying other non-default args such as
Command-line arg: dbcache="10000") we can extend the LevelDB opening log with an additional debug message for the used non-default settings.To avoid showing booleans as e.g.
create_if_missing=1, I've added a localToStringlambda forbool.I wanted to use
util::Joinat the end, but couldn't find any way that I liked.Example output after the change: