Print deleted nodes as well
authorSumit Bose <sbose@redhat.com>
Mon, 19 Nov 2012 17:45:37 +0000 (18:45 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 19 Aug 2013 09:58:42 +0000 (11:58 +0200)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 0930a3b806977555509c3228726e2250aef1f971)

Conflicts:

tools/ctdb.c

tools/ctdb.c

index 904ec31a1ae9a78889fcf802a2968e4cc6f87da4..28fa676c42f104457633eb338eb23d940257c3c0 100644 (file)
@@ -499,6 +499,7 @@ static int control_status(struct ctdb_context *ctdb, int argc, const char **argv
        struct ctdb_node_map *nodemap=NULL;
        uint32_t recmode, recmaster;
        int mypnn;
+       int num_deleted_nodes = 0;
 
        mypnn = ctdb_ctrl_getpnn(ctdb, TIMELIMIT(), options.pnn);
        if (mypnn == -1) {
@@ -550,7 +551,17 @@ static int control_status(struct ctdb_context *ctdb, int argc, const char **argv
                return 0;
        }
 
-       printf("Number of nodes:%d\n", nodemap->num);
+       for (i=0; i<nodemap->num; i++) {
+               if (nodemap->nodes[i].flags & NODE_FLAGS_DELETED) {
+                       num_deleted_nodes++;
+               }
+       }
+       if (num_deleted_nodes == 0) {
+               printf("Number of nodes:%d\n", nodemap->num);
+       } else {
+               printf("Number of nodes:%d (including %d deleted nodes)\n",
+                      nodemap->num, num_deleted_nodes);
+       }
        for(i=0;i<nodemap->num;i++){
                static const struct {
                        uint32_t flag;