AlexStocks commented on code in PR #3420:
URL: https://github.com/apache/dubbo-go/pull/3420#discussion_r3425058404
##########
cluster/router/affinity/router.go:
##########
@@ -150,6 +164,38 @@ type affinityRoute struct {
ratio int32
}
+// SetStaticConfig applies a RouterConfig directly, bypassing YAML parsing.
+// Static and dynamic rules are not merged: later Process updates replace the
+// current state built here.
+func (a *affinityRoute) SetStaticConfig(cfg *global.RouterConfig) {
Review Comment:
[P1] `injectStaticRouters()` 会把同一个 reference 上的所有静态 router config 依次广播给每个
`StaticConfigSetter`。这里的实现只按 `scope` 过滤,然后把状态写进单个
`matcher/enabled/key/ratio`,但没有使用 `cfg.Key` 做分桶,所以同一个 reference 上如果配置了两条
application/service 级 affinity 规则,后一次 `SetStaticConfig()`
会直接覆盖前一次,前面的静态规则永远不会生效。`tag` router 的静态配置是按 `cfg.Key` 存 map 的,这里也需要类似的按 key
隔离,或者至少校验 `cfg.Key` 只匹配当前 router 绑定的目标。
--
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]