Replies: 4 comments 3 replies
-
Hi @bbiao Thanks for reaching out! I think overriding default etcd resolver is not supported in any public documentation and it is subject to be changed in the future. Please see #15145. For dynamic endpoint discovery, I have two ideas that both v3.4 and v3.5 clientv3 supports. |
Beta Was this translation helpful? Give feedback.
-
Could you provide more details to help us understand more about your use case?
I am not sure I get the point. Do you mean previously when you were running etcd 3.4.x, your customized gRPC resolver was working well (if yes, could you share more details?), but after upgrading to etcd 3.5, then your customized resolver doesn't work any more? |
Beta Was this translation helpful? Give feedback.
-
There are two particular concerns in my case:
When I use etcd client v3's old version (v3.4.13+incompatible, maybe before this commit: #12671), I write code like this:
My resolver will take effects, but after the client v3 is upgraded to the latest version, my resolver will be ignored since the default grpc.Resolver will take control. Line 286 in cca2003 My resolver will be appended after the default resolver. Since grpc will use the first resolver it finds that matches the scheme, later resolvers will have no effect. |
Beta Was this translation helpful? Give feedback.
-
despite the current unstable situation of the grpc-go resolver api, IMHO, it (or its successor) is a great place to extend etcd client to support in house dynamic deployment. in our organization, we implemented dynamic etcd server address lookup(non DNS compatible) in golang, java and c++. jetcd does not have a equivalent SetEndpoint()/Sync() api as golang implementation. (i believe most of open source c++ clients don't implement them neither). Then we found out grpc's resolver machinery is the place that we can share the same address lookup/balance logic for 3 languages (or other language in the future) it would be great if the new design can take custom resolver into account 😄 cc @chaochn47 |
Beta Was this translation helpful? Give feedback.
-
Hi, I deploy Etcd in an dynamic environment, which means the machine Etcd used may changed time to time. Usually I use customized grpc.Resolver to find the new Etcd endpoint from a third-party storage. But since I upgrade Etcd client to v3.5, Etcd itself uses a grpc.Resolver to do the endpoint discovery and load-balancing, my own customized grpc.Resolver no longer take effects.
Etcd setup its own grpc.Resolver (
etcd/client/v3/client.go
Line 286 in cca2003
After that, user's grpc.DialOptions append to it (
etcd/client/v3/client.go
Line 300 in cca2003
In grpc, used the first grpd.Resolver match the scheme: (https://github.com/grpc/grpc-go/blob/5d3d9d7ca53038fa1a7f003561ea3f7c0870c648/clientconn.go#L1763)
My questions is:
opts = append(opts, c.cfg.DialOptions...)
to move the userDialOptions
before the etcd default to make some Options override default? In simple, just change that toopts = append(c.cfg.DialOptions, opts...)
?Beta Was this translation helpful? Give feedback.
All reactions