ai-yang opened a new pull request, #10699:
URL: https://github.com/apache/rocketmq/pull/10699

   ### Which Issue(s) This PR Fixes
   
   - Fixes #10698
   
   ### Brief Description
   
   Restore atomic publication of a newly registered producer group without 
changing the registration-gate or fast-channel behavior introduced later.
   
   - Pre-populate a candidate group map with its first channel before 
publishing it.
   - Fall back to `putIfAbsent` on the winning map when another registration 
creates the group first.
   - Execute client-id indexing, connection logging, and fast-channel 
attributes only for the thread that inserts a new group/channel mapping.
   - Refresh the winner's existing `ClientChannelInfo` timestamp for duplicate 
registrations.
   
   ### Root Cause
   
   `registerProducer()` published an empty inner map to `groupChannelTable`. A 
concurrent inactive-channel scan could remove the empty group and emit 
`GROUP_UNREGISTER` before registration inserted its first channel, leaving the 
channel and client-id mappings detached from the producer-group index.
   
   This is a regression of #8846 / #8847 after #9293 restored the 
empty-map-first ordering while adding registration gating and fast-channel 
processing.
   
   ### Impact
   
   New producer groups cannot disappear during concurrent scanning, and the 
group/channel/client-id indexes remain consistent. The current registration 
switch truth table, timestamp refresh, statistics, and listener semantics are 
preserved. This PR intentionally does not expand into broader synchronization 
for already-existing empty groups.
   
   ### How Did You Test This Change?
   
   - Deterministic red test on the previous implementation: the scanner removed 
`FooBar` while registration was blocked at the Channel's first `hashCode()`, 
and the group assertion failed.
   - `ProducerManagerTest`: 9 tests passed, including latch-controlled 
concurrent scanning and fast-channel attribute coverage.
   - Full Broker test suite: 754 tests passed, 0 failures, 0 errors, 4 skipped.
   - Reactor dependency build/install: 10 modules succeeded.
   - Maven Checkstyle: 0 violations.
   - `git diff --check`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to