ctdb-tcp: move free of inbound queue to TCP restart
authorNoel Power <noel.power@suse.com>
Sat, 29 Feb 2020 15:49:28 +0000 (15:49 +0000)
committerMartin Schwenke <martins@samba.org>
Thu, 12 Mar 2020 03:47:30 +0000 (03:47 +0000)
Since commit 77deaadca8e8dbc3c92ea16893099c72f6dc874e, a nodeA which
had previously accepted a connection from nodeB (where nodeB dies
e.g. as as result of fencing) when nodeB attempts to connect again
after restarting is always rejected with

 ctdb_listen_event: Incoming queue active, rejecting connection from w.x.y.z

messages.

Consolidate dead node handling in the TCP restart handling.

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/tcp/tcp_init.c
ctdb/tcp/tcp_io.c

index 559ad8691d03ecbb0c5cedd749e56468eee8a01f..dbf6c4b9bcfaefccaa20d3876ded582f16e6ef75 100644 (file)
@@ -121,7 +121,7 @@ static void ctdb_tcp_restart(struct ctdb_node *node)
                node->transport_data, struct ctdb_tcp_node);
 
        DEBUG(DEBUG_NOTICE,("Tearing down connection to dead node :%d\n", node->pnn));
-
+       TALLOC_FREE(tnode->in_queue);
        ctdb_tcp_stop_connection(node);
 
        tnode->connect_te = tevent_add_timer(node->ctdb->ev, tnode,
index df9ca02b413fe9da4f94d43640b3cec83ce8190e..bcb18fbf300affdd92cc41067be7e4b4b88ad08a 100644 (file)
@@ -75,7 +75,6 @@ void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args)
        return;
 
 failed:
-       TALLOC_FREE(tnode->in_queue);
        node->ctdb->upcalls->node_dead(node);
 
        TALLOC_FREE(data);