ctdb-tools: Stop deleted nodes from influencing ctdb nodestatus exit code
authorMartin Schwenke <martin@meltin.net>
Tue, 13 Aug 2019 11:42:15 +0000 (21:42 +1000)
committerKarolin Seeger <kseeger@samba.org>
Fri, 20 Sep 2019 14:09:11 +0000 (14:09 +0000)
Deleted nodes should simply be ignored.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14129
RN: Stop deleted nodes from influencing ctdb nodestatus exit code

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 32b5ceb31936ec5447362236c1809db003561d29)

Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-9-test): Fri Sep 20 14:09:11 UTC 2019 on sn-devel-144

ctdb/tools/ctdb.c

index 71a14d67cb04d1f5688f5ef079ddf34f2629edd5..2fc57e68d832da3176b815b3cc9522ee673263ae 100644 (file)
@@ -5557,7 +5557,13 @@ static int control_nodestatus(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
 
        ret = 0;
        for (i=0; i<nodemap->num; i++) {
-               ret |= nodemap->node[i].flags;
+               uint32_t flags = nodemap->node[i].flags;
+
+               if ((flags & NODE_FLAGS_DELETED) != 0) {
+                       continue;
+               }
+
+               ret |= flags;
        }
 
        return ret;