[Sheepdog] [PATCH v6 17/17] store: abstract VDI bitmap set-up

2012-01-12 Thread Liu Yuan
From: Liu Yuan Sheep needs to set system VDI bitmap when starting up. And VDI object is stored in the underlying backend stores which have different layouts. Signed-off-by: Liu Yuan --- sheep/farm/farm.c| 37 + sheep/simple_store.c | 43 +

[Sheepdog] [PATCH v6 16/17] farm: add format() support

2012-01-12 Thread Liu Yuan
From: Liu Yuan - add a format() hook to store driver interface. Signed-off-by: Liu Yuan --- sheep/farm/farm.c| 28 sheep/group.c|7 ++- sheep/ops.c |6 +- sheep/sheep_priv.h |3 +++ sheep/simple_store.c | 23 ++

[Sheepdog] [PATCH v6 15/17] collie: enable cluster-wide snapshot command

2012-01-12 Thread Liu Yuan
From: Liu Yuan Usage: $collie cluster snapshot # snapshot the whole cluster $collie cluster snapshot -l # list user snapshot info $collie cluster snapshot -R epoch # restore to state of targeted snapshot For e.g. below script #!/bin/bash pkill sheep rm store/* -rf for i in 0 1 2; do sheep/sheep

[Sheepdog] [PATCH v6 13/17] farm: add a documentation for farm internals

2012-01-12 Thread Liu Yuan
From: Liu Yuan Signed-off-by: Liu Yuan --- doc/farm-internal.txt | 121 + 1 files changed, 121 insertions(+), 0 deletions(-) create mode 100644 doc/farm-internal.txt diff --git a/doc/farm-internal.txt b/doc/farm-internal.txt new file mode 10064

[Sheepdog] [PATCH v6 14/17] sheep: add cluster snapshot/restore support

2012-01-12 Thread Liu Yuan
From: Liu Yuan This kind of snapshot is supposed be triggered by user, _not_ by recovery code. I don't think we need to restore to the state at the beginning of the recovery. So this work only permits us to restore cluster to the snapshot initiated by end users, thought it is quite easy to implem

[Sheepdog] [PATCH v6 12/17] farm: the farm impelmentation proper

2012-01-12 Thread Liu Yuan
From: Liu Yuan Farm is a new store for sheepdog with features [compared with Simple Store] - cluster wide snapshot. - node-wide data sharing for snapshot objects with the same content. so snapshoting is very cheap operation. - support 'collie cluster restore snapshot' to restore fully to th

[Sheepdog] [PATCH v6 11/17] sheep: add end_recover() hook to store.

2012-01-12 Thread Liu Yuan
From: Liu Yuan We need to notify underlying store when the recovery ends. Signed-off-by: Liu Yuan --- sheep/sheep_priv.h |1 + sheep/store.c |6 ++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/sheep/sheep_priv.h b/sheep/sheep_priv.h index 071b5ad..153fdc9 100

[Sheepdog] [PATCH v6 10/17] sheep: add begin_recover() hook to store.

2012-01-12 Thread Liu Yuan
From: Liu Yuan We need to notify underlying store when the recovery begins. Signed-off-by: Liu Yuan --- sheep/sheep_priv.h |1 + sheep/store.c |6 ++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/sheep/sheep_priv.h b/sheep/sheep_priv.h index 0a25c7d..071b5ad 1

[Sheepdog] [PATCH v6 09/17] farm: add snapshot object

2012-01-12 Thread Liu Yuan
From: Liu Yuan snap object is the meta data that describes the snapshot. Signed-off-by: Liu Yuan --- include/sheepdog_proto.h |8 ++ sheep/farm/farm.h|8 ++- sheep/farm/snap.c| 169 ++ 3 files changed, 184 insertions(+), 1 de

[Sheepdog] [PATCH v6 08/17] farm: remove stale object in backend store

2012-01-12 Thread Liu Yuan
From: Liu Yuan For storing one object into backend store, either a) no content change, then point to the same old sha1_file (no stale object) or b) content updated, then will point to a new object with a new sha1. So we need to remove stale object in case b), only in the assumption it is the ob

[Sheepdog] [PATCH v6 07/17] farm: add trunk object

2012-01-12 Thread Liu Yuan
From: Liu Yuan trunk object is meta data that describes the structure of the data objects at the timeline of snapshot being taken. Signed-off-by: Liu Yuan --- sheep/farm/farm.h | 25 ++ sheep/farm/trunk.c | 235 2 files changed, 260

