mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-08-01 04:46:33 +00:00
Review spot: the leader-assignment branch was gated on `len(request.GroupAssignments) > 0`, so a leader SyncGroup that omitted every current member (empty array with a non-empty group) fell through to the server-side-assignment `else` branch and could move the group Stable without the intended rebalance retry. Drop the length guard. Whenever the caller is the leader, build the assigned-member map and run the coverage check; if the assignment omits any current member (including the all-empty case against a non-empty group), bump the generation, reset to PreparingRebalance, clear each member's Assignment, and return REBALANCE_IN_PROGRESS so the leader rebuilds its snapshot and sends a complete assignment on retry. The server-side-assignment branch (documented as "should not happen with Sarama") is now only reachable for non-leader+non-empty SyncGroups — a genuinely unexpected case — and keeps its existing warning.