-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
log: bump logrotate dep, switch to zstd compressor #9017
Conversation
Important Review skippedAuto reviews are limited to specific labels. Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Tested on a node running on testnet with |
build/logrotator.go
Outdated
return fmt.Errorf("failed to create zstd compressor: %w", err) | ||
} | ||
|
||
r.logRotator.SetCompressor(c, "zst") |
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.
As mentioned offline: How widely available are tools like zgrep
, zcat
and zless
that support this format in the main Unix variants?
Maybe it would make sense to allow users to configure this.
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.
zutils (which provides zgrep
and zcat
) added zstd
support in version 1.11 in January 2022:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1009305
Which is in Debian Bookworm (current stable), as well as the backports repos for oldstable.
The zstd
package is in the oldoldstable, oldstable, and stable repos. That provides equivalent commands like zstdgrep
, zstdcat
, and zstdless
.
On my system (debian testing), zless
is a shell script wrapper around less
that only supports gzip
. It seems like that command is compressor-specific, as there is also xzless
(and zstdless
).
Given that Debian normally lags other distros or package repos, I'd say it should be available on any system being kept reasonably up-to-date.
Maybe it would make sense to allow users to configure this.
Fair, in that case we could leave the default as GZIP
but add ZSTD
as an option. Given how well-distributed zstd
is I don't see a large benefit but happy to add it as a config flag.
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.
Darwin / macOS 14.6 zgrep, zless support .zst file inputs
zcat is unsupported
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.
Worth noting that on Debian I had to install an explicit package zutils
to get newer versions of these programs - not sure what the source package was for the older versions.
902ca80
to
66f4b3c
Compare
Performed testing similar to btcsuite/btcd#2238 (comment) , but only with CLI flags.
|
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.
Needs a change log entry for 0.19. Other than that looks pretty good, just a couple of suggestions.
66f4b3c
to
418f27c
Compare
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.
tACK, LGTM 🎉
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.
Think it's missing a release note since there's a new config option introduced, otherwise LGTM🦾
418f27c
to
e3ca662
Compare
3b70b9e
to
0a451b6
Compare
Rebased + added release note, should be g2g. |
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.
LGTM🫡
Change Description
Description of change / link to associated issue.
Similar change to btcsuite/btcd#2238 . Updates the log rotation dependency s.t. we can use ZSTD compression for logs instead of GZIP.
Steps to Test
Steps for reviewers to follow to test the change.
Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]
in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.