-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4596/
-----------------------------------------------------------

Review request for zookeeper.


Summary
-------

This is a patch for ZOOKEEEPER-1355 
(https://issues.apache.org/jira/browse/ZOOKEEPER-1355) to allow changing the 
list of servers the clients will connect to dynamically as needed. E.g. to 
support rolling restart or future support for dynamic zookeeper (ZOOKEEPER-107).

>From ZOOKEEPER-1355:

When the set of servers changes, we would like to update the server list stored 
by clients without restarting the clients.
Moreover, assuming that the number of clients per server is the same (in 
expectation) in the old configuration (as guaranteed by the current list 
shuffling for example), we would like to re-balance client connections across 
the new set of servers in a way that a) the number of clients per server is the 
same for all servers (in expectation) and b) there is no excessive/unnecessary 
client migration.

It is simple to achieve (a) without (b) - just re-shuffle the new list of 
servers at every client. But this would create unnecessary migration, which 
we'd like to avoid.

We propose a simple probabilistic migration scheme that achieves (a) and (b) - 
each client locally decides whether and where to migrate when the list of 
servers changes. The attached document describes the scheme and shows an 
evaluation of it in Zookeeper. We also implemented re-balancing through a 
consistent-hashing scheme and show a comparison. We derived the probabilistic 
migration rules from a simple formula that we can also provide, if someone's 
interested in the proof.


Diffs
-----

  ./src/c/src/addrvec.c PRE-CREATION 
  ./src/c/src/addrvec.h PRE-CREATION 
  ./src/c/Makefile.am 1307721 
  ./src/c/include/zookeeper.h 1307721 
  ./src/c/src/hashtable/hashtable_itr.h 1307721 
  ./src/c/src/mt_adaptor.c 1307721 
  ./src/c/src/st_adaptor.c 1307721 
  ./src/c/src/zk_adaptor.h 1307721 
  ./src/c/src/zookeeper.c 1307721 
  ./src/c/tests/TestReconfig.cc PRE-CREATION 
  ./src/c/tests/TestZookeeperClose.cc 1307721 
  ./src/c/tests/TestZookeeperInit.cc 1307721 
  ./src/c/tests/ZKMocks.cc 1307721 
  ./src/docs/src/documentation/content/xdocs/zookeeperProgrammers.xml 1307721 
  ./src/java/main/org/apache/zookeeper/ZooKeeper.java 1307721 
  ./src/java/main/org/apache/zookeeper/client/HostProvider.java 1307721 
  ./src/java/main/org/apache/zookeeper/client/StaticHostProvider.java 1307721 
  ./src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java 1307721 
  ./src/java/test/org/apache/zookeeper/test/StaticHostProviderTest.java 1307721 

Diff: https://reviews.apache.org/r/4596/diff


Testing
-------

Lots of included unit tests (e.g. TestReconfig.c on C side and 
StaticHostProviderTest.java on the java side).


Thanks,

Marshall

Reply via email to