[sheepdog] [PATCH v0, RFC] sheep: writeback cache semantics in backend store

2012-08-16 Thread Hitoshi Mitake
From: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp Hi sheepdog list, nice to meet you. This patch implements writeback cache semantics in backend store of sheep. Current backend store farm calls open() with O_DSYNC, so every object write causes slow disk access. This incurs overhead

Re: [sheepdog] [PATCH v0, RFC] sheep: writeback cache semantics in backend store

2012-08-18 Thread Hitoshi Mitake
forward the flush to all nodes. Thanks for your advices. I'll try to solve this problem in the next version. -- Hitoshi Mitake h.mit...@gmail.com -- sheepdog mailing list sheepdog@lists.wpkg.org http://lists.wpkg.org/mailman/listinfo/sheepdog

Re: [sheepdog] [PATCH v1, RFC] sheep: writeback cache semantics in backend store

2012-08-29 Thread Hitoshi Mitake
On Wed, Aug 29, 2012 at 12:36 PM, Liu Yuan namei.u...@gmail.com wrote: On 08/29/2012 07:21 AM, MORITA Kazutaka wrote: At Wed, 29 Aug 2012 01:56:10 +0900, Hitoshi Mitake wrote: v1: differences from v0 are, * check syncfs() in configure script * send SD_OP_FLUSH_PEER to all sheeps Please

[sheepdog] [PATCH v2 0/3] sheep: writeback cache semantics in backend store

2012-09-01 Thread Hitoshi Mitake
of SD_OP_FLUSH_VDI instead of every object write can improve performance when a number of VMs is not so large. Hitoshi Mitake (3): sheep: change gateway_forward_request() for forwarding requests to all other nodes sheep: add new operation flush() to store_driver sheep: add SD_OP_SYNC_VDI

[sheepdog] [PATCH v2 2/3] sheep: add new operation flush() to store_driver

2012-09-01 Thread Hitoshi Mitake
Kazutaka morita.kazut...@lab.ntt.co.jp Cc: Liu Yuan tailai...@taobao.com Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- configure.ac|2 +- sheep/farm/farm.c |1 + sheep/plain_store.c | 32 sheep/sheep_priv.h |2 ++ 4 files

[sheepdog] [PATCH v2 3/3] sheep: add SD_OP_SYNC_VDI and SD_OP_FLUSH_PEER for writeback cache semantics

2012-09-01 Thread Hitoshi Mitake
writeback cache semantics of disks, and enable object cache with 50MB memory -w object:50 ... enable object cache with 50MB memory Cc: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Cc: Liu Yuan tailai...@taobao.com Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- include/internal_proto.h

Re: [sheepdog] [PATCH v2 0/3] sheep: writeback cache semantics in backend store

2012-09-02 Thread Hitoshi Mitake
On Sun, Sep 2, 2012 at 2:58 PM, Liu Yuan namei.u...@gmail.com wrote: On 09/02/2012 10:34 AM, Hitoshi Mitake wrote: This patch series implements writeback cache semantics in backend store of sheep. Current backend store farm and plain_store calls open() with O_DSYNC, so every object write

Re: [sheepdog] [PATCH v2 0/3] sheep: writeback cache semantics in backend store

2012-09-03 Thread Hitoshi Mitake
(2012/09/03 15:51), Hitoshi Mitake wrote: I have got a core dump by following one liner: $ while (($?==0));do sudo ./check -corosync 26;done (gdb) bt #0 0x7fa3fc81dba5 in raise (sig=value optimized out) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #1 0x7fa3fc8216b0 in abort

Re: [sheepdog] [PATCH v2 0/3] sheep: writeback cache semantics in backend store

2012-09-04 Thread Hitoshi Mitake
(2012/09/03 16:15), Liu Yuan wrote: On 09/03/2012 03:08 PM, Hitoshi Mitake wrote: BTW, I have two questions. How many iteration did it take to produce this segfault? It seems that reproducing this segfault is hard, it happens rarely on my environment. Less than 10 times, but it depends

Re: [sheepdog] [PATCH v2 0/3] sheep: writeback cache semantics in backend store

2012-09-04 Thread Hitoshi Mitake
(2012/09/04 15:54), Liu Yuan wrote: On 09/04/2012 02:41 PM, Hitoshi Mitake wrote: On my environment, I needed to iterate more than few ten times to reproduce the bug. In addition, the crash of sheep on my environment might not be segfault. Instead of core dump, I could find this output in 026

Re: [sheepdog] [PATCH v2 0/3] sheep: writeback cache semantics in backend store

2012-09-04 Thread Hitoshi Mitake
(2012/09/04 16:24), Liu Yuan wrote: On 09/04/2012 02:41 PM, Hitoshi Mitake wrote: QA output created by 026 using backend farm store [main] do_read(275) failed to read from socket: -1 [main] exec_req(362) failed to read a response failed to connect to 127.0.0.1:7005 42 Okay, if your sheep

Re: [sheepdog] [PATCH v2 1/3] sheep: change gateway_forward_request() for forwarding requests to all other nodes

2012-09-04 Thread Hitoshi Mitake
(2012/09/05 12:39), Liu Yuan wrote: On 09/02/2012 10:34 AM, Hitoshi Mitake wrote: @@ -301,7 +319,7 @@ int gateway_write_obj(struct request *req) if (sys-enable_write_cache !req-local !bypass_object_cache(req)) return object_cache_handle_request(req); - return

