[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14127938#comment-14127938
 ] 

Hongchao Deng commented on ZOOKEEPER-2016:
------------------------------------------

[~shralex]
I encountered a problem about QuorumUtil.

Created 3 servers using QuorumUtil(1).
{code}
Creating QuorumPeer 1; public port 11221
Creating QuorumPeer 2; public port 11224
Creating QuorumPeer 3; public port 11223
{code}

Created a ZooKeeper object with connectString: 
"127.0.0.1:11221,127.0.0.1:11224,127.0.0.1:11227".
After resolveAndShuffle() in StaticHostProvider, it looks like:
{code}
127.0.0.1/127.0.0.1:11227
127.0.0.1/127.0.0.1:11224
127.0.0.1/127.0.0.1:11221
{code}

However, zk.getConfig() returns 
"localhost:11221,localhost:11227,localhost:11224".
After resolveAndShuffle() in StaticHostProvider, it looks like:
{code}
localhost/0:0:0:0:0:0:0:1:11227
localhost/0:0:0:0:0:0:0:1:11221
localhost/127.0.0.1:11227
localhost/127.0.0.1:11221
localhost/127.0.0.1:11224
localhost/0:0:0:0:0:0:0:1:11224
{code}

In such situation, it will do rebalance even if both connectStrings are the 
"same".
This is caused by QuorumPeer that prefer hostname over ip address. I doubt that 
changing this would be dangerous. However, if we don't change it, auto 
rebalance behavior won't be expected (one hostname could be resolved to >1 ip 
addresses), which affects probability.

Do you have any idea?

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

Reply via email to