[Sheepdog] [PATCH v6 06/17] farm: add sha1_file operations

2012-01-12 Thread Liu Yuan
From: Liu Yuan All the objects(snap, trunk, data) in the farm is based on the operations of the sha1_file. sha1_file provide us some useful features: - Regardless of object type, all objects are all in deflated with zlib, and have a header that not only specifies their tag, but also size in

[Sheepdog] [PATCH v6 05/17] sheep: check object directory path at start-up

2012-01-12 Thread Liu Yuan
From: Liu Yuan Signed-off-by: Liu Yuan --- sheep/store.c | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/sheep/store.c b/sheep/store.c index fa2849e..f0ca2bc 100644 --- a/sheep/store.c +++ b/sheep/store.c @@ -26,6 +26,7 @@ #include "sheep_priv.h" #include

[Sheepdog] [PATCH v6 03/17] sheep: transfer store backend for newly joined node

2012-01-12 Thread Liu Yuan
From: Liu Yuan When the new node joins the cluster, it doesn't know what kind of backend store the cluster uses, so we need to transfer this information by master node in the join phase. Signed-off-by: Liu Yuan --- include/sheep.h |2 +- sheep/group.c | 12 +++- 2 files changed

[Sheepdog] [PATCH v6 04/17] sheep: modify the configures to run farm.

2012-01-12 Thread Liu Yuan
From: Liu Yuan Drive farm to work! add two new lib dependency: - libssl Dongsu Park suggests that we should check crypto lib for SHA1_Init with newer libssl. Currently libssl-1.0 and libssl-0.9.8 works with current configuration. For debian based systems, you can install them by the name lib

[Sheepdog] [PATCH v6 02/17] store: add dynamic mechanism to chain the available backend stores.

2012-01-12 Thread Liu Yuan
From: Liu Yuan - change global store structure to a pointer - use a list to maintain the stores. - use /obj/.store to remember backend store persistently. - now we can specify the backend store in the command collie cluster format -b farm #use farm if no store specified, currently

[Sheepdog] [PATCH v6 01/17] sheep: hide some minor store layout aware operations

2012-01-12 Thread Liu Yuan
From: Liu Yuan We need this to decouple the sheep from kv-store. Signed-off-by: Liu Yuan --- sheep/store.c | 57 ++--- 1 files changed, 38 insertions(+), 19 deletions(-) diff --git a/sheep/store.c b/sheep/store.c index 56e3cd2..3323fbc 100

[Sheepdog] [PATCH v6 0/17] add a new store named 'farm'

2012-01-12 Thread Liu Yuan
Hi Kazum, I think the core of the patch set is stable, farm is ready to be merged. changes v6: - address Kazum's comments. Thanks! - remove compressed feature for sha1_file. - use global config to remember backend store. - sending name of store instread of index

Re: [Sheepdog] [PATCH v5 15/17] collie: enable cluster-wide snapshot command

2012-01-12 Thread Liu Yuan
On 01/12/2012 06:41 PM, Liu Yuan wrote: > Um, I get you wrong. On my box I couldn't reproduce it. Maybe you can > try my v6 patch set. > > I used following script: > > for i in 0 1 2; do sheep/sheep -d /home/tailai.ly/sheepdog/store/$i -z > $i -p 700$i;sleep 1;done > collie/collie cluster format

Re: [Sheepdog] [PATCH v5 15/17] collie: enable cluster-wide snapshot command

2012-01-12 Thread Liu Yuan
On 01/05/2012 05:30 AM, MORITA Kazutaka wrote: > I confirmed some bugs. > > - If I took a cluster-wide snapshot just after cluster format, I >couldn't restore it. > > $ collie cluster format -b farm > $ collie cluster snapshot > $ qemu-img create sheepdog:test 128G > Form

Re: [Sheepdog] [PATCH v5 01/17] sheep: hide some minor store layout aware operations

2012-01-12 Thread Liu Yuan
On 01/05/2012 04:08 AM, MORITA Kazutaka wrote: >> int update_epoch_store(uint32_t epoch) >> > { >> > - char new[1024]; >> > - >> > - snprintf(new, sizeof(new), "%s%08u/", obj_path, epoch); >> > - mkdir(new, def_dmode); >> > + if (!strcmp(store.name, "simple")) { >> > + char new[1024