From: MORITA Kazutaka <morita.kazut...@lab.ntt.co.jp>

We must not call sd_leave_handler() when the gateway node leaves cluster.  It is
because we already processed the event when the node became gateway.

The local driver can pass tests/048 with this patch.

Signed-off-by: MORITA Kazutaka <morita.kazut...@lab.ntt.co.jp>
---
 sheep/cluster/local.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sheep/cluster/local.c b/sheep/cluster/local.c
index 142221f..ae7941b 100644
--- a/sheep/cluster/local.c
+++ b/sheep/cluster/local.c
@@ -473,6 +473,12 @@ static bool local_process_event(void)
                                ev->join_result, ev->buf);
                break;
        case EVENT_LEAVE:
+               if (ev->sender.gateway) {
+                       sd_dprintf("gateway %s left sheepdog",
+                                  lnode_to_str(&ev->sender));
+                       break;
+               }
+               /* fall through */
        case EVENT_GATEWAY:
                sd_leave_handler(&ev->sender.node, nodes, nr_nodes);
                break;
-- 
1.7.9.5

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

Reply via email to