[
https://issues.apache.org/jira/browse/ZOOKEEPER-2016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14121521#comment-14121521
]
Alexander Shraer commented on ZOOKEEPER-2016:
---------------------------------------------
issue #1: I see. So the client's connection string may not be up-to-date with
the latest list of servers. I think you're right - perhaps my previous
suggestion isn't good and it may be better to call updateServerList even the
first time as you suggest.
issue #2: this is actually not a problem: each client has a random permutation
of the servers (its created in StaticHostProvider when you give it a connection
string). When a client disconnects from its current server it will try to
connect to the next server on its own list, so hopefully the next server for
each client is chosen uniformly at random and the system will remain balanced.
btw, it seems that eventually we may need to add one more thing - suppose that
we have ZK deployed in multiple datacenters. You wouldn't want clients from one
data center conecting to servers in the other. So
we may need to pass some kind of filter for the server list that given the new
configuration is able to remove all servers irrelevant for this client. I'm not
sure exactly how to do this, but just wanted to mention that this may be an
issue for some users.
> Automate client-side rebalancing
> --------------------------------
>
> Key: ZOOKEEPER-2016
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2016
> Project: ZooKeeper
> Issue Type: Improvement
> Reporter: Hongchao Deng
> Attachments: draft-2.patch, draft.patch
>
>
> ZOOKEEPER-1355 introduced client-side rebalancing, which is implemented in
> both the C and Java client libraries. However, it requires the client to
> detect a configuration change and call updateServerList with the new
> connection string (see reconfig manual). It may be better if the client just
> indicates that he is interested in this feature when creating a ZK handle and
> we'll detect configuration changes and invoke updateServerList for him
> underneath the hood.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)