[sheepdog] [PATCH v8 0/7] Improving zookeeper driver

Kai Zhang kyle at zelin.io
Wed Jun 26 05:01:21 CEST 2013


v8:
- add_event() returns 0 on success and -1 on error
- remove abuse of RETURN_IF_ERROR
- use if (__rc != ZOK) to check return code, other than if (__rc)

v7:
- add comments about rational to zookeeper.c
- add patch7 to clean up code

v6:
- add a lock to protect zk_compete_master() function
- make sure session timeout event will be safe and not trigger panic()
- use _kill_sheep() other than raw pkill in tests
- add copyright to tools/kill_zk_session.c
- rebase to upstream

v5:
- fixed error of hang on joining cluster
- update commit log
- add tests/functional/066 to reproduce concurrent start up error of old
  implementation

v4:
- fixed compile errors
- update check_zk_rc() to handle ZOPERATIONTIMEOUT and ZCONNECTIONLOSS
- rebase to upstream

v3:
- add another patch for handling session timeout of on the fly zookeeper
  operations

v2:
- fixed error of hang on joining cluster

Current zookeeper driver is fragile during bad network enviroment.
This series is to improve the robustness of zookeeper driver in fowlling ways:
- fix failure when multiple sheep join cluster concurrently
- re-join cluster when zookeeper session timeout
- handle ZINVALIDSTATE, don't call panic() simplely

Kai Zhang (7):
  zookeeper: fixed concurrent startup error
  tests/functional: add 067 for testing concurrent start up
  sheep: rejoin cluster after a zookeeper session timeout
  tools: add kill_zk_session
  tests/functional: add 068 for testing rejoin cluster
  zookeeper: handle session timeout for all zookeeper operations
  zookeeper: clean code by macro RETURN_IF_ERROR() and
    RETURN_VOID_IF_ERROR

 Makefile.am                |    2 +-
 configure.ac               |    3 +-
 sheep/cluster.h            |    1 +
 sheep/cluster/zookeeper.c  |  503 +++++++++++++++++++++++++++++++++-----------
 sheep/group.c              |   12 ++
 tests/functional/067       |   49 +++++
 tests/functional/067.out   |   13 ++
 tests/functional/068       |   46 ++++
 tests/functional/068.out   |   38 ++++
 tests/functional/common.rc |   15 ++
 tests/functional/group     |    2 +
 tools/Makefile.am          |   13 ++
 tools/kill_zk_session.c    |   71 +++++++
 13 files changed, 649 insertions(+), 119 deletions(-)
 create mode 100755 tests/functional/067
 create mode 100644 tests/functional/067.out
 create mode 100755 tests/functional/068
 create mode 100644 tests/functional/068.out
 create mode 100644 tools/Makefile.am
 create mode 100644 tools/kill_zk_session.c

--
1.7.9.5




More information about the sheepdog mailing list