jurmous / etcd4j

Java / Netty client for etcd, the highly-available key value store for shared configuration and service discovery.
Apache License 2.0
267 stars 83 forks source link

Will the EtcdClient get auto-refreshed when cluster changed? #151

Closed wjxie closed 7 years ago

wjxie commented 7 years ago

Hi, I've read the release note and issues but got nothing about that. We know that etcd is designed as unstable, but what EtcdClient behaves when any nodes joined/left the cluster? I'm puzzling, eg:

  1. I do some get on a cluster which has node A, B and C, then D and E joined the cluster. Will the client auto-refresh the uris on the client (so that will get better reading-performance) ?

  2. And what about some member leaving the cluster? For example, i watched some key on node A with timeout -1 just now, and then A terminated (or just left the cluster), will the watch auto-reconnect (and new request will never connect to A) ?

I look through the code but didn't find processing about that. Maybe we can polling cluster stats regularly and re-gen the client, but so smelly --- and expensive. Use DNS maybe helpful, but still have its limitations.

Could you give me some directions help to fight this?

lburgazzoli commented 7 years ago

No it does not refresh the address list, this may be addresses in the future by coreos/jetcd