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)
committerAmitay Isaacs <amitay@samba.org>
Tue, 17 Sep 2019 04:35:26 +0000 (04:35 +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>
ctdb/tools/ctdb.c

index 4bbe884367126c66942830ddb786342b39247d48..c157838018e2d5967fd40096df4b467598d10587 100644 (file)
@@ -5611,7 +5611,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;