AlexStocks opened a new issue, #3572: URL: https://github.com/apache/dubbo-go/issues/3572
## 问题描述 `config_center/zookeeper/impl.go` 的 `GetProperties`(L126–154,以及 `GetInternalProperty` L157–159 直接复用它)每次读取都直接打 ZK,没有内存值缓存: ```go content, _, err := c.client.GetContent(c.rootPath + "/" + key) // L137 直打 ZK ``` 仅有变更监听(`cacheListener`),**没有 read-through 缓存**。每次 `GetProperties` / `GetInternalProperty` 调用都会产生一次 ZK 往返。 ## 影响 在配置 lookup / 订阅期间,重复读取同一 key 会反复访问 ZK,增加后端压力与读取延迟,无法利用监听已经感知到的最新值。 ## 建议修复 在 `zookeeperDynamicConfiguration` 中增加一层 read-through 缓存(如 `sync.Map` 或带 TTL 的缓存),由现有 `CacheListener` 在变更时失效/更新;读取时优先命中内存,未命中再回源 ZK。注意缓存键需包含 group / namespace 维度。 ## 参考 - `config_center/zookeeper/impl.go` L126–159 - 变更监听:`c.cacheListener`(`RemoveListener` L122 等) -- 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]
