Alanxtl commented on PR #3482:
URL: https://github.com/apache/dubbo-go/pull/3482#issuecomment-4953900454

   建议参考 [[PR 
#3479](https://github.com/apache/dubbo-go/pull/3479)](https://github.com/apache/dubbo-go/pull/3479)
 重新调整这部分逻辑。
   
   #3479 的做法是:`LoadSubscribeInstances` 获取到初始实例后,在创建并启动 watcher/listener 
之前,直接初始化 listener 自己的实例缓存;后续第一次全量回调直接基于这个缓存做 diff。
   
   Polaris 这里也建议采用类似思路:
   
   - 初始快照直接绑定到本次订阅对应的 listener;
   - watcher 只负责维护和分发当前 service 状态;
   - 不要在 registry 和共享 watcher 之间做两层 snapshot 转移;
   - 不要使用 watcher 级别的 `initialSnapshotConsumed`;
   - 每个 subscriber 应该独立完成自己的初始状态 reconcile。
   
   当前实现的主要问题是 snapshot 的生命周期和 watcher 的复用粒度不一致。建议按照 #3479 的 listener-level 
snapshot 初始化方式重构整体流程,并补充同一 service 存在多个 subscriber 时的回归测试。


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