chennaji9 opened a new issue, #11338:
URL: https://github.com/apache/rocketmq/issues/11338

   ### Description
   
   `SyncStateInfo` 
(`controller/src/main/java/org/apache/rocketmq/controller/impl/manager/SyncStateInfo.java`)
 maintains the controller's per-broker view of mastership: master identity + 
epoch, and the sync-state set + epoch. It deliberately copies sets on the way 
in and out:
   
   ```java
   public void updateSyncStateSetInfo(Set<Long> newSyncStateSet) {
       this.syncStateSet = new HashSet<>(newSyncStateSet);
       ...
   }
   public Set<Long> getSyncStateSet() {
       return new HashSet<>(syncStateSet);
   }
   ```
   
   The existing manager-level tests touch the class via larger flows, but no 
test pins the defensive-copy contract itself: mutating the caller's set after 
`updateSyncStateSetInfo` (or mutating the set returned by the getter) must not 
corrupt controller state, `updateMasterInfo` must bump the master epoch, and 
`removeFromSyncState` must remove locally without advancing the sync-state 
epoch. Losing any of these (e.g. "simplifying" away the copies) would silently 
let callers mutate controller state and currently no test would notice.
   
   ### Expected behavior
   
   Direct unit coverage of the isolation and epoch semantics described above.


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