1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00
samba-mirror/ctdb
Martin Schwenke d0baad257e 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 c68b6f96f2
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@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-11-06 01:22:30 +00:00
..
client ctdb/client/client.h: typo fixes 2019-10-31 00:43:38 +00:00
cluster ctdb-cluster: CID 1435726: NULL pointer dereference 2019-06-05 10:25:50 +00:00
common ctdb/common/srvid.h: typo fixes 2019-10-31 00:43:38 +00:00
config ctdb-scripts: Drop bit-rotted shellcheck directive 2019-09-17 04:35:27 +00:00
database ctdb-database: Fix signed/unsigned comparison by casting 2019-07-05 05:03:24 +00:00
doc ctdb/doc/readonlyrecords.txt: typo fixes 2019-10-31 00:43:38 +00:00
event ctdb-event: Fix signed/unsigned comparisons by casting 2019-07-05 05:03:24 +00:00
failover ctdb-failover: Add failover configuration options 2018-08-24 10:59:21 +02:00
ib ctdb/ib/ibwrapper_test.c: typo fixes 2019-10-31 00:43:38 +00:00
include ctdb/include/ctdb_private.h: typo fixes 2019-10-31 00:43:38 +00:00
packaging/RPM ctdb-packaging: Test package requires tcpdump 2019-03-15 05:17:14 +00:00
protocol ctdb-protocol: Add marshalling for control DB_VACUUM 2019-10-24 04:06:43 +00:00
server ctdb/server/ctdb_daemon.c: typo fixes 2019-10-31 00:43:39 +00:00
tcp ctdb-tcp: Avoid orphaning the TCP incoming queue 2019-11-06 01:22:30 +00:00
tests ctdb-tests: Add vacuuming tests 2019-10-24 05:28:21 +00:00
tools ctdb-scripts: Silence shellcheck warning SC2166 2019-09-17 04:35:27 +00:00
utils ctdb/utils/smnotify/smnotify.c: typo fixes 2019-10-31 00:43:39 +00:00
.bzrignore
.gitignore ctdb-build: use a fixed ctdb_version.h using SAMBA_VERSION_STRING 2019-03-15 05:17:14 +00:00
configure build: Move python detection back into waf (instead of in configure and Makefile) 2018-12-14 14:40:19 +01:00
configure.rpm ctdb-packaging: Update library versions to upstream versions 2018-12-18 07:12:09 +01:00
COPYING
Makefile build: Move python detection back into waf (instead of in configure and Makefile) 2018-12-14 14:40:19 +01:00
README doc: README - add information about CTDB, license and website 2012-10-22 17:39:49 +11:00
wscript ctdb-tests: Add ctdb-db-test tool 2019-10-24 04:06:44 +00:00

This is the release version of CTDB, a clustered implementation of TDB
database used by Samba and other projects to store temporary data.

This software is freely distributable under the GNU public license,
a copy of which you should have received with this software (in a file
called COPYING).

For documentation on CTDB, please visit CTDB website http://ctdb.samba.org.