summaryrefslogtreecommitdiffstats
path: root/ctdb/tcp
Commit message (Collapse)AuthorAgeFilesLines
* 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)
* the ctdb structure must make its own copy of the ->address field and not justRonnie Sahlberg2008-02-191-2/+3
| | | | | | | | | | copy the content of the nodes structure. this ctdb_address structure contains a pointer which is talloced hanging off the structure itself. If we copy the content of this structure as we did in assigning to ctdb->address from nodes[i] then if we talloc_free() the node structure we end up with a wild pointer in ctdb->address (This used to be ctdb commit 644a7248548260d37df432979b129797750907f4)
* merge from ronnieAndrew Tridgell2008-02-043-11/+11
| | | | (This used to be ctdb commit e7b57d38cf7255be823a223cf15b7526285b4f1c)
* added debug constants to allow for better mapping to syslog levelsAndrew Tridgell2008-02-041-1/+1
| | | | (This used to be ctdb commit 7ba8f1dde318eab03f4257e5a89fd23e7281e502)
* Add a --node-ip argument so that one can specify which ip address a Ronnie Sahlberg2007-11-261-10/+16
| | | | | | | | | | | | | | | | specific instance of ctdbd should bind to. This helps when running a "virtual" cluster on a single machine where all instcances bind to different alias interfaces. If --node-ip is specified, then we will only try to bind to this ip address only. Othervise we fall back to the original method trying the ip addresses in /etc/ctdb/nodes one by one until we find one we can bind to. No variable in /etc/sysconfig/ctdb added since this parameter only makes sense in a virtual test/debug cluster. (This used to be ctdb commit d96cb02c2c24f9eabbc53d3d38e90dea49cff3e0)
* fixed a double close of a socket, leading to an EPOLL errorAndrew Tridgell2007-10-223-30/+43
| | | | (This used to be ctdb commit bbe8ad842bdfedd37ef14a6be07ad939113fe9b1)
* another place where we need to mark connect_fde as freedAndrew Tridgell2007-10-221-1/+2
| | | | (This used to be ctdb commit d047fbeafebe4b150602f9a91802795659058b16)
* prevent a double freeAndrew Tridgell2007-10-221-1/+2
| | | | (This used to be ctdb commit 5a1b923abb36c6deb99ae178fdd54f12235dc309)
* merge from ronnieAndrew Tridgell2007-10-191-0/+19
|\ | | | | | | (This used to be ctdb commit d444fdc7782496abe4b27003b647ac49fb52e6be)
| * add a new transport method so that when a node is marked as dead, we Ronnie Sahlberg2007-10-191-0/+23
|/ | | | | | | | | | | | | | shut down and restart the transport othervise, if we use the tcp transport the tcp connection might try to retransmit the queued data during the time the node is unavailable. this together with the exponential backoff for tcp means that the tcp connection quickly reaches the maximum backoff rto which is often 60 or 120 seconds. this would mean that it could take up to 60/120 seconds before the tcp layer detects that the connection is dead and it has to be reestablished. (This used to be ctdb commit 0256db470879ce556b0f00070f7ebeaf37e529ab)
* change ctdb->vnn to ctdb->pnnRonnie Sahlberg2007-09-041-3/+3
| | | | (This used to be ctdb commit 8c776e5707e503ec6586aae39ac6b3ea5a2fd2bc)
* change how we do public addresses and takeover so that we can have Ronnie Sahlberg2007-09-041-1/+1
| | | | | | | | | | | | | multiple public addresses spread across multiple interfaces on each node. this is a massive patch since we have previously made the assumtion that we only have one public address per node. get rid of the public_interface argument. the public addresses file now explicitely lists which interface the address belongs to (This used to be ctdb commit 462ebbc791e906a6b874c862defea43235597ca8)
* update lib/replace from samba4Andrew Tridgell2007-07-104-12/+8
| | | | (This used to be ctdb commit f0555484105668c01c21f56322992e752e831109)
* rename tnode->queue to tnode->out_queue to indicate this queue is for Ronnie Sahlberg2007-07-024-5/+5
| | | | | | sending data out to the other node (This used to be ctdb commit 0bc949c529094570da56c9007ff96b1f5ad02c59)
* when accepting an incoming connection, verify that the source address is Ronnie Sahlberg2007-07-021-1/+15
| | | | | | from one of the configured nodes and reject the connection othervise (This used to be ctdb commit ef290a6340eb1a1c0ae60c74b38c93396e388f73)
* implement a scheme where nodes are banned if they continuously caused the ↵Andrew Tridgell2007-06-071-1/+1
| | | | | | | | cluster to start a recovery session. The node is banned from the cluster for the RecoveryBanPeriod (default of 5 minutes) (This used to be ctdb commit 4ad43dd07f526b6002477177fbf55483246c2c0c)
* clean out some more cruftAndrew Tridgell2007-06-051-4/+4
| | | | (This used to be ctdb commit ad16c5fe2748b48a6f6c79976359d56d9bed33f4)
* - make calling of recovered event script asyncAndrew Tridgell2007-06-022-16/+31
| | | | | | - shutdown sockets before calling shutdown script (This used to be ctdb commit c5e099feef94a014a77742b6cc1d0afe78ef9da9)
* ctdb is GPL not LGPLAndrew Tridgell2007-05-314-48/+48
| | | | (This used to be ctdb commit 8624378010d1c2a1438e1e701339dfba7276f960)