[SCM] Samba Shared Repository - branch v4-9-stable updated

Karolin Seeger kseeger at samba.org
Wed Nov 27 10:47:28 UTC 2019


The branch, v4-9-stable has been updated
       via  f2c73b4e6bc VERSION: Disable GIT_SNAPSHOT for th 4.9.16 release.
       via  a1b939d6282 WHATSNEW: Add release notes for Samba 4.9.16.
       via  2927573cfef Merge tag 'samba-4.9.15' into v4-9-test
       via  92b73cf0bf0 ctdb-tcp: Close inflight connecting TCP sockets after fork
       via  0dcb2efb8f8 ctdb-tcp: Drop tracking of file descriptor for incoming connections
       via  14406d123ab ctdb-tcp: Avoid orphaning the TCP incoming queue
       via  20b823fc255 ctdb-tcp: Check incoming queue to see if incoming connection is up
       via  2d1f566ef95 VERSION: Bump version up to 4.9.16.
       via  5942df08644 VERSION: Bump version up to 4.9.15...
      from  0d69a39c463 VERSION: Disable GIT_SNAPSHOT for the 4.9.15 release.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-9-stable


- Log -----------------------------------------------------------------
commit f2c73b4e6bcfba4ea58cea999e6c83bd61d86bb3
Author: Karolin Seeger <kseeger at samba.org>
Date:   Tue Nov 26 13:15:43 2019 +0100

    VERSION: Disable GIT_SNAPSHOT for th 4.9.16 release.
    
    Signed-off-by: Karolin Seeger <kseeger at samba.org>

commit a1b939d628248125cd12ad4e5653f4e2967d5669
Author: Karolin Seeger <kseeger at samba.org>
Date:   Tue Nov 26 13:13:17 2019 +0100

    WHATSNEW: Add release notes for Samba 4.9.16.
    
    Signed-off-by: Karolin Seeger <kseeger at samba.org>

commit 2927573cfef0d0856fa82f28f4e655b280372bff
Merge: 92b73cf0bf0 0d69a39c463
Author: Karolin Seeger <kseeger at samba.org>
Date:   Tue Nov 26 13:03:54 2019 +0100

    Merge tag 'samba-4.9.15' into v4-9-test
    
    samba: tag release samba-4.9.15
    Signed-off-by: Karolin Seeger <kseeger at samba.org>

commit 92b73cf0bf028321b99eba942b76d494c6a96e2b
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Nov 7 15:26:01 2019 +0100

    ctdb-tcp: Close inflight connecting TCP sockets after fork
    
    Commit c68b6f96f26 changed the talloc hierarchy such that outgoing TCP sockets
    while sitting in the async connect() syscall are not freed via
    ctdb_tcp_shutdown() anymore, they are hanging off a longer-running structure.
    Free this structure as well.
    
    If an outgoing TCP socket leaks into a long-running child process (possibly the
    recovery daemon), this connection will never be closed as seen by the
    destination node. Because with recent changes incoming connections will not be
    accepted as long as any incoming connection is alive, with that socket leak
    into the recovery daemon we will never again be able to successfully connect to
    the node that is affected by this leak. Further attempts to connect will be
    discarded by the destination as long as the recovery daemon keeps this socket
    alive.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14175
    RN: Avoid communication breakdown on node reconnect
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit a6d99d9e5c5bc58e6d56be7a6c1dbc7c8d1a882f)
    
    Autobuild-User(v4-9-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-9-test): Wed Nov 20 14:58:33 UTC 2019 on sn-devel-144

commit 0dcb2efb8f828606d22742100491fb7b8f61a340
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Oct 29 17:28:22 2019 +1100

    ctdb-tcp: Drop tracking of file descriptor for incoming connections
    
    This file descriptor is owned by the incoming queue.  It will be
    closed when the queue is torn down.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14175
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit bf47bc18bb8a94231870ef821c0352b7a15c2e28)

