Alanxtl opened a new issue, #3352:
URL: https://github.com/apache/dubbo-go/issues/3352

   ### 背景
   
   `#2534` 的 metadata 重构把模块目标收敛为应用级 metadata,并希望把散落在 config、registry、common 
extension 中的逻辑集中到 metadata 模块。这个 issue 只聚焦应用级 metadata 在多注册中心、多实例场景下的读写语义。
   
   当前应用级 metadata 支持多 registry / metadata report,但读写路径的选择语义不够清晰。
   
   相关代码:
   - `metadata/report_instance.go`
   - `metadata/mapping/metadata/service_name_mapping.go`
   - 
`registry/servicediscovery/customizer/metadata_service_url_params_customizer.go`
   
   ### 当前问题
   
   现状里存在几类不一致:
   - `GetMetadataReport()` 会返回 map 中任意一个 report
   - mapping 写入会写所有 metadata report,但读取只取一个 report
   - 部分远端 metadata 读取没有按 registry id 精确选择 metadata report
   - `metadata_service_url_params_customizer.go` 已有多实例 metadata alignment 的 TODO
   
   这会导致多注册中心或多实例场景下 metadata 读写不稳定,甚至读到错误 metadata center。
   
   ### 建议
   
   - 明确 metadata report 与 registry id / cluster 的绑定关系
   - 避免无序 map 遍历决定默认 report
   - mapping 的写入、读取、监听、移除应使用一致的 report 选择规则
   - 明确多实例场景下 metadata service URL 的选择与暴露规则
   - 补充多 registry、多 metadata report 的单测
   


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

Reply via email to