s3-ctdb: Fail CTDB connection only on INACTIVE state
authorAmitay Isaacs <amitay@gmail.com>
Thu, 23 Jun 2016 06:17:51 +0000 (16:17 +1000)
committerVolker Lendecke <vl@samba.org>
Thu, 23 Jun 2016 21:38:44 +0000 (23:38 +0200)
If the node has flag NODE_FLAGS_PERMANENTLY_DISABLED, then it is
still working.  Only avoid connections if node has any of the flags
in NODE_FLAGS_INACTIVE.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jun 23 23:38:44 CEST 2016 on sn-devel-144

source3/lib/ctdbd_conn.c

index 6cb6814d6c9d06bc5947310c2b1d019d6099ee02..8403b30896f0285a27b7434a15020b9d52c8315d 100644 (file)
@@ -198,7 +198,6 @@ static bool ctdbd_working(struct ctdbd_connection *conn, uint32_t vnn)
        int32_t cstatus=-1;
        TDB_DATA outdata;
        struct ctdb_node_map_old *m;
-       uint32_t failure_flags;
        bool ok = false;
        uint32_t i;
        int ret;
@@ -228,10 +227,7 @@ static bool ctdbd_working(struct ctdbd_connection *conn, uint32_t vnn)
                goto fail;
        }
 
-       failure_flags = NODE_FLAGS_BANNED | NODE_FLAGS_DISCONNECTED
-               | NODE_FLAGS_PERMANENTLY_DISABLED | NODE_FLAGS_STOPPED;
-
-       if ((m->nodes[i].flags & failure_flags) != 0) {
+       if ((m->nodes[i].flags & NODE_FLAGS_INACTIVE) != 0) {
                DEBUG(2, ("Node has status %x, not active\n",
                          (int)m->nodes[i].flags));
                goto fail;