[sheepdog-users] .stale directory was removed after cluster format

Jinzhi Chen nxtjinzhi at gmail.com
Tue Dec 16 07:58:30 CET 2014

in the `cluster_make_fs` function(sheep/ops.c)..

sheep first calls sd_store->format(), then calls sd_store->init().
It seems that sheep first remove the .stale dir, then create the .stale dir.
am I right?

then I do some tests about cluster format.
first format the cluster  and then check whether .stale dir is created.
during my test. sometimes .stale is created, sometimes is not.
which is very odd.

then I add sync() function between `format()` and `init()`, and it seems
it worked. every time cluster format creates .stale dir.

diff --git a/sheep/ops.c b/sheep/ops.c
index 9eb3280..204d586 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -272,6 +272,7 @@ static int cluster_make_fs(const struct sd_req *req,
struct sd_rsp *rsp,
        if (ret != SD_RES_SUCCESS)
                return ret;

+       sync();
        ret = sd_store->init();
        if (ret != SD_RES_SUCCESS)
                return ret;

what do you think

Jinzhi Chen

On Tue, Dec 16, 2014 at 10:28 AM, Saeki Masaki <saeki.masaki at po.ntts.co.jp>
> I posted a bug in launchpad:
>   https://bugs.launchpad.net/sheepdog-project/+bug/1402887
> After execute cluster format .stale directory was removed.
> I think that is a bad influence on the automatic recovery.
> Regards, Saeki.
> --
> sheepdog-users mailing lists
> sheepdog-users at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog-users/attachments/20141216/99cc5bfb/attachment-0005.html>

More information about the sheepdog-users mailing list