mochengqian opened a new issue, #950: URL: https://github.com/apache/dubbo-go-pixiu/issues/950
## Context #932 introduced (and partially reverted) `resolveSetEndpointSlot`, which tried to unify the dedup rule between static cluster assembly and dynamic `SetEndpoint`. The unification turned out to be a wrong abstraction — the two paths have different intents: - Static assembly: "two YAML entries with the same ID — keep both, the operator wrote it that way" - Dynamic SetEndpoint with explicit ID: "registry update for an existing instance — replace in place" The fix was to let the two paths diverge again. **Other helpers in `cluster_manager.go` may carry the same smell.** This issue is a preventive audit; it does not commit to changing any of them. ## Scope For each helper below, confirm that all callers genuinely want the same rule. If two callers want different rules, file a follow-up issue (do **not** fix it in this audit). Helpers to check: - [ ] `endpointContentEqualForSet` (`cluster_manager.go`) — used by both ID and hash dedup paths; verify both want the same "is this the same instance?" answer - [ ] `socketAddressContentEqual` — stricter than `SocketAddress.Equal`; intentional divergence is documented, confirm no caller silently expects the loose oracle - [ ] `stringMapEqualForSet` / `llmMetaEqualForSet` — verify the "nil ↔ empty-map equality" rule matches every caller's intent - [ ] `nextStableEndpointID` (`cluster_manager.go`) **vs** `uniqueSnapshotEndpointID` (`pkg/cluster/cluster.go`) — these implement the same `-2/-3` suffix algorithm. If a refactor accidentally drifted one, dedup outcomes would silently disagree between assembly and snapshot rebuild - [ ] `assembleClusterEndpoints` — runs on both `AddCluster` and `UpdateCluster` paths; verify both paths want the same defaulting rules for `Name` / `ID` - [ ] `prepareClusterConfig` — single-line wrapper, low risk, still worth a glance ## Rubric for each helper Answer for each: 1. **Who calls this?** (grep callers) 2. **What does each caller need from it?** (one sentence per caller) 3. **Are the answers the same?** If yes → done, leave a comment on this issue confirming. If no → file a follow-up issue with the specific divergence, link it here. ## Expected deliverable A single summary comment on this issue listing each helper and either "✅ all callers agree, no action" or "⚠️ divergence found, see #NNNN". ## Out of scope - Fixing any divergence found. File a separate issue with the details and link it here. The reason: the right fix for one divergence may not be the right fix for another, and bundling them risks repeating the original `resolveSetEndpointSlot` mistake. - Other files. Stay within `pkg/server/cluster_manager.go` + `pkg/cluster/cluster.go` for cross-references. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
