Current master branch doesn't pass test 032. Because current sheep
tries to collect cluster info (e.g. VDI locking information) even
there are no other members. This patch fixes the problem.

Signed-off-by: Hitoshi Mitake <mitake.hito...@lab.ntt.co.jp>
---
 sheep/group.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index 06a80bd..1bb22cc 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -842,10 +842,19 @@ static void update_cluster_info(const struct cluster_info 
*cinfo,
                sockfd_cache_add_group(nroot);
 
                if (0 < cinfo->epoch && cinfo->status == SD_STATUS_OK) {
-                       collect_work = xzalloc(sizeof(*collect_work));
-                       collect_work->epoch = cinfo->epoch - 1;
-                       collect_work->members = grab_vnode_info(
+                       struct vnode_info *members = grab_vnode_info(
                                main_thread_get(current_vnode_info));
+
+                       if (members->nr_nodes == 1) {
+                               sd_debug("Currently, there are no other"
+                                        " members. I don't have to collect"
+                                        "CINFO from others");
+                               put_vnode_info(members);
+                       } else {
+                               collect_work = xzalloc(sizeof(*collect_work));
+                               collect_work->epoch = cinfo->epoch - 1;
+                               collect_work->members = members;
+                       }
                }
        } else {
                if (0 < cinfo->epoch && cinfo->status == SD_STATUS_OK)
-- 
1.8.3.2

-- 
sheepdog mailing list
sheepdog@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to