Re: [sheepdog] [PATCH v2 3/3] sheep: add SD_OP_SYNC_VDI and SD_OP_FLUSH_PEER for writeback cache semantics

2012-09-04 Thread Hitoshi Mitake
(2012/09/05 12:47), Liu Yuan wrote: On 09/02/2012 10:34 AM, Hitoshi Mitake wrote: +int peer_flush(struct request *req) +{ + return sd_store-flush(); +} I think We'd better check it gateway_only mode at peer_flush(), store driver should only concentrate on serving the requests

[sheepdog] [PATCH v3 0/4] sheep: writeback cache semantics in backend store

2012-09-05 Thread Hitoshi Mitake
of SD_OP_FLUSH_VDI instead of every object write can improve performance when a number of VMs is not so large. Hitoshi Mitake (4): sheep: change gateway_forward_request() for forwarding requests to all other nodes sheep: add new operation flush() to store_driver sheep: add SD_OP_SYNC_VDI

[sheepdog] [PATCH v3 4/4] tests: modify usage of -w in 018, 019, 020 for new cache option

2012-09-05 Thread Hitoshi Mitake
From: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp -w cache size is obsolete, so this patch modifies -w usage in 018, 019, 020. Cc: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Cc: Liu Yuan tailai...@taobao.com Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- tests/018 |2

Re: [sheepdog] [PATCH v3 1/4] sheep: change gateway_forward_request() for forwarding requests to all other nodes

2012-09-06 Thread Hitoshi Mitake
(2012/09/06 15:52), MORITA Kazutaka wrote: At Wed, 5 Sep 2012 23:31:02 +0900, Hitoshi Mitake wrote: 8--- v3: add new helper function init_target_nodes() for reducing unnecessary conditional branches 8--- Please write scissors lines so that we can remove them with git-am --scissors. Sorry

Re: [sheepdog] [PATCH v3 2/4] sheep: add new operation flush() to store_driver

