summaryrefslogtreecommitdiff
path: root/ctdb/tcp
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-tcp: Fix CID 1362724 Unchecked return value from libraryMartin Schwenke2016-08-241-1/+12
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12157 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit bacf57c0658a220c9da6d2dfdf8dd42b9a491556)
* ctdb-tcp: Set file descriptor to -1 after close.Martin Schwenke2016-08-241-0/+2
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12157 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 0e737348227252d2c0d1708be40753775a9b17ad)
* ctdb-tcp: Fix CID 1362727 Unchecked return value from libraryMartin Schwenke2016-08-241-1/+13
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12157 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit ce451c7cc670dad3066ee11c69245d841662844e)
* ctdb-daemon: Use lib/util functions instead of redefinitionsAmitay Isaacs2016-06-081-2/+3
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb:tcp: add missing spaces in debug message in ctdb_tcp_node_connect()Michael Adam2016-06-011-2/+2
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ctdb-transport: Replace ctdb_logging.h with common/logging.hAmitay Isaacs2015-11-163-3/+3
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-daemon: Separate prototypes for common client/server functionsAmitay Isaacs2015-10-303-0/+5
| | | | | | | | This groups function prototypes for common client/server functions in common/common.h and removes them from ctdb_private.h. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Remove dependency on includes.hAmitay Isaacs2015-10-303-10/+31
| | | | | | | Instead of includes.h, include the required header files explicitly. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Stop using tevent compatibility definitionsAmitay Isaacs2015-10-303-27/+31
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Separate prototypes for system specific functionsAmitay Isaacs2015-10-301-0/+1
| | | | | | | | This groups function prototypes for system specific functions in common/system.h and removes them from ctdb_private.h. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb: Fix CID 1324447 Double closeVolker Lendecke2015-09-151-0/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Tue Sep 15 16:20:07 CEST 2015 on sn-devel-104
* ctdb-server: fix a possible fd leak in ctdb_tcp_listen_automatic()Michael Adam2015-09-091-0/+2
| | | | | | | | sockets are created in a loop until an unused address is found. But the unused socket fds were not closed. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb: check for talloc_asprintf() failureDavid Disseldorp2015-04-011-0/+5
| | | | | | | | Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Apr 1 15:36:03 CEST 2015 on sn-devel-104
* ctdb: Coverity fix for CID 1291643Rajesh Joseph2015-04-011-1/+6
| | | | | | | | | | | CID 1291643: Resource leak: leaked_handle: Handle variable lock_fd going out of scope leaks the handle. Fix: on failure case release handle variable lock_fd Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* ctdb-daemon: Store node addresses as ctdb_sock_addr rather than stringsMartin Schwenke2015-03-232-78/+23
| | | | | | | | | | | | | | | | | | | | | Every time a nodemap is contructed the node IP addresses all need to be parsed. This isn't very productive use of CPU. Instead, parse each string once when the nodes file is loaded. This results in much simpler code. This code also removes the use of ctdb_address. Duplicating the port is pointless without an abstraction layer around ctdb_address. If CTDB gets an incompatible transport in the future then add an abstraction layer. Note that the infiniband code is not updated. Compilation of the infiniband code is already broken. Fixing it will be a separate, properly tested effort. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Set node PNN in one placeMartin Schwenke2015-03-231-9/+7
| | | | | | | | | | | | | This is currently set in 2 places. One of them makes the node loading code difficult to refactor. Also, when the surrounding code in either place is touched then it might get broken. This only needs to be done once at startup, not on every reload. So do it once in a very obvious way, sacrificing a few CPU cycles for some added clarity. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb: Rename CTDB_VERSION to CTDB_PROTOCOLAmitay Isaacs2014-10-281-1/+1
| | | | | | | CTDB_VERSION really is the ctdb protocol version. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-build: Use CTDB_RUNDIR instead of VARDIR/run/ctdbAmitay Isaacs2014-06-241-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tcp: Coverity fixesAmitay Isaacs2013-11-191-7/+25
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* tcp: Create socket lock in /var/run/ctdb instead of /tmpAmitay Isaacs2013-10-251-1/+1
| | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Pair-programmed-with: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b9b9f6738fba5c32e87cb9c36b358355b444fb9b)
* Fixes for various issues found by CoveritySumit Bose2013-07-111-1/+10
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 05bfdbbd0d4abdfbcf28e3930086723508b35952)
* build: Fix tdb.h path to enable building with system TDB libraryMathieu Parent2013-06-143-3/+3
| | | | (This used to be ctdb commit f8bf99de3a5f56be67aaa67ed836458b1cf73e86)
* ctdbd: Initialise the node flags in just one placeMartin Schwenke2013-01-071-11/+0
| | | | | | | | | | | | | | | | | | Currently flags are initialised in 2 places. One of them is in ctdb_tcp_listen_automatic(), which just seems wrong. This makes the code easier to follow by just doing it in ctdb_start_daemon(). This means that the flags are now initialised later than previously. However, it is still done before the transport is started and before clients can connect. In future it might make sense to do a similar thing with setting the PNN. However, the current optimisation is reasonably obvious... Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 2bbee8ac23ad5b7adf7122d8c91d5f0d54582507)
* ctdbd: Remove debug option --node-ip, use --listen insteadMartin Schwenke2013-01-071-37/+21
| | | | | | | | | This effectively reverts d96cb02c2c24f9eabbc53d3d38e90dea49cff3e0 Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 496387a585b2c5778c808cf02b8e1435abde4c3e)
* ctdbd: Log a meaningful message if the nodes file/list is emptyMartin Schwenke2012-07-261-0/+9
| | | | | | | | | Right now the message says it can't bind to any of the addresses... even when there aren't any! Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 553455b386aa7848a516a921dfc14eb87c8a3fc1)
* We dont need to serialize the "probe which address this node is" if we have ↵Ronnie Sahlberg2012-05-101-20/+27
| | | | | | given an explicit --node-ip on the commandline (This used to be ctdb commit e3dc5bd3f1ef1f0ed08f57a5b5bafcac936e9ed0)
* Remove explicit include of lib/tevent/tevent.h.Amitay Isaacs2012-04-133-3/+0
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 0681014ca5ed2a9b56f63fdace7f894beccf8a9a)
* Added some #ifndefs to stop files being included multiple times.Martin Schwenke2011-11-111-1/+5
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit fdca12c25e6fce6206135b994dedf44265e4eb09)
* event: Update events to latest Samba version 0.9.8Rusty Russell2010-08-183-6/+10
| | | | | | | | | | | | | In Samba this is now called "tevent", and while we use the backwards compatibility wrappers they don't offer EVENT_FD_AUTOCLOSE: that is now a separate tevent_fd_set_auto_close() function. This is based on Samba version 7f29f817fa939ef1bbb740584f09e76e2ecd5b06. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 85e5e760cc91eb3157d3a88996ce474491646726)
* Report client for queue errors.Rusty Russell2010-07-012-2/+2
| | | | | | | | | | We've been seeing "Invalid packet of length 0" errors, but we don't know what is sending them. Add a name for each queue, and print nread. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit e6cf0e8f14f4263fbd8b995418909199924827e9)
* Drop the debug level for logging fd creation to DEBUG_DEBUGRonnie Sahlberg2010-02-041-1/+1
| | | | (This used to be ctdb commit eae1d4f9e52e73b4d8769868fffdafa590d03784)
* tcp: don't log an error when we succefully bind to the desired addressStefan Metzmacher2009-10-261-1/+8
| | | | | | metze (This used to be ctdb commit 752a9c81de97be509de7e7feddde749cc5ee22a8)
* lower the debug levels for the "create FD messages" so we dont fill up the logs.Ronnie Sahlberg2009-10-211-1/+1
| | | | (This used to be ctdb commit 87146db2769c2ec494813685bf9cec0d2a6336c3)
* add logging everytime we create a filedescriptor in the main ctdb daemonRonnie Sahlberg2009-10-151-0/+7
| | | | | | | | | so we can spot if there are leaks. plug two leaks for filedescriptors related to when sending ARP fail and one leak when we can not parse the local address during tcp connection establish (This used to be ctdb commit ddd089810a14efe4be6e1ff3eccaa604e4913c9e)
* make it possible to start the daemon in STOPPED modeRonnie Sahlberg2009-07-091-0/+5
| | | | (This used to be ctdb commit 866aa995dc029db6e510060e9e95a8ca149094ac)
* add a new node state : DELETED.Ronnie Sahlberg2009-06-012-3/+13
| | | | | | | | | | | | | | | | | | | | This is used to mark nodes as being DELETED internally in ctdb so that nodes are not renumbered if / when they are removed from the nodes file. This is used to be able to do "ctdb reloadnodes" at runtime without causing nodes to be renumbered. To do this, instead of deleting a node from the nodes file, just comment it out like 1.0.0.1 #1.0.0.2 1.0.0.3 After removing 1.0.0.2 from the cluster, the remaining nodes retain their pnn's from prior to the deletion, namely 0 and 2 Any line in the nodes file that is commented out represents a DELETED pnn (This used to be ctdb commit 6a5e4fd7fa391206b463bb4e976502f3ac5bd343)
* we need to set the port properly in the parse_ip helperRonnie Sahlberg2009-03-242-2/+2
| | | | (This used to be ctdb commit 43fe18d86995744ba61c7a6405b70edcb265930a)
* From C Cowan, AIX needs to set sockaddr.sa_len to a consistent value forRonnie Sahlberg2009-03-161-1/+11
| | | | | | the address type used or the connect() call will fail. (This used to be ctdb commit d416c0e1e57a42f7ab52de903dbd8b5e111decfe)
* Fix treatment of link local ipv6 addresses: set the scope id.Michael Adam2009-01-191-1/+1
| | | | | | | | metze / Michael Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit 9d12de1ca6107801dada927729e755c0949d73bf)
* redo and update how we synchronize flags across the cluster.root2008-12-051-1/+0
| | | | | | this simplifies the code and should close a race condition between the local recovery daemon and a remote node when flags are changing. (This used to be ctdb commit 32d460b8469eb53145f04161a5d01166f9b5f09e)
* some platforms are very picky about the third argument passed to bind().root2008-12-051-14/+35
| | | | | | | | | | | and would complain if sa.family is AF_INET and the third argument is not exactly the size of a sockaddr_in. We used to pass a union containing both a sockaddr_in and a sockaddr_in6 which would mean that on those platforms bind() would fail since the passed structure for AF_INET would be too big. Thus we need to set and pass the appropriate size to bind. At the same time for thos eplatforms we can also set sin[6]_size to the expected size. (bind() on those platforms were isurprisingly perfectly ok with sin_len was "too big") (This used to be ctdb commit 5d3018c37179966f75183d9a98790eaaaf1d2cfc)
* redesign how reloadnodes is implemented.Ronnie Sahlberg2008-12-022-13/+40
| | | | | | | | | | | | | | modify the transport methods to allow to restart individual connections and set up destructors properly. only tear down/set-up tcp connections to nodes removed from the cluster or nodes added to the cluster. Leave tcp connections to unchanged nodes connected. make "ctdb reloadnodes" explicitely cause a recovery of the cluster once the files have been realoaded (This used to be ctdb commit d1057ed6de7de9f2a64d8fa012c52647e89b515b)
* When we reload the nodes fileRonnie Sahlberg2008-10-071-4/+2
| | | | | | | instead of shutting down/restarting the entire tcp layer just bounce all outgoing connections and reconnect (This used to be ctdb commit e701a531868149f16561011e65794a4a46ee6596)
* initial ipv6 patchRonnie Sahlberg2008-08-191-48/+83
| | | | | | Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> (This used to be ctdb commit 1f131f21386f428bbbbb29098d56c2f64596583b)
* We can not assume that just because we could complete a TCP handshakeRonnie Sahlberg2008-07-181-3/+0
| | | | | | | | | | | | | | to the remote node that 1, we are in fact talking to a CTDB daemon 2, that IF we are talking to a ctdb daemon, it is operational. So, we can not blindly mark the node as CONNECTED just because we can open a TCP connection. Instead we rely on "If we did get a KEEPALIVE from the remote node, is is connected" (This used to be ctdb commit 60e2cb175c449ae65793a3e1ffb60cf030a3a0d5)
* listen_fd is auto-closedroot2008-05-081-3/+0
| | | | | | | Closing it here just causes an epoll error, and may close a fd in use by another structure to be closed. This caused a infinite recovery loop (This used to be ctdb commit bc251ac7029c2689776a8c31b28ac1d233d52d4f)
* Use DEBUG_ERR and not DEBUG_WARNING when we get a connectionRonnie Sahlberg2008-05-061-1/+1
| | | | | | attempt from a non-ctdb host (This used to be ctdb commit 40c7a536c6b428caef7904a1de860d82a70748af)
* Add debug output to indicate why a node starts up in DISABLED stateRonnie Sahlberg2008-02-221-0/+1
| | | | (This used to be ctdb commit 8df75775966ead36e1073896fedeff674a6e0587)
* Add a new parameter to /etc/sysconfig/ctdbRonnie Sahlberg2008-02-221-1/+5
| | | | | | | | | | | | | | CTDB_START_AS_DISABLED="yes" and command line argument --start-as-disabled When set, this makes the ctdb node to always start in DISABLED mode and will thus not host any public ip addresses. The administrator must manually "ctdb enable" the node after it has started when the administrator wants the node to start hosting public ip addresses. Using this option it is possible to start ctdb on a node without causing any reallocation of ip addresses when it is starting. The node will still merge with the cluster and there will still be a recovery phase but the ip address allocations will not change in the cluster. (This used to be ctdb commit b93d29f43f5306c244c887b54a77bca8a061daf2)
* to make it easier/less disruptive to add nodes to a running clusterRonnie Sahlberg2008-02-192-1/+20
| | | | | | | | | | | | | | add a new control that causes the node to drop the current nodes list and reread it from the nodes file. During this operation, the node will also drop the tcp layer and restart it. When we drop the tcp layer, by talloc_free()ing the ctcp structure add a destructor to ctcp so that we also can clean up and remove the references in the ctdb structure to the transport layer add two new commands for the ctdb tool. one to list all nodes in the nodesfile and the second a command to trigger a node to drop the transport and reinitialize it with the nde nodes file (This used to be ctdb commit 4bc20ac73e9fa94ffd43cccb6eeb438eeff9963c)