Repository navigation
Conversation
…d guard expiry scan and closed-channel heartbeats
3 tasks done
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #11551 +/- ##
=============================================
+ Coverage 49.86% 49.92% +0.06%
- Complexity 14454 14487 +33
=============================================
Files 1391 1391
Lines 103432 103510 +78
Branches 13550 13561 +11
=============================================
+ Hits 51573 51677 +104
+ Misses 45636 45594 -42
- Partials 6223 6239 +16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Which Issue(s) This PR Fixes
Brief Description
Fixes stale channel-close broker eviction in
DefaultBrokerHeartbeatManager(#11045), including the two concurrency review items noted by @RongtongJin on closed PR #11046 (#discussion_r4227688656, #discussion_r4227688667):onBrokerHeartbeatupdates/rebindsBrokerLiveInfoinsidebrokerLiveTable.compute, andonBrokerChannelCloseremoves entries viacomputeIfPresentonly whilelive.getChannel() == channel(ignoringnullchannels and capturing removed fields before submittingnotifyBrokerInActive).scanNotActiveBroker: recheckslastUpdateTimestampandheartbeatTimeoutMillisinsidecomputeIfPresent, and coordinates channel closing with concurrent heartbeats viachannelLifecycleLock(ReadWriteLock) plusclosingChannelsso an expired entry only closes its channel when no other live broker entry shares or concurrently rebinds onto that channel (e.g.BrokerContainersharingBrokerOuterAPI).onBrokerHeartbeatrejects heartbeats from inactive or expiry-closing channels insidecompute, and rechecks right aftercomputeto conditionally evict the same(identity, channel)if the channel closed before a newly created entry became visible toonBrokerChannelClose(without affecting any replacement channel that already took over). Overlapping active connections follow latest-processed-active-heartbeat takeover (brokerEpochtracks master election rather than connection generation),channel == nullregistration/timeout behavior is preserved, and mutableBrokerLiveInfofields are markedvolatilefor lock-free readers.How Did You Test This Change?
Added deterministic interleaving tests (plus a 500-round concurrent stress test) in
DefaultBrokerHeartbeatManagerTestand verified with JDK 8 (1.8.0_514):oldChannel -> newChannelfollowed by staleoldChannelclose, current-channel close positive control, overlapping active connections under the samebrokerEpoch,null-channel non-eviction, and the 500-round close/rebind stress test.lastUpdateTimestampwhilenewChannelrebinds, two broker identities sharing anEmbeddedChannel(steady-state sharing, sibling broker rebinding duringscanNotActiveBroker, delayed in-flight close, and failed close recovery), and exclusive-channel expiry positive control.RequestTaskfrom a closedEmbeddedChannelthroughControllerRequestProcessorandBrokerHousekeepingService, and first-heartbeat publish-window close interleaved withonBrokerChannelCloseand replacement channel takeover.mvn -B -ntp -pl controller -Dtest=DefaultBrokerHeartbeatManagerTest,ReplicasInfoManagerTest,ControllerRequestProcessorTest,DefaultElectPolicyTest,BrokerIdentityInfoTest,EventSerializerTest,ListEventSerializerTest,ControllerManagerTest test(46/46tests in those 8 suites pass, Checkstyle and SpotBugs clean).