-
Notifications
You must be signed in to change notification settings - Fork 313
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: deregister failure detector in region migration #4293
fix: deregister failure detector in region migration #4293
Conversation
WalkthroughThe updates enhance the handling of failure detectors for region migrations. Specifically, the Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Context
participant RegionMigration
participant FailureDetector
participant MetadataUpdater
Context ->> RegionMigration: startMigration()
RegionMigration ->> Context: registerFailureDetectors(to_peer)
Context ->> FailureDetector: register(to_peer)
Note over RegionMigration, Context: Migration process...
RegionMigration ->> MetadataUpdater: updateMetadata()
MetadataUpdater ->> Context: deregisterFailureDetectors()
Context ->> FailureDetector: deregister(to_peer)
MetadataUpdater ->> RegionMigration: openRegionGuard()
Note over RegionMigration: Continue migration...
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 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/meta-srv/src/procedure/region_migration.rs (1 hunks)
Additional comments not posted (2)
src/meta-srv/src/procedure/region_migration.rs (2)
245-251
: LGTM! The changes align with the context.The use of
to_peer
for thedatanode_id
correctly aligns with the registration of failure detectors for the destination peer during region migration.
259-271
: LGTM! The new function correctly handles deregistration.The introduction of
deregister_failure_detectors
and the use offrom_peer
for thedatanode_id
correctly addresses the issue of false positives in failure detection.
06654e9
to
92b0fc5
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- src/meta-srv/src/procedure/region_migration.rs (2 hunks)
- src/meta-srv/src/procedure/region_migration/update_metadata/upgrade_candidate_region.rs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/meta-srv/src/procedure/region_migration.rs
Additional comments not posted (1)
src/meta-srv/src/procedure/region_migration/update_metadata/upgrade_candidate_region.rs (1)
179-180
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
upgrade_candidate_region
correctly handle the new call toderegister_failure_detectors
.</blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4293 +/- ##
==========================================
- Coverage 85.25% 84.88% -0.37%
==========================================
Files 1058 1060 +2
Lines 186971 187543 +572
==========================================
- Hits 159404 159200 -204
- Misses 27567 28343 +776 |
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
src/meta-srv/src/procedure/region_migration/update_metadata/upgrade_candidate_region.rs
Outdated
Show resolved
Hide resolved
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/meta-srv/src/procedure/region_migration/update_metadata/upgrade_candidate_region.rs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/meta-srv/src/procedure/region_migration/update_metadata/upgrade_candidate_region.rs
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
What's changed and what's your
The original failure detectors of failed region was removed once the procedure was triggered. However, the
from_peer
may still send the heartbeats contains the failed region. We need to remove it manually to reduce false positive rate of failure detection.Checklist
Summary by CodeRabbit
New Features
Bug Fixes