Fix single-replica partition blocking forever during bootstrap/deactivation/disconnection#3204
Merged
justinlin-linkedin merged 1 commit intolinkedin:masterfrom Mar 2, 2026
Conversation
…vation/disconnection When a partition has only one replica, there are no peers, so updateReplicaLagAndCheckSyncStatus is never called by the replication manager. This caused waitBootstrapCompleted (and the equivalent wait methods for deactivation/disconnection) to block forever. Two changes fix this: 1. Cap catchupTarget at the total number of available peers so hasSyncedUpWithEnoughPeers() returns true when there are zero peers. 2. Check isSyncUpComplete() right after initiation and immediately complete the operation if already satisfied, since no replication events will ever arrive to trigger completion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
e8209c8 to
6fcb45d
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3204 +/- ##
============================================
+ Coverage 64.24% 69.81% +5.56%
- Complexity 10398 12816 +2418
============================================
Files 840 930 +90
Lines 71755 79101 +7346
Branches 8611 9464 +853
============================================
+ Hits 46099 55222 +9123
+ Misses 23004 20931 -2073
- Partials 2652 2948 +296 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
SophieGuo410
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a partition has only one replica, there are no peers, so updateReplicaLagAndCheckSyncStatus is never called by the replication manager. This caused waitBootstrapCompleted (and the equivalent wait methods for deactivation/disconnection) to block forever.
Two changes fix this:
Testing Done
Added new unit tests