-
Notifications
You must be signed in to change notification settings - Fork 288
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
chore: remove original region failover implementation #4237
Conversation
WalkthroughThe codebase has seen a cleanup effort focusing on module accessibility and relevant test utilities. Several modules were either removed or had their visibility restricted. Key changes include making specific modules private in Changes
Poem
Tip Early access features: enabledWe are currently testing the following features in early access:
Note:
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 as PR comments)
Additionally, you can add CodeRabbit Configration 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 (3)
src/meta-srv/src/test_util.rs (3)
Line range hint
14-25
: Improve readability ofleader_peer
assignment.The current assignment of
leader_peer
can be simplified for better readability.- let leader_peer = peers.iter().find(|peer| peer.id == leader_node).cloned(); + let leader_peer = peers.iter().cloned().find(|peer| peer.id == leader_node);
Line range hint
28-41
: Improve error handling forunwrap
call.Using
unwrap
can cause the program to panic. Consider usingexpect
with a meaningful error message or proper error handling.- .unwrap(); + .expect("Failed to build MetaPeerClient");
Line range hint
44-59
: Improve error handling forunwrap
calls.Using
unwrap
can cause the program to panic. Consider usingexpect
with a meaningful error message or proper error handling.- let lease_key_bytes: Vec<u8> = lease_key.try_into().unwrap(); - let lease_value_bytes: Vec<u8> = lease_value.try_into().unwrap(); + let lease_key_bytes: Vec<u8> = lease_key.try_into().expect("Failed to convert lease key to bytes"); + let lease_value_bytes: Vec<u8> = lease_value.try_into().expect("Failed to convert lease value to bytes");
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- src/meta-srv/src/lock.rs (1 hunks)
- src/meta-srv/src/procedure.rs (1 hunks)
- src/meta-srv/src/test_util.rs (2 hunks)
- tests-integration/tests/main.rs (1 hunks)
Files skipped from review due to trivial changes (3)
- src/meta-srv/src/lock.rs
- src/meta-srv/src/procedure.rs
- tests-integration/tests/main.rs
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4237 +/- ##
==========================================
- Coverage 84.88% 84.56% -0.33%
==========================================
Files 1046 1038 -8
Lines 184597 182957 -1640
==========================================
- Hits 156694 154713 -1981
- Misses 27903 28244 +341 |
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
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
#4161
What's changed and what's your intention?
In #4172, we migrated original region failover implementation to region migration implementation. Now we can remove original region failure implementation.
Checklist
Summary by CodeRabbit
Refactor
region_failover
module and associated comments to clean up the code.Tests