2012-09-06 Thread Hitoshi Mitake
(2012/09/06 15:56), MORITA Kazutaka wrote: At Wed, 5 Sep 2012 23:31:03 +0900, Hitoshi Mitake wrote: +int default_flush(void) +{ + int fd; + + if (sys-gateway_only) + return SD_RES_SUCCESS; + + fd = open(obj_path, O_RDONLY); + if (fd 0

Re: [sheepdog] [PATCH v3 3/4] sheep: add SD_OP_SYNC_VDI and SD_OP_FLUSH_PEER for writeback cache semantics

2012-09-06 Thread Hitoshi Mitake
(2012/09/06 16:00), MORITA Kazutaka wrote: At Wed, 5 Sep 2012 23:31:04 +0900, Hitoshi Mitake wrote: diff --git a/include/internal_proto.h b/include/internal_proto.h index 5288823..06f74fa 100644 --- a/include/internal_proto.h +++ b/include/internal_proto.h @@ -65,6 +65,8 @@ #define

[sheepdog] [PATCH v4 0/4] sheep: writeback cache semantics in backend store

2012-09-06 Thread Hitoshi Mitake
of SD_OP_FLUSH_VDI instead of every object write. This strategy can improve performance when a number of VMs is not so large. Hitoshi Mitake (4): sheep: change gateway_forward_request() for forwarding requests to all other nodes sheep: add new operation flush() to store_driver sheep: add

[sheepdog] [PATCH v4 2/4] sheep: add new operation flush() to store_driver

2012-09-06 Thread Hitoshi Mitake
Kazutaka morita.kazut...@lab.ntt.co.jp Cc: Liu Yuan tailai...@taobao.com Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- v4: close the file descriptor for syncfs() even if syncfs() returns error 8--- configure.ac|2 +- sheep/farm/farm.c |1 + sheep/plain_store.c | 31

[sheepdog] [PATCH v4 1/4] sheep: change gateway_forward_request() for forwarding requests to all other nodes

2012-09-06 Thread Hitoshi Mitake
From: Hitoshi Mitake h.mit...@gmail.com This patch adds a new boolean parameter all_node to gateway_forward_request(). When this parameter is true, gateway_forward_request() forwards a request to all other nodes instead of vnodes which store the object. Cc: MORITA Kazutaka morita.kazut

[sheepdog] [PATCH v4 3/4] sheep: add SD_OP_FLUSH_NODES and SD_OP_FLUSH_PEER for writeback cache semantics

2012-09-06 Thread Hitoshi Mitake
...@taobao.com Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- v4: * rename SD_OP_SYNC_VDI - SD_OP_FLUSH_NODES * cleaning the members related to cache in struct cluster_info * change option -w. Using direct IO for object cache can be specified like this: -w object:directio v3: move

Re: [sheepdog] [PATCH v4 0/4] sheep: writeback cache semantics in backend store

2012-09-07 Thread Hitoshi Mitake
(2012/09/07 16:08), MORITA Kazutaka wrote: At Fri, 7 Sep 2012 14:25:50 +0900, Hitoshi Mitake wrote: This patch series implements writeback cache semantics in backend store of sheep. Current backend store farm and plain_store calls open() with O_DSYNC, so every object write causes slow disk

Re: [sheepdog] [PATCH v4 0/4] sheep: writeback cache semantics in backend store

2012-09-07 Thread Hitoshi Mitake
(2012/09/07 16:09), Hitoshi Mitake wrote: (2012/09/07 16:08), MORITA Kazutaka wrote: At Fri, 7 Sep 2012 14:25:50 +0900, Hitoshi Mitake wrote: This patch series implements writeback cache semantics in backend store of sheep. Current backend store farm and plain_store calls open() with O_DSYNC

[sheepdog] [PATCH 2/2] sheep: use node_is_local() instead of is_myself()

2012-09-07 Thread Hitoshi Mitake
node_is_local() is added to sheep_priv.h, using it instead of is_myself() is a little bit better Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- sheep/group.c |4 ++-- sheep/store.c |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sheep/group.c b/sheep

[sheepdog] [PATCH 1/2] trivial: ignore *.patch and tests/*.out.bad in .gitignore

2012-09-07 Thread Hitoshi Mitake
Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- .gitignore |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index 2e02946..dbdbd55 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,6 @@ script/generic tests/check.log tests

[sheepdog] [PATCH] sheep: include config.h in plain_store.c for HAVE_SYNCFS

2012-09-07 Thread Hitoshi Mitake
config.h is required for determine HAVE_SYNCFS is defined or not. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- sheep/plain_store.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/sheep/plain_store.c b/sheep/plain_store.c index 1cd0038..933fefe 100644

Re: [sheepdog] [PATCH] sheep: include sheepdog_proto.h from internal_proto.h for STORE_LEN

2012-09-18 Thread Hitoshi Mitake
(2012/09/19 14:22), Liu Yuan wrote: On 09/18/2012 07:40 PM, Hitoshi Mitake wrote: Current internal_proto.h doesn't include sheepdog_proto.h. This can cause compile error because STORE_LEN is defined in sheepdog_proto.h. I don't meet the compile error on my box. how did it happen? Current

[sheepdog] [PATCH] sheep: fix a little bug of is_master() in corosync.c

2012-09-26 Thread Hitoshi Mitake
Current is_master() in sheep/cluster/corosync.c has a possibility of reading array with invalid index. This patch fix the little bug. Signed-off-by: Hitoshi Mitake h.mit...@gmail.com --- sheep/cluster/corosync.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/sheep

[sheepdog] [PATCH RFC] sheep: remove assert() for better error messages

2012-10-01 Thread Hitoshi Mitake
. From my experience, using assert() directly in daemon processes makes debugging hard. So this patch adds wrappers of assert() and daemon(). With this patch, assert() can find suitable fd for error messages and the error messages can appear in a log file of sheep. Signed-off-by: Hitoshi Mitake

[sheepdog] Question about memory allocation functions in lib/util.c

2012-10-01 Thread Hitoshi Mitake
Hi, I have a question about the memory allocation functions in lib/util.c of sheepdog. It seems that xmalloc(), xcalloc(), and xrealloc() try to allocate 1 byte area if first allocation fails and the size of requested area is 0. e.g. this is the head part of of xmalloc() void *xmalloc(size_t

Re: [sheepdog] [PATCH RFC] sheep: remove assert() for better error messages

2012-10-05 Thread Hitoshi Mitake
On Wed, Oct 3, 2012 at 11:26 AM, MORITA Kazutaka morita.kazut...@lab.ntt.co.jp wrote: At Mon, 1 Oct 2012 22:34:25 +0900, Hitoshi Mitake wrote: diff --git a/include/sd_assert.h b/include/sd_assert.h new file mode 100644 index 000..05c553e --- /dev/null +++ b/include/sd_assert.h

[sheepdog] [PATCH v2] sheep: new assert() for better error messages

2012-10-05 Thread Hitoshi Mitake
-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- include/strbuf.h |1 - include/util.h| 18 ++ sheep/cluster/accord.c|2 +- sheep/cluster/local.c |2 +- sheep/cluster/zookeeper.c |2 +- sheep/group.c |1 - sheep

Re: [sheepdog] Question about memory allocation functions in lib/util.c

2012-10-08 Thread Hitoshi Mitake
On Wed, Oct 3, 2012 at 11:43 AM, MORITA Kazutaka morita.kazut...@lab.ntt.co.jp wrote: At Mon, 1 Oct 2012 22:46:34 +0900, Hitoshi Mitake wrote: Hi, I have a question about the memory allocation functions in lib/util.c of sheepdog. It seems that xmalloc(), xcalloc(), and xrealloc() try

[sheepdog] sheepkeeper: a new cluster manager specialized for sheepdog

2012-10-19 Thread Hitoshi Mitake
Hi, I'm developing a new cluster manager specialized for sheepdog, named sheepkeeper. The source code can be found in: https://github.com/mitake/sheepdog/tree/sheepkeeper-devel This is still very incomplete, very buggy and very inefficient. The degree of incompleteness is that it doesn't free()

[sheepdog] [PATCH] collie: node kill needs node list before its execution

2012-10-19 Thread Hitoshi Mitake
@taobao.com Cc: Liu Yuan tailai...@taobao.com Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- collie/node.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/collie/node.c b/collie/node.c index b5aeec1..161c295 100644 --- a/collie/node.c +++ b/collie/node.c @@ -212,7

[sheepdog] [PATCH] sheepkeeper: a new cluster manager specialized for sheepdog

2012-10-21 Thread Hitoshi Mitake
. If you have some opinions or feature requests for a cluster manager designed and implemented from scratch, I'd like to hear your comments. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- .gitignore |1 + Makefile.am |2 +- configure.ac

[sheepdog] [PATCH] collie: remove invalid fallthrough in option parser of vdi

2012-10-26 Thread Hitoshi Mitake
The fallthrough in vdi_parser() seems a bug. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- collie/vdi.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/collie/vdi.c b/collie/vdi.c index e0581b8..f18f789 100644 --- a/collie/vdi.c +++ b/collie/vdi.c

[sheepdog] [PATCH] change type of the parameter of exec_req()

2012-10-28 Thread Hitoshi Mitake
Current exec_req() receives the parameter wlen as unsigned int *. But I believe this is confusing, because exec_req() never updates the content of wlen. So this patch changes the type of wlen from unsigned int * to unsigned int. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp

[sheepdog] [PATCH] sheep: set the length of response in local_get_store_list()

2012-10-28 Thread Hitoshi Mitake
-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- sheep/ops.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/sheep/ops.c b/sheep/ops.c index df4831b..45bba43 100644 --- a/sheep/ops.c +++ b/sheep/ops.c @@ -369,7 +369,7 @@ static int local_get_store_list(struct request

Re: [sheepdog] [PATCH] change type of the parameter of exec_req()

2012-10-29 Thread Hitoshi Mitake
On Mon, Oct 29, 2012 at 8:48 AM, MORITA Kazutaka morita.kazut...@lab.ntt.co.jp wrote: At Sun, 28 Oct 2012 16:07:45 +0900, Hitoshi Mitake wrote: Current exec_req() receives the parameter wlen as unsigned int *. But I believe this is confusing, because exec_req() never updates the content

Re: [sheepdog] [PATCH] sheepkeeper: a new cluster manager specialized for sheepdog

2012-11-04 Thread Hitoshi Mitake
On Sun, Nov 4, 2012 at 1:25 PM, Liu Yuan namei.u...@gmail.com wrote: On 10/21/2012 09:42 PM, Hitoshi Mitake wrote: This is still very incomplete, very buggy and very inefficient. The degree of incompleteness is that it doesn't free() obsolete memory area and checking return values of system

Re: [sheepdog] [PATCH] sheepkeeper: a new cluster manager specialized for sheepdog

2012-11-11 Thread Hitoshi Mitake
Thanks for your review. I'm preparing next patch which includes your review. But I have one trivial question. + +#define log(fmt, ...) do { \ + if (!daemonized) { \ +

[sheepdog] [PATCH v2 1/3] move node_to_str() and str_to_node() from sheep/cluster.h to include/internal_proto.h

2012-11-12 Thread Hitoshi Mitake
sheepkeeper uses node_to_str() and str_to_node(), so they should be moved to the header which can be included by other directories of sheep/. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- include/internal_proto.h | 41 + sheep/cluster.h

[sheepdog] [PATCH v2 0/3] sheepkeeper: a new cluster manager specialized for sheepdog

2012-11-12 Thread Hitoshi Mitake
This patchset adds sheepkeeper: a new cluster manager specialized for sheepdog. The 3rd patch actually adds sheepkeeper, 1st and 2nd do preparation for it. Hitoshi Mitake (3): move node_to_str() and str_to_node() from sheep/cluster.h to include/internal_proto.h logger: use syslog() when

[sheepdog] [PATCH v2 2/3] logger: use syslog() when outfile == NULL

2012-11-12 Thread Hitoshi Mitake
logger will be used by sheepkeeper. So this patch make logger use syslog() for logging when the parameter outfile of logger() is NULL. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- lib/logger.c | 44 +++- 1 files changed, 27 insertions

[sheepdog] [PATCH v2 3/3] sheepkeeper: a new cluster manager specialized for sheepdog

2012-11-12 Thread Hitoshi Mitake
designed and implemented from scratch, I'd like to hear your comments. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- v2 * lots of cleaning and bug fix * sane command line option handling * a little bit improvement of leave handling * not call sd_join_handler() in sheepkeeper_join

Re: [sheepdog] [PATCH v2 0/3] sheepkeeper: a new cluster manager specialized for sheepdog

2012-11-12 Thread Hitoshi Mitake
On Mon, Nov 12, 2012 at 6:42 PM, Liu Yuan namei.u...@gmail.com wrote: On 11/12/2012 04:58 PM, Hitoshi Mitake wrote: This patchset adds sheepkeeper: a new cluster manager specialized for sheepdog. The 3rd patch actually adds sheepkeeper, 1st and 2nd do preparation for it. Thanks for your

Re: [sheepdog] [PATCH v2 3/3] sheepkeeper: a new cluster manager specialized for sheepdog

2012-11-12 Thread Hitoshi Mitake
On Mon, Nov 12, 2012 at 7:06 PM, Liu Yuan namei.u...@gmail.com wrote: On 11/12/2012 04:58 PM, Hitoshi Mitake wrote: + ret = xwrite(sk_comm_fd, snd, sizeof(snd)); + if (ret != sizeof(snd)) { + vprintf(SDOG_ERR, xwrite() failed\n

Re: [sheepdog] [PATCH v2 0/3] sheepkeeper: a new cluster manager specialized for sheepdog

2012-11-12 Thread Hitoshi Mitake
(2012/11/13 14:33), Liu Yuan wrote: On 11/12/2012 07:55 PM, Hitoshi Mitake wrote: Because I couldn't find suitable single file for log from sheepkeeper. The relation between sheep and sheepkeeper is not 1:1. sheepkeeper can be executed on hosts which doesn't have sheep. So sheepkeeper shouldn't

[sheepdog] [PATCH v3 0/2] sheepkeeper: a new cluster manager specialized for sheepdog

2012-11-13 Thread Hitoshi Mitake
This patchset adds sheepkeeper: a new cluster manager specialized for sheepdog. The 2nd patch actually adds sheepkeeper, the 1st one do trivial preparation for it. Hitoshi Mitake (2): move node_to_str() and str_to_node() from sheep/cluster.h to include/internal_proto.h sheepkeeper: a new

[sheepdog] [PATCH v3 1/2] move node_to_str() and str_to_node() from sheep/cluster.h to include/internal_proto.h

2012-11-13 Thread Hitoshi Mitake
sheepkeeper uses node_to_str() and str_to_node(), so they should be moved to the header which can be included by other directories of sheep/. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- include/internal_proto.h | 41 + sheep/cluster.h

[sheepdog] [PATCH v3 2/2] sheepkeeper: a new cluster manager specialized for sheepdog

2012-11-13 Thread Hitoshi Mitake
From: Hitoshi Mitake h.mit...@gmail.com This patch adds sheepkeeper, a new cluster manager for sheepdog. sheepkeeper cluster manager is designed as master-slave. So it can be SPOF. But I'm planning to let it be redundant by utilizing corosync. If it can be improved, this can be an alternative

Re: [sheepdog] [PATCH v3 1/2] move node_to_str() and str_to_node() from sheep/cluster.h to include/internal_proto.h

2012-11-14 Thread Hitoshi Mitake
On Wed, Nov 14, 2012 at 6:47 PM, Liu Yuan namei.u...@gmail.com wrote: On 11/14/2012 05:34 PM, Hitoshi Mitake wrote: On my environment, I couldn't reproduce the problem of patch applying. Is your HEAD this: https://github.com/collie/sheepdog/commit/beea6156c9b730c8f3d81ee898273f2df7837cc8

[sheepdog] [PATCH] checkpatch.pl: report error when bzero() is found

2012-11-14 Thread Hitoshi Mitake
From: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp bzero() is obsolete. This should be treated as error by checkpatch.pl. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- script/checkpatch.pl |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/script

Re: [sheepdog] [PATCH v3 1/2] move node_to_str() and str_to_node() from sheep/cluster.h to include/internal_proto.h

2012-11-17 Thread Hitoshi Mitake
At Fri, 16 Nov 2012 17:28:38 +0900, MORITA Kazutaka wrote: At Wed, 14 Nov 2012 15:44:07 +0900, Hitoshi Mitake wrote: sheepkeeper uses node_to_str() and str_to_node(), so they should be moved to the header which can be included by other directories of sheep/. Signed-off

Re: [sheepdog] [PATCH v3 2/2] sheepkeeper: a new cluster manager specialized for sheepdog

2012-11-17 Thread Hitoshi Mitake
At Fri, 16 Nov 2012 17:25:59 +0900, MORITA Kazutaka wrote: AM_CONDITIONAL(BUILD_ACCORD, test x$enable_accord = xyes) +AC_ARG_ENABLE([sheepkeeper], + [ --enable-sheepkeeper: build sheepkeeper and its cluster driver ],, + [ enable_sheepkeeper=no ],)

[sheepdog] [PATCH 2/2] checkpatch.pl: trivial fix in bzero() checking

2012-11-30 Thread Hitoshi Mitake
Verry sorry, my previous change: da1c1b57789 didn't print positions of bzero() calling in checked patches. This patch fix the problem. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- script/checkpatch.pl |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[sheepdog] [PATCH 1/2] trivial: pass pointers of node_id for node_id_cmp() in node_eq()

2012-11-30 Thread Hitoshi Mitake
. Cc: Liu Yuan namei.u...@gmail.com Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- include/sheep.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/sheep.h b/include/sheep.h index 5bedfa8..e0d63a4 100644 --- a/include/sheep.h +++ b/include/sheep.h

[sheepdog] [PATCH 2/2] sheep: break event loop when killed with SIGTERM

2012-12-20 Thread Hitoshi Mitake
-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- sheep/sheep.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/sheep/sheep.c b/sheep/sheep.c index c3f4200..8af0192 100644 --- a/sheep/sheep.c +++ b/sheep/sheep.c @@ -127,6 +127,7 @@ static enum event_ret signal_handler

[sheepdog] [PATCH 0/2] more flexible controll of event loop

2012-12-20 Thread Hitoshi Mitake
sheep itself can benefit from this change. Hitoshi Mitake (2): lib: prioritize events for epoll() and enhance event loop sheep: break event loop when killed with SIGTERM include/event.h | 22 - lib/event.c | 106

[sheepdog] [PATCH 1/2] lib: prioritize events for epoll() and enhance event loop

2012-12-20 Thread Hitoshi Mitake
From: Hitoshi Mitake h.mit...@gmail.com This patch adds two new functionalities to event_loop(): 1. prioritize registered events 2. more flexible control with return values from event handlers I'd like to describe the objectives of two functionalities. 1. Current event_loop() treats priorities

[sheepdog] [PATCH] logger: add date and time to log messages even if an output is stdout

2012-12-20 Thread Hitoshi Mitake
From: Hitoshi Mitake h.mit...@gmail.com This patch makes logger to add date and time to log messages even if an output is stdout. It can be useful for debugging. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- lib/logger.c | 23 +++ 1 files changed, 23

Re: [sheepdog] [PATCH] logger: add date and time to log messages even if an output is stdout

2012-12-20 Thread Hitoshi Mitake
At Thu, 20 Dec 2012 20:26:16 +0800, Liu Yuan wrote: On 12/20/2012 05:48 PM, Hitoshi Mitake wrote: + if (!la) { + time_t t = time(NULL); + struct tm tm; + gmtime_r(t, tm); + + snprintf(p, size, %s %02d %02d:%02d:%02d , month(tm.tm_mon

[sheepdog] [PATCH v2] logger: add date and time to log messages even if an output is stdout

2012-12-20 Thread Hitoshi Mitake
From: Hitoshi Mitake h.mit...@gmail.com This patch let logger add date and time to log messages even if an output is stdout. It can be useful for debugging. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- v2: * Unify printing time method for any type of output * Eliminate

Re: [sheepdog] [PATCH 1/2] lib: prioritize events for epoll() and enhance event loop

2012-12-20 Thread Hitoshi Mitake
At Fri, 21 Dec 2012 13:20:20 +0800, Liu Yuan wrote: On 12/20/2012 05:41 PM, Hitoshi Mitake wrote: From: Hitoshi Mitake h.mit...@gmail.com This patch adds two new functionalities to event_loop(): 1. prioritize registered events 2. more flexible control with return values from event

Re: [sheepdog] [PATCH 1/2] lib: prioritize events for epoll() and enhance event loop

2012-12-20 Thread Hitoshi Mitake
At Fri, 21 Dec 2012 15:36:24 +0800, Liu Yuan wrote: # sheepkeeper is a heavy user of REFRESH, mainly for processing # leaving of sheeps. If you are wondering about the use case of it, # I can send this patch as a part of sheepkeeper patchset. Which one # do you prefer? No, you'd

[sheepdog] [PATCH v2 0/2] more flexible controll of event loop

2012-12-21 Thread Hitoshi Mitake
sheep itself can benefit from this change. v2: * change name of enum event_ret. e.g. EVENT_RET_DONE - EVENT_LOOP_NOP * eliminate an unnecessary array Hitoshi Mitake (2): lib: prioritize events for epoll() and enhance event loop sheep: break event loop when killed with SIGTERM include/event.h

[sheepdog] [PATCH v2 1/2] lib: prioritize events for epoll() and enhance event loop

2012-12-21 Thread Hitoshi Mitake
.) Cc: Liu Yuan tailai...@taobao.com Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- v2: * change name of enum event_ret. e.g. EVENT_RET_DONE - EVENT_LOOP_NOP * eliminate an unnecessary array 8--- include/event.h | 22 +++- lib/event.c | 84

[sheepdog] [PATCH v2 2/2] sheep: break event loop when killed with SIGTERM

2012-12-21 Thread Hitoshi Mitake
From: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp This patch makes signal event (rise of SIGTERM) as a highest prioritized event and lets signal_handler() return EVENT_LOOP_BREAK. So sheep can immediately exit after receiving the signal. This can enshort a time period of sys-state

Re: [sheepdog] [PATCH v2 1/2] lib: prioritize events for epoll() and enhance event loop

2012-12-22 Thread Hitoshi Mitake
At Sat, 22 Dec 2012 01:41:20 +0800, Liu Yuan wrote: On 12/22/2012 01:23 AM, Hitoshi Mitake wrote: + nr = epoll_wait(efd, polled_events, nr_events, TICK * 1000); if (nr 0) { if (errno == EINTR) return; eprintf(epoll_wait failed: %m\n

Re: [sheepdog] [PATCH v2 1/2] lib: prioritize events for epoll() and enhance event loop

2012-12-22 Thread Hitoshi Mitake
At Sat, 22 Dec 2012 02:00:04 +0800, Liu Yuan wrote: On 12/22/2012 01:23 AM, Hitoshi Mitake wrote: - ei = (struct event_info *)events[i].data.ptr; - ei-handler(ei-fd, events[i].events, ei-data); + case EVENT_LOOP_RETRIEVE

Re: [sheepdog] [PATCH v3] lib: prioritize events for epoll() and enhance event loop

2012-12-23 Thread Hitoshi Mitake
At Mon, 24 Dec 2012 10:23:18 +0800, Liu Yuan wrote: On 12/23/2012 11:57 PM, Hitoshi Mitake wrote: sheep/cluster/accord.c|6 ++- sheep/cluster/corosync.c |4 +- sheep/cluster/local.c |4 +- sheep/cluster/zookeeper.c |8 ++- sheep/request.c | 33

[sheepdog] [PATCH v4 0/3] sheepkeeper: a new cluster manager specialized for sheepdog

2012-12-23 Thread Hitoshi Mitake
-design-note * stabilizing. The unpassed tests are: 008 (long), 015, 043, and 044 (long). Hitoshi Mitake (3): move node_to_str() and str_to_node() from sheep/cluster.h to include/internal_proto.h move enum cluster_join_result from sheep/cluster.h to include/internal_proto.h sheepkeeper

[sheepdog] [PATCH v4 1/3] move node_to_str() and str_to_node() from sheep/cluster.h to include/internal_proto.h

2012-12-23 Thread Hitoshi Mitake
From: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp sheepkeeper uses node_to_str() and str_to_node(), so they should be moved to the header which can be included by other directories of sheep/. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- include/internal_proto.h | 41

[sheepdog] [PATCH v4 2/3] move enum cluster_join_result from sheep/cluster.h to include/internal_proto.h

2012-12-23 Thread Hitoshi Mitake
From: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp enum cluster_join_result is also used by sheepkeeper. So this patch moves it from sheep/ to include/. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- include/internal_proto.h | 10 ++ sheep/cluster.h | 10

[sheepdog] [PATCH v4 3/3] sheepkeeper: a new cluster manager specialized for sheepdog

2012-12-23 Thread Hitoshi Mitake
, and it doesn't depend on JVM. This patch adds the new directory sheepkeeper/ for it, and the executable binary will be produced as sheepkeeper/sheepkeeper. The cluster driver for sheep is added as sheep/cluster/sheepkeeper.c. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- v2

Re: [sheepdog] [PATCH v4 0/3] sheepkeeper: a new cluster manager specialized for sheepdog

2012-12-23 Thread Hitoshi Mitake
At Mon, 24 Dec 2012 15:46:53 +0800, Liu Yuan wrote: On 12/24/2012 03:44 PM, Hitoshi Mitake wrote: sheep/cluster/sheepkeeper.c | 713 + sheepkeeper/Makefile.am | 44 ++ sheepkeeper/sheepkeeper.c | 923

Re: [sheepdog] [PATCH RFC 1/2] sheepdev: linux kernel module of block device driver for sheepdog

2012-12-27 Thread Hitoshi Mitake
At Thu, 27 Dec 2012 22:00:41 +0800, levin li wrote: From: levin li xingke@taobao.com This module provides function for users to take sheepdog VDIs as block devices in linux, users can register a VDI to its kernel space, it just like that a new hard disk is added to the computer, users

[sheepdog] [PATCH v5 0/4] shepherd: a new cluster manager specialized for sheepdog

2013-01-08 Thread Hitoshi Mitake
. The unpassed tests are: 008 (long), 015, 043, and 044 (long). v5 * rename sheepkeeper - shepherd * a little bit cleaning * new document: https://github.com/mitake/sheepdog/wiki/shepherd-design-note Hitoshi Mitake (4): move node_to_str() and str_to_node() from sheep/cluster.h to include

[sheepdog] [PATCH v5 4/4] shepherd: a new cluster manager specialized for sheepdog

2013-01-08 Thread Hitoshi Mitake
opinions or feature requests for a cluster manager designed and implemented from scratch, I'd like to hear your comments. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- .gitignore |1 + Makefile.am |2 +- configure.ac |3

[sheepdog] [PATCH v5 3/4] lib: sockaddr_in_to_str(), convert sockaddr_in to string representation

2013-01-08 Thread Hitoshi Mitake
This patch adds new function sockaddr_in_to_str() to lib/net.c. This is for converting variables typed struct sockaddr_in to string representation. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- include/net.h |1 + lib/net.c | 17 + 2 files changed, 18

[sheepdog] [PATCH v5 1/4] move node_to_str() and str_to_node() from sheep/cluster.h to include/internal_proto.h

2013-01-08 Thread Hitoshi Mitake
shephered uses node_to_str() and str_to_node(), so they should be moved to the header which can be included by other directories of sheep/. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- include/internal_proto.h | 41 + sheep/cluster.h

Re: [sheepdog] [PATCH v5 1/4] move node_to_str() and str_to_node() from sheep/cluster.h to include/internal_proto.h

2013-01-09 Thread Hitoshi Mitake
At Wed, 09 Jan 2013 15:34:13 +0800, Liu Yuan wrote: On 01/09/2013 03:09 PM, Hitoshi Mitake wrote: shephered uses node_to_str() and str_to_node(), so they should be moved to the header which can be included by other directories of sheep/. It is better to put these helpers into sheep.h

Re: [sheepdog] [PATCH v5 0/4] shepherd: a new cluster manager specialized for sheepdog

2013-01-09 Thread Hitoshi Mitake
At Wed, 09 Jan 2013 15:29:31 +0800, Liu Yuan wrote: On 01/09/2013 03:09 PM, Hitoshi Mitake wrote: .gitignore |1 + Makefile.am |2 +- configure.ac |3 +- include/Makefile.am |3 +- include/internal_proto.h | 51

Re: [sheepdog] [PATCH v5 0/4] shepherd: a new cluster manager specialized for sheepdog

2013-01-09 Thread Hitoshi Mitake
At Wed, 09 Jan 2013 15:31:51 +0800, Liu Yuan wrote: On 01/09/2013 03:29 PM, Liu Yuan wrote: On 01/09/2013 03:09 PM, Hitoshi Mitake wrote: .gitignore |1 + Makefile.am |2 +- configure.ac |3 +- include/Makefile.am |3

Re: [sheepdog] [PATCH v5 0/4] shepherd: a new cluster manager specialized for sheepdog

2013-01-10 Thread Hitoshi Mitake
At Thu, 10 Jan 2013 19:50:48 +0800, Liu Yuan wrote: On 01/09/2013 11:42 PM, Hitoshi Mitake wrote: Adding *.def files to cscope.files is easy, so the cscope problem is not so serious. This macro technique is useful for keeping consistency between symbols and string expressions. I

[sheepdog] [PATCH v6 0/4] shepherd: a new cluster manager specialized for sheepdog

2013-01-16 Thread Hitoshi Mitake
/sheepdog/wiki/shepherd-design-note v6 * fix problems of coding style pointed by Liu Yuan Hitoshi Mitake (4): move node_to_str() and str_to_node() from sheep/cluster.h to include/sheep.h move enum cluster_join_result from sheep/cluster.h to include/internal_proto.h lib: sockaddr_in_to_str

[sheepdog] [PATCH v6 1/4] move node_to_str() and str_to_node() from sheep/cluster.h to include/sheep.h

2013-01-16 Thread Hitoshi Mitake
shephered uses node_to_str() and str_to_node(), so they should be moved to the header which can be included by other directories of sheep/. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- v6: move the functions to include/sheep.h, not include/internal_proto.h 8--- include/sheep.h

[sheepdog] [PATCH v6 2/4] move enum cluster_join_result from sheep/cluster.h to include/internal_proto.h

2013-01-16 Thread Hitoshi Mitake
enum cluster_join_result is also used by shepherd. So this patch moves it from sheep/ to include/. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- include/internal_proto.h | 10 ++ sheep/cluster.h | 10 -- 2 files changed, 10 insertions(+), 10

[sheepdog] [PATCH v6 3/4] lib: sockaddr_in_to_str(), convert sockaddr_in to string representation

2013-01-16 Thread Hitoshi Mitake
This patch adds new function sockaddr_in_to_str() to lib/net.c. This is for converting variables typed struct sockaddr_in to string representation. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- include/net.h |1 + lib/net.c | 17 + 2 files changed, 18

[sheepdog] [PATCH v6 4/4] shepherd: a new cluster manager specialized for sheepdog

2013-01-16 Thread Hitoshi Mitake
From: Hitoshi Mitake h.mit...@gmail.com This patch adds shepherd, a new cluster manager for sheepdog. shepherd is specialized for sheepdog, so it can be optimized only for sheepdog. shepherd cluster manager is designed as master-slave. So it can be SPOF. But I'm planning to let it be redundant

[sheepdog] [PATCH] checkpatch.pl: reduce obsolete checks

2013-01-17 Thread Hitoshi Mitake
lines) can be executed about 0.1 second faster) and cleaner. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- script/checkpatch.pl | 494 -- 1 files changed, 0 insertions(+), 494 deletions(-) diff --git a/script/checkpatch.pl b/script

[sheepdog] [PATCH 1/2] checkpatch.pl: forbid empty lines after break; line

2013-01-17 Thread Hitoshi Mitake
This patch lets checkpatch.pl forbid empty lines after break; line. For example, a patch which contains + break; + like this causes an error. Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- script/checkpatch.pl | 10 ++ 1 files changed, 10 insertions(+), 0

[sheepdog] [PATCH 2/2] checkpatch.pl: reduce an obsolete check

2013-01-17 Thread Hitoshi Mitake
Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- script/checkpatch.pl | 12 1 files changed, 0 insertions(+), 12 deletions(-) diff --git a/script/checkpatch.pl b/script/checkpatch.pl index e8bb542..d9486d3 100755 --- a/script/checkpatch.pl +++ b/script/checkpatch.pl

Re: [sheepdog] [PATCH 1/2] checkpatch.pl: forbid empty lines after break; line

2013-01-17 Thread Hitoshi Mitake
At Fri, 18 Jan 2013 01:56:11 +0900, Hitoshi Mitake wrote: This patch lets checkpatch.pl forbid empty lines after break; line. For example, a patch which contains + break; + like this causes an error. Sorry, I noticed this patch treats correct diffs like this as errors

Re: [sheepdog] [PATCH v6 0/4] shepherd: a new cluster manager specialized for sheepdog

2013-01-17 Thread Hitoshi Mitake
At Thu, 17 Jan 2013 18:09:58 +0800, Liu Yuan wrote: On 01/17/2013 10:25 AM, Hitoshi Mitake wrote: This patchset adds shepherd: a new cluster manager specialized for sheepdog. The 4th patch actually adds shepherd, the 1st, 2nd, and 3rd do trivial preparation for it. It can pass most

Re: [sheepdog] [PATCH v6 4/4] shepherd: a new cluster manager specialized for sheepdog

2013-01-17 Thread Hitoshi Mitake
At Thu, 17 Jan 2013 17:57:21 +0800, Liu Yuan wrote: On 01/17/2013 10:25 AM, Hitoshi Mitake wrote: sheep/cluster/shepherd.c | 704 shepherd/Makefile.am | 44 +++ shepherd/shepherd.c | 883

Re: [sheepdog] [PATCH v6 4/4] shepherd: a new cluster manager specialized for sheepdog

2013-01-17 Thread Hitoshi Mitake
At Fri, 18 Jan 2013 10:25:54 +0800, Liu Yuan wrote: On 01/17/2013 10:25 AM, Hitoshi Mitake wrote: + opt, sizeof(opt)); + if (ret == -1) + panic(setsockopt() for SO_REUSEADDR failed: %m\n); + + memset(listen_addr, 0, sizeof(listen_addr

Re: [sheepdog] [PATCH 2/2] checkpatch.pl: reduce an obsolete check

2013-01-17 Thread Hitoshi Mitake
At Fri, 18 Jan 2013 01:56:12 +0900, Hitoshi Mitake wrote: Signed-off-by: Hitoshi Mitake mitake.hito...@lab.ntt.co.jp --- script/checkpatch.pl | 12 1 files changed, 0 insertions(+), 12 deletions(-) diff --git a/script/checkpatch.pl b/script/checkpatch.pl index e8bb542

  1   2   3   4   5   6   7   8   9   10   >