[Sheepdog] [RFC PATCH 0/2] introduce cluster driver

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Thu Sep 29 22:28:56 CEST 2011


This patchset introduces a cluster driver, and moves all corosync
stuff to it.  The benefit of this abstraction is that we can support
other coordination systems such as ZooKeeper.  I like the current
fully symmetric architecture, but corosync has a problem in its
scalability.

The interface of the cluster driver is as follows.

struct cluster_driver {
	const char *name;
	int (*init)(struct cdrv_handlers *handlers, struct sheepid *myid);
	int (*join)(void);
	int (*leave)(void);
	int (*notify)(void *msg, size_t msg_len);
	int (*dispatch)(void);
};

This is a thin wrapper of corosync.  join() and leave() are used to
join/leave the cluster, and notify() is a multicasting to all nodes.
The sequence of their events must be totally ordered in the cluster.

This interface is designed not to affect the current Sheepdog codes so
much.  In future, I'd like to add more features to the cluster driver
and simplify sheep/group.c.  But, for now, this interface would be a
good start point.  In addition, I believe it is pretty easy to
implement a ZooKeeper driver with this interface.

Any opinions?


Thanks,

Kazutaka


MORITA Kazutaka (2):
  introduce cluster driver
  cluster: add corosync driver

 sheep/Makefile.am        |    2 +-
 sheep/cluster.h          |  157 ++++++++++++++
 sheep/cluster/corosync.c |  260 ++++++++++++++++++++++
 sheep/group.c            |  536 +++++++++++++++++++---------------------------
 sheep/sdnet.c            |    2 +
 sheep/sheep.c            |   24 ++-
 sheep/sheep_priv.h       |   16 +-
 7 files changed, 668 insertions(+), 329 deletions(-)
 create mode 100644 sheep/cluster.h
 create mode 100644 sheep/cluster/corosync.c

-- 
1.7.2.5




More information about the sheepdog mailing list