[sheepdog] [PATCH] Modified zookeeper driver to support multi-sheep cluster in one zookeeper cluster. In order to distinguish different sheep cluster in one zookeeper, one more level directory is added in znode as domain. The same domain means the same sheep cluster. For example, the current directory tree seems like /sheepdog/(queue, member, master, lock), in this patch, it seems like /sheepdog/domain/(queue, member, master, lock). In sheep.c, cluster_help is modified for tips, In zookeeper.c, all codes related to znode path is modified.

Liu Yuan namei.unix at gmail.com
Thu Feb 26 03:59:35 CET 2015


On Tue, Feb 24, 2015 at 06:17:57PM +0800, Yu Yang wrote:
> Signed-off-by: Yu Yang <yuyang at cmss.chinamobile.com>
> ---
>  sheep/cluster/zookeeper.c |  197 +++++++++++++++++++++++++++++++--------------
>  sheep/sheep.c             |    8 +-
>  2 files changed, 142 insertions(+), 63 deletions(-)
> 

There is a log ot compiler complaints, please fix them first.

uster/zookeeper.c: In function ‘zk_queue_push’:
cluster/zookeeper.c:550:3: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
   sscanf(buf, temp_char_form, &seq);
   ^
cluster/zookeeper.c: In function ‘zk_watcher’:
cluster/zookeeper.c:726:3: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
   ret = sscanf(path, temp_char_form, str);
   ^
cluster/zookeeper.c:737:3: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
   ret = sscanf(path, temp_char_form, &lock_id, str);
   ^
cluster/zookeeper.c:748:3: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
   ret = sscanf(path, temp_char_form, str);
   ^
cluster/zookeeper.c:756:3: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
   ret = sscanf(path, temp_char_form, str);
....

For a quick look, your usage of sscanf is wrong. temp_char_form should be a
format string.

Thanks
Yuan



More information about the sheepdog mailing list