-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: make log-retention-time dynamically changeable #2963
feat: make log-retention-time dynamically changeable #2963
Conversation
WalkthroughThe changes introduce a new method Changes
Poem
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 (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
include/pika_conf.h (1)
Line range hint
1003-1003
: Initialize log_retention_time_ member variable.The
log_retention_time_
member variable should be initialized to prevent undefined behavior.Add initialization in the private section:
- int log_retention_time_; + int log_retention_time_ = 0;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
include/pika_conf.h
(1 hunks)src/pika_admin.cc
(2 hunks)
🔇 Additional comments (3)
include/pika_conf.h (1)
Line range hint 63-63
: LGTM! Thread-safe implementation of log retention time getter/setter.
The getter and setter methods properly use shared locks and lock guards respectively to ensure thread safety.
Also applies to: 775-779
src/pika_admin.cc (2)
1593-1598
: LGTM! Proper implementation of ConfigGet for log-retention-time.
The implementation correctly:
- Uses pattern matching for parameter name
- Encodes the response following Redis protocol
2354-2360
: LGTM! Proper implementation of ConfigSet with input validation.
The implementation correctly:
- Validates that the input is a positive integer
- Returns appropriate error message for invalid input
- Updates the configuration using SetLogRetentionTime
支持使用config get/set 动态获取、调整log-retention-time参数
Summary by CodeRabbit
New Features
Bug Fixes