commit 14406d123ab4587715ca97114e933f3ae1e31c17
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Oct 29 15:29:11 2019 +1100

    ctdb-tcp: Avoid orphaning the TCP incoming queue
    
    CTDB's incoming queue handling does not check whether an existing
    queue exists, so can overwrite the pointer to the queue.  This used to
    be harmless until commit c68b6f96f26664459187ab2fbd56767fb31767e0
    changed the read callback to use a parent structure as the callback
    data.  Instead of cleaning up an orphaned queue on disconnect, as
    before, this will now free the new queue.
    
    At first glance it doesn't seem possible that 2 incoming connections
    from the same node could be processed before the intervening
    disconnect.  However, the incoming connections and disconnect occur on
    different file descriptors.  The queue can become orphaned on node A
    when the following sequence occurs:
    
    1. Node A comes up
    2. Node A accepts an incoming connection from node B
    3. Node B processes a timeout before noticing that outgoing the queue is writable
    4. Node B tears down the outgoing connection to node A
    5. Node B initiates a new connection to node A
    6. Node A accepts an incoming connection from node B
    
    Node A processes then the disconnect of the old incoming connection
    from (2) but tears down the new incoming connection from (6).  This
    then occurs until the originally affected node is restarted.
    
    However, due to the number of outgoing connection attempts and
    associated teardowns, this induces the same behaviour on the
    corresponding incoming queue on all nodes that node A attempts to
    connect to.  Therefore, other nodes become affected and need to be
    restarted too.
    
    As a result, the whole cluster probably needs to be restarted to
    recover from this situation.
    
    The problem can occur any time CTDB is started on a node.
    
    The fix is to avoid accepting new incoming connections when a queue
    for incoming connections is already present.  The connecting node will
    simply retry establishing its outgoing connection.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14175
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit d0baad257e511280ff3e5c7372c38c43df841070)

commit 20b823fc255e640a6bbf4debcc69c738b53c5229
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Oct 29 15:25:26 2019 +1100

    ctdb-tcp: Check incoming queue to see if incoming connection is up
    
    This makes it consistent with the reverse case.  Also, in_fd will soon
    be removed.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14175
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit e62b3a05a874db13a848573d2e2fb1c157393b9c)

commit 2d1f566ef95b678987b180c71512fc1793706425
Author: Karolin Seeger <kseeger at samba.org>
Date:   Tue Oct 29 11:14:13 2019 +0100

    VERSION: Bump version up to 4.9.16.
    
    Signed-off-by: Karolin Seeger <kseeger at samba.org>

commit 5942df0864495dbaea68d2f45b5a6d343f0556ba
Author: Karolin Seeger <kseeger at samba.org>
Date:   Tue Oct 22 10:54:09 2019 +0200

    VERSION: Bump version up to 4.9.15...
    
    and re-enable GIT_SNAPSHOT.
    
    Signed-off-by: Karolin Seeger <kseeger at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 VERSION                |  2 +-
 WHATSNEW.txt           | 49 +++++++++++++++++++++++++++++++++++++++++++++++--
 ctdb/tcp/ctdb_tcp.h    |  1 -
 ctdb/tcp/tcp_connect.c | 11 ++++++++---
 ctdb/tcp/tcp_init.c    | 12 ++++++------
 ctdb/tcp/tcp_io.c      |  2 --
 6 files changed, 62 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index 0a215dada54..c705308b199 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
 ########################################################
 SAMBA_VERSION_MAJOR=4
 SAMBA_VERSION_MINOR=9
-SAMBA_VERSION_RELEASE=15
+SAMBA_VERSION_RELEASE=16
 
 ########################################################
 # If a official release has a serious bug              #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 377a1aa7c1e..0203038f0c5 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,3 +1,48 @@
+                   ==============================
+                   Release Notes for Samba 4.9.16
+                          November 27, 2019
+                   ==============================
+
+
+This is an additional bug fix release to address bug #14175 (CTDB: Incoming
+queue can be orphaned causing communication breakdown). Please see
+https://bugzilla.samba.org/show_bug.cgi?id=14175 for details.
+
+
+Changes since 4.9.15:
+---------------------
+
+o  Volker Lendecke <vl at samba.org>
+   * BUG 14175: ctdb: Avoid communication breakdown on node reconnect.
+
+o  Martin Schwenke <martin at meltin.net>
+   * BUG 14175: ctdb: Incoming queue can be orphaned causing communication
+     breakdown.
+
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical IRC channel on irc.freenode.net.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored.  All bug reports should
+be filed under the "Samba 4.1 and newer" product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Release notes for older releases follow:
+----------------------------------------
+
                    ==============================
                    Release Notes for Samba 4.9.15
                           October 29, 2019
