Alanxtl commented on code in PR #915:
URL: https://github.com/apache/dubbo-go-pixiu/pull/915#discussion_r3135260069


##########
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:
   Marking PrePickEndpointIndex as `yaml:"-" json:"-"` makes the cursor 
disappear when `CloneStore()` serializes the current store and 
`fetchCompareAndSet()` rebuilds a fresh store before `CompareAndSetStore()`. 
   Spring Cloud 的 adapter 会通过 CloneStore -> CompareAndSetStore 这条链路动态刷新 cluster
   On the Spring Cloud refresh path, that means every registry sync resets 
round-robin back to endpoint 0, biasing traffic toward the first healthy 
endpoint whenever the store is refreshed. Before this change the exported field 
survived the clone, so this is a behavior regression outside the new unit 
coverage.



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