summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_server.c
Commit message (Collapse)AuthorAgeFilesLines
* ctdbd: When a node is connected, log at DEBUG NOTICE not DEBUG_INFOMartin Schwenke2013-10-291-2/+3
| | | | | | | | | This is important enough that we should see it when the log level is DEBUG_NOTICE. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit eb8ec5681bfccb26c8ffae72952d54bb0ba46249)
* ctdbd: Simplify database directory setting logicMartin Schwenke2013-10-251-36/+0
| | | | | | | | | | | | | | No need to check if the options are set. The options are always set via static defaults. No need to talloc_strdup() the values via wrapper functions. The options aren't going away. Remove now unused ctdb_set_tdb_dir() and similar functions. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 1fe82f3d7b610547ff4945887f15dd6c5798a49b)
* ctdbd: Add nodes_file member to struct ctdb_contextMartin Schwenke2013-10-221-1/+11
| | | | | | | | | | | | | | | | | This allows ctdb_load_nodes_file() to move to ctdb_server.c and ctdb_set_nlist() to become static. Setting ctdb->nodes_file needs to be done early, before the nodes file is loaded. It is now set from CTDB_BASE instead ETCDIR, so setting CTDB_BASE also needs to be done earlier. Unhack ctdbd_test.c - it no longer needs to define ctdb_load_nodes_file(). Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 20e705e63bd3b20837cc3ac92fdcf2a9650ccfc8)
* build: Fix tdb.h path to enable building with system TDB libraryMathieu Parent2013-06-141-1/+1
| | | | (This used to be ctdb commit f8bf99de3a5f56be67aaa67ed836458b1cf73e86)
* ctdbd: Initialise the node flags in just one placeMartin Schwenke2013-01-071-12/+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)
* Remove explicit include of lib/tevent/tevent.h.Amitay Isaacs2012-04-131-1/+0
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 0681014ca5ed2a9b56f63fdace7f894beccf8a9a)
* Create macros to update the statistics counters and use these macrosRonnie Sahlberg2010-09-291-10/+10
| | | | | | everywhere instead of manipulating the coutenrs directly. (This used to be ctdb commit 2e648df890e5713bc575965d87937827b068d0d7)
* event: Update events to latest Samba version 0.9.8Rusty Russell2010-08-181-1/+1
| | | | | | | | | | | | | 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)
* server: add db_directory_state to ctdb_contextStefan Metzmacher2009-12-161-0/+12
| | | | | | metze (This used to be ctdb commit 656a6ec5ed81ccfbb86144156a3158e48f105ee4)
* Tiny simplification of ctdb_queue_packet()Volker Lendecke2009-12-121-9/+11
| | | | (This used to be ctdb commit 1640da1cab7e8b545367824204c82931f3346848)
* Run only one event for each epoll_wait/select callVolker Lendecke2009-12-101-1/+1
| | | | | | | | This might be a bit less efficient, but experience in winbind has shown that event callbacks can trigger changes in the socket state in very hard to diagnose ways. (This used to be ctdb commit a78b8ea7168e5fdb2d62379ad3112008b2748576)
* make it possible to start the daemon in STOPPED modeRonnie Sahlberg2009-07-091-0/+5
| | | | (This used to be ctdb commit 866aa995dc029db6e510060e9e95a8ca149094ac)
* Allow setting the recovery lock file as "", which means that we do not use a ↵Ronnie Sahlberg2009-06-251-0/+11
| | | | | | | | file and that we implicitely also disable the recovery lock checking. Update the init script to allow starting without a reclock file. (This used to be ctdb commit 07855ff5eba71e7d607d52e234a42553d9b93605)
* dont try to queue packets for sending to (recently) deleted nodes since ↵Ronnie Sahlberg2009-06-011-1/+6
| | | | | | these nodes do not have a queue. (This used to be ctdb commit 1b7c88ae7643f9bcc52b1d33095f97de88fc2316)
* when building the initial vnnmap, make sure to skip any deleted nodesRonnie Sahlberg2009-06-011-8/+12
| | | | (This used to be ctdb commit 0cd66c744cd9533ce8d4c4374bcee3bf49b66dae)
* use num_nodes and the nodes array instead of walking the vnnmapRonnie Sahlberg2009-06-011-3/+2
| | | | | | when counting the number of active nodes (This used to be ctdb commit df20cd9b05ad9ca72e32ccc42354eafc12b68c04)
* add a new node state : DELETED.Ronnie Sahlberg2009-06-011-4/+61
| | | | | | | | | | | | | | | | | | | | 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)
* Whitespace changes and using the CTDB_NO_MEMORY() macro changes toRonnie Sahlberg2009-05-211-2/+4
| | | | | | the previous patch. (This used to be ctdb commit d623ea7c04daa6349b42d50862843c9f86115488)
* add missing checks on so far ignored return valuesSumit Bose2009-05-211-0/+2
| | | | | | Most of these were found during a review by Jim Meyering <meyering@redhat.com> (This used to be ctdb commit 3aee5ee1deb4a19be3bd3a4ce3abbe09de763344)
* structure member node_list_file is not used anywhereSumit Bose2009-05-211-3/+0
| | | | (This used to be ctdb commit 0e84ea23d1d998d4d4ac7d8a858b3d8294f056cb)
* dont call ctdb_fatal() just because we are asked to restart a connectionRonnie Sahlberg2008-12-171-2/+2
| | | | | | | | | | | | | | to a remote node and ctdb->methods is NULL. This can happen when we are in the middle of a normal shutdown of the daemon and we have already shut down the transport layer (thus setting ctdb->methods == NULL in the transport layer destructor) band there is some unprocessed data related to a remote node. This prevents an ugly race condition where ctdb might sometimes (rare) cause a core dump during "ctdb shutdown". (This used to be ctdb commit fc4e8b5a5d3699221620a8d76701c8589f2b4ff1)
* from Michael Adams : allow #-style comments in the nodes and publicRonnie Sahlberg2008-10-071-1/+14
| | | | | | addresses file (This used to be ctdb commit 5f96b33a379c80ed8a39de1ee41f254cf48733f9)
* we need a 'case x:' in our ugly 'encode the control opcode as a linenumber ↵Ronnie Sahlberg2008-07-071-1/+1
| | | | | | in valgrind output' hack to make it work (This used to be ctdb commit f4929e164be1703f74fc332e740b85cfe1ae3e73)
* an extraordinarily ugly patch!Andrew Tridgell2008-07-041-0/+115
| | | | | | | This is a hack to allow backtraces under valgrind to show what opcode is getting uninitialised bytes (This used to be ctdb commit 67bb12c8f0af5914efb44b76bc6ddbb11fc0fcdf)
* ctdb->methods becomes NULL when we shutdown the transport.Ronnie Sahlberg2008-05-111-0/+10
| | | | | | | | | | | | | | If we shutdown the transport and CTDB later decides to send a command out for queueing, the call to ctdb->methods->allocate_pkt() will SEGV. This could trigger for example when we are in the process of shuttind down CTDBD and have already shutdown the transport but we are still waiting for the "shutdown" eventscripts to finish. If the event scripts now take much much longer to execute for some reason, this race condition becomes much more probable. Decorate all dereferencing of ctdb->methods-> with a check that ctdb->menthods is non-NULL (This used to be ctdb commit c4c2c53918da6fb566d6e9cbd6b02e61ae2921e7)
* 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-0/+6
| | | | | | | | | | | | | | 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-191-0/+4
| | | | | | | | | | | | | | 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)
* merge from ronnieAndrew Tridgell2008-02-041-7/+7
| | | | (This used to be ctdb commit e7b57d38cf7255be823a223cf15b7526285b4f1c)
* added debug constants to allow for better mapping to syslog levelsAndrew Tridgell2008-02-041-4/+4
| | | | (This used to be ctdb commit 7ba8f1dde318eab03f4257e5a89fd23e7281e502)
* added syslog support, and use a pipe to catch logging from child processes ↵Andrew Tridgell2008-01-161-26/+0
| | | | | | to the ctdbd logging functions (This used to be ctdb commit 1306b04cd01e996fd1aa1159a9521f2ff7b06165)
* Add a --node-ip argument so that one can specify which ip address a Ronnie Sahlberg2007-11-261-0/+17
| | | | | | | | | | | | | | | | 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)
* revert 773Ronnie Sahlberg2007-11-121-11/+1
| | | | (This used to be ctdb commit 5a1c8f458ddc9b0ff532afda6007e32db10a71c8)
* add a new tunable "CheckNodesFile" that when set to 0 will disable the Ronnie Sahlberg2007-11-051-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | check in the recovery daemon that all nodes are using the same /etc/ctdb/nodes file. Also add some more missing checks that the pnn used is a valid pnn before using it to dereferencing the ctdb->nodes array This is useful since it allows us to add more physical nodes to a an existing cluster without having to bring down the entire cluster. The to add an additional node to an existing cluster would then be 1, on all nodes set CheckNodesFile=0 using 'ctdb setvar' 2, on all nodes add CTDB_SET_CheckNodesFile=0 to /etc/sysconfig/ctdb For each each node, one at a time : 3, use 'ctdb disable' to stop the hosted services 4, service ctdb stop 5, service ctdb start Once all nodes have been restarted 6, on all nodes remove CTDB_SET_CheckNodesFile=0 from /etc/sysconfig/ctdb 7, on all nodes set CheckNodesFile=0 using 'ctdb setvar' 8, configure and start up the new node During this procedure, only one node at a time was brought down/restarted and was so only for a short period. (This used to be ctdb commit 462501a32143e943ce350bd904a47c0955414a51)
* add a new transport method so that when a node is marked as dead, we Ronnie Sahlberg2007-10-191-1/+4
| | | | | | | | | | | | | | 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)
* set the flags explicitely isnstead of masking them inRonnie Sahlberg2007-10-181-1/+1
| | | | (This used to be ctdb commit 27a5f9dead44890683f9dbc4f07cda11264aa03b)
* make sure reconnected nodes start off as unhealthy so they don't get a public IPAndrew Tridgell2007-10-101-1/+2
| | | | (This used to be ctdb commit c733ec6760cae01ce277f491caf1355e46de5cf7)
* no longer wait at startup for services to become available, insteadAndrew Tridgell2007-09-241-2/+2
| | | | | | | | set the node initially unhealthy and let the status monitoring bring the node online. This fixes a problem with winbindd, where it refused to start because secrets.tdb was not populated but we could not populate ctdbd, because the net command would not run while ctdbd was still doing startup and thus frozen (This used to be ctdb commit 3a001b793dd76fb96addf1e2ccb74da326fbcfbc)
* added support for persistent databases in ctdbdAndrew Tridgell2007-09-211-0/+12
| | | | (This used to be ctdb commit 3115090a0d882beca9d70761130b74bb0821f201)
* change ctdb_validate_vnn to ctdb_validate_pnnRonnie Sahlberg2007-09-041-1/+1
| | | | (This used to be ctdb commit a4a1f41b69475b9dc16d8fd7f8965c32e96c32f0)
* 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-4/+4
| | | | | | | | | | | | | 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)
* when we receive a packet from the network, check explicitely that the Ronnie Sahlberg2007-08-221-0/+12
| | | | | | | | | | node is not banned it the call is for a database record. i.e a REQ/REPLY CALL/DMASTER if we get such a call while banned, ignore the packet and write an entry in the logfile (This used to be ctdb commit 79eb0863609fbb12e28ebf734101b1d3f359b330)
* create a define to represent the 'invalid' generation id we used in two Ronnie Sahlberg2007-08-221-8/+1
| | | | | | | | | | | | places. create a new helper function to generate new generation id values that know about the invalid id and avoids generating it. update the ctdb status tool to know about the invalid generation id and print the string INVALID instead (This used to be ctdb commit 4fbcd189543cb8a92227fdcd3d158472e558ccda)
* print the operation code in the debug message when we discard a packet Ronnie Sahlberg2007-07-111-2/+4
| | | | | | due to incorrect generation number (This used to be ctdb commit 3151e3b2607291572fc6e7380fd60ef7ce438307)
* update lib/replace from samba4Andrew Tridgell2007-07-101-3/+2
| | | | (This used to be ctdb commit f0555484105668c01c21f56322992e752e831109)
* added code to kill registered clients on a IP releaseAndrew Tridgell2007-06-191-3/+3
| | | | (This used to be ctdb commit ca0243b544987ce0618a99ac87b4abf598991e93)
* propogate flag changes to all connected nodesAndrew Tridgell2007-06-091-2/+22
| | | | (This used to be ctdb commit 711d1f7e20f1e98caaf08a57df0b1825ff6e97a0)
* more code rearrangementAndrew Tridgell2007-06-071-0/+450
(This used to be ctdb commit 2bcf3b16163041f03add2e5bf9f1f5fb3599ec24)