AlexStocks commented on code in PR #1023:
URL: https://github.com/apache/dubbo-go-pixiu/pull/1023#discussion_r3883697499
##########
pkg/filter/http/grpcproxy/connection_manager_test.go:
##########
@@ -253,6 +257,108 @@ func
TestGRPCConnectionManagerRejectsEvictedRemovedEndpointFromSnapshot(t *testi
require.Zero(t, dialCalls.Load())
}
+func TestFilterFactoryIgnoresStaleRemovalAfterTombstoneEviction(t *testing.T) {
+ const clusterName = "stale-removal-cluster"
+
+ endpoint := startTestGRPCServer(t)
+ primary := &model.Endpoint{
+ ID: "primary",
+ Name: "primary",
+ Address: model.SocketAddress{Address: "127.0.0.1"},
+ }
+ require.NoError(t, parseEndpointPort(primary, endpoint))
+
+ clusterManager := server.CreateDefaultClusterManager(&model.Bootstrap{
+ StaticResources: model.StaticResources{
+ Clusters: []*model.ClusterConfig{
+ {
+ Name: clusterName,
+ LbStr: model.LoadBalancerRoundRobin,
+ Endpoints: []*model.Endpoint{primary},
+ },
+ },
+ },
+ })
+ factory := (&Plugin{}).newFilterFactory(clusterManager)
Review Comment:
[P1] 这条用例仍不能证明 snapshot guard 和公开 factory wiring 生效
这里直接调用私有 `newFilterFactory(clusterManager)`,没有经过 `Plugin.CreateFilterFactory
-> server.GetClusterManager` 的生产入口;即使公开入口未正确取得或安装
ClusterManager,本测试仍会通过。当前事件顺序也没有真正淘汰 primary 的 version:primary 在 tombstone
churn 前已经通过 `UpdateCluster` 重新加入并获得更新的 `present=true` version,后续删除的只是 `churn-*`
地址,所以即使移除 `UpdateEndpointState` 新增的 snapshot guard,延迟的旧 removal 仍会被现有
`eventVersion <= endpointEventVers[key]` 判断丢弃。请从公开 `CreateFilterFactory` 建立
factory,并先让 primary 的 removal/version 进入 tombstone、经 churn 被淘汰,再 re-add primary
并释放旧 callback;同时用删除 snapshot guard 的 mutant 证明该用例会失败。
--
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]