Alanxtl opened a new pull request, #3362:
URL: https://github.com/apache/dubbo-go/pull/3362

   ## 背景
   
   应用级服务发现会通过应用实例和应用元数据还原 provider URL。之前 provider 注销时主要移除注册中心里的实例,但本地 exported 
metadata 没有同步收敛,可能导致已注销服务的元数据仍然残留。
   
   同时,应用集合 listener key 之前依赖 `services.String()`,相同应用集合在不同遍历顺序下可能生成不同 key,导致 
listener 复用不稳定。
   
   ## 改动内容
   
   - 为已注册的 service instance 记录对应的 provider URL。
   - provider unregister 后,根据剩余实例重建 exported metadata。
   - 注销后重新计算 exported services revision。
   - remote metadata 模式下重新发布更新后的 app metadata。
   - 将新的 revision 同步更新到剩余 service discovery instances。
   - unsubscribe 时同步移除 subscribed URL metadata。
   - 将 `services.String()` 替换为排序后的稳定 application set key。
   
   ## 价值
   
   - 避免 provider 注销后留下过期 exported metadata。
   - 保证剩余实例携带的 metadata revision 与当前 exported services 一致。
   - 提升应用级服务发现 listener key 的稳定性,避免相同应用集合产生不同订阅 key。
   - 让应用级服务发现的 register / unregister 生命周期更完整。
   
   ### Checklist
   - [x] I confirm the target branch is `develop`
   - [x] Code has passed local testing
   - [x] I have added tests that prove my fix is effective or that my feature 
works
   


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