[sheepdog] [PATCH v3] zookeeper: multi-sheep cluster in one zookeeper support

Xu Yifeng skypexu at gmail.com
Mon Mar 2 10:17:57 CET 2015


On 2015年03月02日 17:11, Liu Yuan wrote:
> On Mon, Mar 02, 2015 at 03:51:32PM +0800, Yu Yang wrote:
>> From: Yu Yang <yuyang at cmss.chinamobile.com>
>>
>> An optional "chroot" suffix can be appended to the connection
>> string(or hosts list). This will run the client commands while
>> interpreting all paths relative to this root.
>> Different sheep clusters have their own root znode,
>> so one zk can support muilt-sheep cluster.
>> If it is not set, the default root is /sheepdog,
>> which is compatible with old versions.
>>
>> Signed-off-by: Yu Yang <yuyang at cmss.chinamobile.com>
> Applied thanks.
>
> Yuan


it would be better if you could insert a blank line between declaration 
and body.

yfxu at xyf:~/sheepdog$ git diff
diff --git a/sheep/cluster/zookeeper.c b/sheep/cluster/zookeeper.c
index 9dace4f..e8627e4 100644
--- a/sheep/cluster/zookeeper.c
+++ b/sheep/cluster/zookeeper.c
@@ -1384,6 +1384,7 @@ static int zk_prepare_root(const char *hosts)
         const char *p = strchr(hosts, '/');
         int interval, max_retry, retry;
         int i = 0;
+
         if (p) {
                 if (strlen(p) >= MAX_NODE_STR_LEN) {
                         strncpy(root, p, MAX_NODE_STR_LEN - 1);




More information about the sheepdog mailing list