ctdb-daemon: ensure restart() callback is called in half-connected state
authorRalph Boehme <slow@samba.org>
Sat, 29 Feb 2020 11:26:19 +0000 (12:26 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 24 Mar 2020 07:26:17 +0000 (07:26 +0000)
If NODE_FLAGS_DISCONNECTED is set the node can be in half-connected state. With
this change we ensure to restart the transport for this case.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14295

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 6a4fa0785fc83561939fa41617d526eb96c1af89)

ctdb/server/ctdb_server.c

index ddff85b81c5537d841fcddfdc19426cfe894caa9..02a5883cdbd7477b4e07b7d6f859269e85986a4b 100644 (file)
@@ -301,6 +301,12 @@ done:
 */
 void ctdb_node_dead(struct ctdb_node *node)
 {
+       if (node->ctdb->methods == NULL) {
+               DEBUG(DEBUG_ERR,(__location__ " Can not restart transport while shutting down daemon.\n"));
+               return;
+       }
+
+       node->ctdb->methods->restart(node);
        if (node->flags & NODE_FLAGS_DISCONNECTED) {
                DEBUG(DEBUG_INFO,("%s: node %s is already marked disconnected: %u connected\n", 
                         node->ctdb->name, node->name, 
@@ -315,13 +321,6 @@ void ctdb_node_dead(struct ctdb_node *node)
        DEBUG(DEBUG_ERR,("%s: node %s is dead: %u connected\n",
                 node->ctdb->name, node->name, node->ctdb->num_connected));
        ctdb_daemon_cancel_controls(node->ctdb, node);
-
-       if (node->ctdb->methods == NULL) {
-               DEBUG(DEBUG_ERR,(__location__ " Can not restart transport while shutting down daemon.\n"));
-               return;
-       }
-
-       node->ctdb->methods->restart(node);
 }
 
 /*