mochengqian commented on code in PR #915:
URL: https://github.com/apache/dubbo-go-pixiu/pull/915#discussion_r3138807866
##########
pkg/model/cluster.go:
##########
@@ -60,7 +60,7 @@ type (
ConsistentHash ConsistentHash `yaml:"consistent"
json:"consistent"` // Consistent hash config info
HealthChecks []HealthCheckConfig `yaml:"health_checks"
json:"health_checks"`
Endpoints []*Endpoint `yaml:"endpoints"
json:"endpoints"`
- PrePickEndpointIndex int
+ PrePickEndpointIndex uint32 `yaml:"-" json:"-"` //
runtime-only round-robin cursor state
Review Comment:
感谢您指出这一点。我仔细查看了当前的刷新路径:
`fetchCompareAndSet()` 执行的是 `CloneStore() -> NewStore(oldStore.Version) ->
SetEndpoint(...) -> CompareAndSetStore()`。
确实不应该在刷新过程中破坏轮询的连续性。但是,我认为仅仅还原 `yaml:"-" json:"-"` 并不是正确的解决方案。在当前的 Spring
Cloud 流程中,传入的 store 会通过 `NewStore + SetEndpoint` 从头开始重建,因此轮询游标实际上是在 store
重建/交换时丢失的,而不仅仅是在克隆序列化时丢失。
我将保留 `PrePickEndpointIndex` 的运行时特性,并在 `CompareAndSetStore()` 中做一个小修复:在 store
交换之前,将同名集群的游标传递过去。我还会添加一个回归测试,涵盖 `CloneStore -> NewStore -> SetEndpoint ->
CompareAndSetStore` 这一系列刷新操作。
这样应该可以保持资源管理器的连续性,而无需通过配置克隆重新暴露运行时状态,现在问题已解决.
--
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]