]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-daemon: Make node inactive in the NODE_STOP control
authorMartin Schwenke <martin@meltin.net>
Mon, 19 Aug 2019 11:48:04 +0000 (21:48 +1000)
committerKarolin Seeger <kseeger@samba.org>
Wed, 28 Aug 2019 12:04:13 +0000 (12:04 +0000)
Currently some of this is supported by a periodic check in the
recovery daemon's main_loop(), which notices the flag change, sets
recovery mode active and freezes databases.  If STOP_NODE returns
immediately then the associated recovery can complete and the node can
be continued before databases are actually frozen.

Instead, immediately do all of the things that make a node inactive.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14087
RN: Stop "ctdb stop" from completing before freezing databases

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Aug 20 08:32:27 UTC 2019 on sn-devel-184

(cherry picked from commit e9f2e205ee89f4f3d6302cc11b4d0eb2efaf0f53)

Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-9-test): Wed Aug 28 12:04:13 UTC 2019 on sn-devel-144

ctdb/server/ctdb_recover.c

index 800efa2b17d4e462e49e5f8bd27262707063613e..b9646eb480886c0fbc4276fb0c9836dca479f951 100644 (file)
@@ -1464,6 +1464,8 @@ int32_t ctdb_control_stop_node(struct ctdb_context *ctdb)
        DEBUG(DEBUG_ERR, ("Stopping node\n"));
        ctdb->nodes[ctdb->pnn]->flags |= NODE_FLAGS_STOPPED;
 
+       ctdb_node_become_inactive(ctdb);
+
        return 0;
 }