@@ -69,8 +114,8 @@ database (https://bugzilla.samba.org/).
 ======================================================================
 
 
-Release notes for older releases follow:
-----------------------------------------
+----------------------------------------------------------------------
+
 
                    ==============================
                    Release Notes for Samba 4.9.14
diff --git a/ctdb/tcp/ctdb_tcp.h b/ctdb/tcp/ctdb_tcp.h
index 9a615fc6393..daabad74297 100644
--- a/ctdb/tcp/ctdb_tcp.h
+++ b/ctdb/tcp/ctdb_tcp.h
@@ -37,7 +37,6 @@ struct ctdb_tcp_node {
 	struct tevent_timer *connect_te;
 
 	struct ctdb_context *ctdb;
-	int in_fd;
 	struct ctdb_queue *in_queue;
 };
 
diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c
index f02340c1789..0b5d021480a 100644
--- a/ctdb/tcp/tcp_connect.c
+++ b/ctdb/tcp/tcp_connect.c
@@ -153,7 +153,7 @@ static void ctdb_node_connect_write(struct tevent_context *ev,
 	 * as connected, but only if the corresponding listening
 	 * socket is also connected
 	 */
-	if (tnode->in_fd != -1) {
+	if (tnode->in_queue != NULL) {
 		node->ctdb->upcalls->node_connected(node);
 	}
 }
@@ -312,6 +312,13 @@ static void ctdb_listen_event(struct tevent_context *ev, struct tevent_fd *fde,
 		return;
 	}
 
+	if (tnode->in_queue != NULL) {
+		DBG_ERR("Incoming queue active, rejecting connection from %s\n",
+			ctdb_addr_to_str(&addr));
+		close(fd);
+		return;
+	}
+
 	ret = set_blocking(fd, false);
 	if (ret != 0) {
 		DBG_ERR("Failed to set socket non-blocking (%s)\n",
@@ -348,8 +355,6 @@ static void ctdb_listen_event(struct tevent_context *ev, struct tevent_fd *fde,
 		return;
 	}
 
-	tnode->in_fd = fd;
-
        /*
 	* Mark the connecting node as connected, but only if the
 	* corresponding outbound connected is also up
diff --git a/ctdb/tcp/tcp_init.c b/ctdb/tcp/tcp_init.c
index 91d4e992c8f..dc92abd4e6c 100644
--- a/ctdb/tcp/tcp_init.c
+++ b/ctdb/tcp/tcp_init.c
@@ -43,11 +43,6 @@ static int tnode_destructor(struct ctdb_tcp_node *tnode)
 		tnode->out_fd = -1;
 	}
 
-	if (tnode->in_fd != -1) {
-		close(tnode->in_fd);
-		tnode->in_fd = -1;
-	}
-
 	return 0;
 }
 
@@ -61,7 +56,6 @@ static int ctdb_tcp_add_node(struct ctdb_node *node)
 	CTDB_NO_MEMORY(node->ctdb, tnode);
 
 	tnode->out_fd = -1;
-	tnode->in_fd = -1;
 	tnode->ctdb = node->ctdb;
 
 	node->private_data = tnode;
@@ -143,8 +137,14 @@ static void ctdb_tcp_shutdown(struct ctdb_context *ctdb)
 {
 	struct ctdb_tcp *ctcp = talloc_get_type(ctdb->private_data,
 						struct ctdb_tcp);
+	uint32_t i;
+
 	talloc_free(ctcp);
 	ctdb->private_data = NULL;
+
+	for (i=0; i<ctdb->num_nodes; i++) {
+		TALLOC_FREE(ctdb->nodes[i]->private_data);
+	}
 }
 
 /*
diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c
index e8ebff887e1..2d8ec0f7062 100644
--- a/ctdb/tcp/tcp_io.c
+++ b/ctdb/tcp/tcp_io.c
@@ -76,8 +76,6 @@ void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args)
 
 failed:
 	TALLOC_FREE(tnode->in_queue);
-	close(tnode->in_fd);
-	tnode->in_fd = -1;
 	node->ctdb->upcalls->node_dead(node);
 
 	TALLOC_FREE(data);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list