-
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
fix: fix log_level #2948
fix: fix log_level #2948
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe changes in this pull request primarily involve modifications to the 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)
src/pika_repl_bgworker.cc (1)
122-123
: Improve log readability further.While the log formatting is improved, consider using structured logging to make it even more readable and parseable.
- LOG(WARNING) << "Check SessionId Mismatch: " << slave_db->MasterIp() << ":" << slave_db->MasterPort() << ", " - << slave_db->SyncDBInfo().ToString() << " expected_session: " << binlog_res.session_id() - << ", actual_session:" << slave_db->MasterSessionId(); + LOG(WARNING) << "Session ID mismatch" + << " master=" << slave_db->MasterIp() << ":" << slave_db->MasterPort() + << " db=" << slave_db->SyncDBInfo().ToString() + << " expected_session=" << binlog_res.session_id() + << " actual_session=" << slave_db->MasterSessionId();
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
src/pika_repl_bgworker.cc
(8 hunks)
🔇 Additional comments (6)
src/pika_repl_bgworker.cc (6)
100-106
: LGTM on DB validation.
Good addition of explicit DB existence checks with appropriate error logging.
174-175
: LGTM on monitor message formatting.
The string concatenation is now more readable and efficient.
224-225
: LGTM on cache condition formatting.
The condition is now more readable with better line wrapping.
241-242
: LGTM on command name check formatting.
The condition is now more readable with better line wrapping.
262-262
: LGTM on log level adjustment.
Changing slowlog entries from ERROR to INFO is appropriate as these are informational messages rather than error conditions. This change aligns with the PR's objective of fixing log levels.
9-10
: LGTM on include reordering.
The reordering of includes appears to be for better organization. The change looks good, though it's worth ensuring it doesn't impact compilation in different build configurations.
✅ Verification successful
Include order change is safe and well-organized
The verification shows that:
- Both header files have proper include guards
- There's no circular dependency between these headers
pika_repl_bgworker.h
doesn't includepika_conf.h
, making the order in the implementation file flexible- Both headers are independent of each other, with their own distinct class definitions
The reordering of includes in src/pika_repl_bgworker.cc
is safe and follows good practice.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for potential include-order related issues
# Look for include guard patterns and potential circular dependencies
rg -l '#include.*pika_(conf|repl_bgworker)\.h' | xargs -I{} rg '#ifndef.*PIKA_(CONF|REPL_BGWORKER)_H_' {}
Length of output: 111
Script:
#!/bin/bash
# Let's check the header files directly and their include patterns
# First, find the header files
fd -e h 'pika_conf|pika_repl_bgworker' include/
# Then check their content for include guards and includes
echo "=== Content of pika_conf.h ==="
cat include/pika_conf.h | grep -E '#(ifndef|define|include).*'
echo -e "\n=== Content of pika_repl_bgworker.h ==="
cat include/pika_repl_bgworker.h | grep -E '#(ifndef|define|include).*'
Length of output: 1200
Script:
#!/bin/bash
# Let's check if pika_repl_bgworker.h includes pika_conf.h
# and look for any potential circular dependencies
# Check if pika_conf.h is included in pika_repl_bgworker.h
echo "=== Checking if pika_conf.h is included in pika_repl_bgworker.h ==="
rg -l "include.*pika_conf\.h" include/pika_repl_bgworker.h
# Check if any of these files include each other creating a circular dependency
echo -e "\n=== Checking for potential circular dependencies ==="
rg -A 5 "class PikaConf|class PikaReplBgWorker" include/
Length of output: 969
* fix log_level
Summary by CodeRabbit
ERROR
toINFO
.