RockteMQ-AI commented on issue #10734:
URL: https://github.com/apache/rocketmq/issues/10734#issuecomment-5149498402

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Confirmed**
   
   The reported issue has been verified against the current codebase.
   
   **Root Cause:** `BroadcastOffsetManager.queryInitOffset` uses a non-atomic 
`get` → create → `put` sequence to initialize a missing client entry. 
Meanwhile, `updateOffset` uses `ConcurrentHashMap.compute` for atomic 
initialization and update. When `updateOffset` completes between the query's 
`get` (observing absence) and `put` (inserting a new empty store), the query's 
`put` overwrites the store that already contains the committed offset, causing 
the client offset to be lost and falling back to the consumer offset or queue 
maximum.
   
   **Impact:** Broadcast consumer offset tracking can silently lose committed 
offsets under concurrent initialization, leading to message re-delivery or 
offset regression.
   
   **Severity:** **Medium** — scoped to per-client initialization race in 
`BroadcastOffsetManager`; no public protocol change required.
   
   **Suggested Fix Direction:** Replace the non-atomic get/create/put in 
`queryInitOffset` with `ConcurrentHashMap.computeIfAbsent` (or `compute`) to 
ensure atomic initialization, consistent with how `updateOffset` already 
operates.
   
   An automated fix proposal will be generated. Reply `/approve` to proceed 
with PR generation.
   
   ---
   *Automated evaluation by github-manager*


-- 
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