At Tue, 4 Oct 2011 21:38:52 +0900, MORITA Kazutaka wrote: > > 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. > > > Changes from v1 to v2 are: > > - split patches to make them easy to read > - address Yibin's comments > > > MORITA Kazutaka (6): > sheep: define cluster driver interface > sheep: remove corosync nodeid > cluster: add corosync driver > sheep: make first_cpg_node local > sheep: use cluster driver > cluster: add check for cluster driver definition > > sheep/Makefile.am | 2 +- > sheep/cluster.h | 160 ++++++++++++++ > 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, 671 insertions(+), 329 deletions(-) > create mode 100644 sheep/cluster.h > create mode 100644 sheep/cluster/corosync.c Applied this patchset. The current sheep/group.c is still complex, so I think of moving more things from it to the cluster driver. I'll send the patches later. Thanks, Kazutaka |