hi,Hitoshi
   we've tested the patch. Our test method is:

We attached a 20G sheepdog VDI to a VM holded by openstack. And we created
a 2G file which we have it's md5 in hand in the VDI.
We killed the non-gateway nodes in the middle of the process, then
restarted the cluster. The process resumed and the content of the file is
right(same md5)

Thanks,
Yang,Long

On Wed, Dec 17, 2014 at 1:09 PM, Hitoshi Mitake <
mitake.hito...@lab.ntt.co.jp> wrote:
>
> At Mon, 15 Dec 2014 23:14:55 +0900,
> Hitoshi Mitake wrote:
> >
> > When a cluster has gateway nodes only, it means the gateway nodes
> > doesn't contribute to I/O of VMs. So this patch simply let them exit
> > and avoid the below recovery issue.
> >
> > Related issue:
> > https://bugs.launchpad.net/sheepdog-project/+bug/1327037
> >
> > Cc: duron...@qq.com
> > Cc: Yang Zhang <3100100...@zju.edu.cn>
> > Cc: long <nxtxiaol...@gmail.com>
> > Signed-off-by: Hitoshi Mitake <mitake.hito...@lab.ntt.co.jp>
> > ---
> >  sheep/group.c | 17 +++++++++++++++++
> >  1 file changed, 17 insertions(+)
>
> Yang, long, when you have time, could you test this patch?
>
> Thanks,
> Hitoshi
>
> >
> > v2: remove needless logging
> >
> > diff --git a/sheep/group.c b/sheep/group.c
> > index 095b7c5..5dc3284 100644
> > --- a/sheep/group.c
> > +++ b/sheep/group.c
> > @@ -1151,6 +1151,18 @@ main_fn void sd_accept_handler(const struct
> sd_node *joined,
> >       }
> >  }
> >
> > +static bool is_gateway_only_cluster(const struct rb_root *nroot)
> > +{
> > +     struct sd_node *n;
> > +
> > +     rb_for_each_entry(n, nroot, rb) {
> > +             if (n->space)
> > +                     return false;
> > +     }
> > +
> > +     return true;
> > +}
> > +
> >  main_fn void sd_leave_handler(const struct sd_node *left,
> >                             const struct rb_root *nroot, size_t nr_nodes)
> >  {
> > @@ -1177,6 +1189,11 @@ main_fn void sd_leave_handler(const struct
> sd_node *left,
> >       old_vnode_info = main_thread_get(current_vnode_info);
> >       main_thread_set(current_vnode_info, alloc_vnode_info(nroot));
> >       if (sys->cinfo.status == SD_STATUS_OK) {
> > +             if (is_gateway_only_cluster(nroot)) {
> > +                     sd_info("only gateway nodes are remaining,
> exiting");
> > +                     exit(0);
> > +             }
> > +
> >               ret = inc_and_log_epoch();
> >               if (ret != 0)
> >                       panic("cannot log current epoch %d",
> sys->cinfo.epoch);
> > --
> > 1.9.1
> >
>
-- 
sheepdog mailing list
sheepdog@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to