summaryrefslogtreecommitdiffstats
path: root/ctdb/common
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove explicit include of lib/tevent/tevent.h.Amitay Isaacs2012-04-1310-10/+0
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 0681014ca5ed2a9b56f63fdace7f894beccf8a9a)
* LACOUNT: Add back lacount mechanism to defer migrating a fetched/read copy ↵Ronnie Sahlberg2012-03-201-0/+1
| | | | | | | | until after default of 20 consecutive requests from the same node This can improve performance slightly on certain workloads where smbds frequently read from the same record (This used to be ctdb commit 035c0d981bde8c0eee8b3f24ba8e2dc817e5b504)
* Merge branch 'master' of 10.1.1.27:/shared/ctdb/ctdb-masterRonnie Sahlberg2012-02-211-0/+1
|\ | | | | | | (This used to be ctdb commit 9b85aa1aa14091dc1de470a587f7c054b9e40078)
| * READONLY: only send a control to schedule fast-vacuuming from child context ↵Ronnie Sahlberg2012-02-211-0/+1
| | | | | | | | | | | | | | | | | | iff we have a connection open to the main daemon there are some child processes where we do not create a connection to the main daemon (switch_from_server_to_client()) because it is expensive to set up and we normally might not need to talk to the daemon at all via a domainsocket. but we might want to still call to ctdb_ltdb_store() from such chil processes. (This used to be ctdb commit 9e372a08c40087e6b5335aa298e94d88273566a5)
* | Add common/system_freebsd.cVolker Lendecke2012-02-131-0/+371
| | | | | | | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit 89067e12b868974f9909b447ab5e202d612ac44f)
* | FreeBSD does not define s6_addr32, only s6_addrVolker Lendecke2012-02-131-1/+1
|/ | | | | | Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit d657af4fb68ce3f7c462856f2934f6bf169e120b)
* Add kFreeBSD supportMathieu Parent2012-01-311-0/+364
| | | | (This used to be ctdb commit c75e4ad9b566e47dec66d25988da4cee861c2357)
* explain why we use FIONREADRonnie Sahlberg2012-01-041-0/+6
| | | | (This used to be ctdb commit d0f85478c37828eb8a24315d4326eb4eaedb9afc)
* rb_tree: fix possible access-after-free-error in trbt_traversearray32_nodeMichael Adam2011-12-231-4/+7
| | | | | | | | | When the traverse callback frees the current node, the traverse of the rbtree can fail (the next node->right fails since node is not there any more...). This is fixed by introducing variables to store the right (and left) pointers before the callback is called. (This used to be ctdb commit 8b0caaeed154d26c67a73659d3bbbdd63b21be11)
* Return the peer_pid properly to the callerRonnie Sahlberg2011-12-062-2/+2
| | | | (This used to be ctdb commit 0f15a2c65db8f8b4ac0d5ad2755b9aa3c2a8b279)
* GNU/Hurd supportMathieu Parent2011-12-061-0/+364
| | | | | | | | | | | | | | | | | | CTDB has the following limitations on GNU Hurd: - The pid of a peer is not get from the socket [1]. As a consequence, the peer process is not killed when releasing IP [2]. - Gratuitous arp are not yet supported [3] - network interfaces are always considered present [4] [1]: ctdb_get_peer_pid() in common/system_gnu.c [2]: release_kill_clients() in server/ctdb_takeover.c [3]: ctdb_sys_send_arp() in common/system_gnu.c [4]: ctdb_sys_check_iface_exists() in common/system_gnu.c (This used to be ctdb commit 00212e5c7dd229e7f8975a165d5ab8875d4917cc)
* Move platform-specific code to common/system_*Mathieu Parent2011-12-062-0/+23
| | | | | | This removes #ifdef AIX and ease the addition of new platforms. (This used to be ctdb commit 2fd1067a075fe0e4b2a36d4ea18af139d03f17bf)
* system_linux: correctly cast sockaddr_in6 to sockaddr for sendto() in ↵Michael Adam2011-11-261-1/+3
| | | | | | ctdb_sys_send_tcp() (This used to be ctdb commit 11bebd5367102fcd02b17c44ac87bf50d4c68785)
* system_linux: correctly cast sockaddr_in to sockaddr in ctdb_sys_send_tcp()Michael Adam2011-11-261-1/+3
| | | | (This used to be ctdb commit cc60df5a3edebfdf50fcd22ebfaad35736f90379)
* Move some common functions to common/ctdb_ltdb.cMartin Schwenke2011-11-111-0/+37
| | | | | | | | | | | | | Move identical copies of ctdb_null_func(), ctdb_fetch_func(), ctdb_fetch_with_header_func() from ctdb_client.c and ctdb_ltdb_server.c to somewhere common. This is in the context of wanting to run CCAN-style tests where most of the ctdbd code is just included in the test program. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 126cb0d369b2b1aed63801dc4ba0554399e8b7e4)
* Added some #ifndefs to stop files being included multiple times.Martin Schwenke2011-11-111-2/+5
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit fdca12c25e6fce6206135b994dedf44265e4eb09)
* Clean up warnings: remove unused function dump_packet()Martin Schwenke2011-11-091-15/+0
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c22e201be15e7d5b788c2f5f7916b553e0faaa2a)
* RB_TREE: Add mechanism to abort a traverseRonnie Sahlberg2011-11-082-19/+43
| | | | | | | | This patch changes the callback signature for traversal functions to allow a client to abort a traverse before it finishes. Updates to all callers and examples as well as rb-test tool. (This used to be ctdb commit 8ab0c63ad36cfbbb1e5fed46a1f4c47b1fdb581f)
* ReadOnly: Rename the function ctdb_ltdb_fetch_readonly() to ↵Ronnie Sahlberg2011-09-131-1/+1
| | | | | | ctdb_ltdb_fetch_with_header() since this is what it actually does. (This used to be ctdb commit 94a5ce4e08e7891f07dbfe4c822ca4be5ab10965)
* Merge branch 'master-readonly-records' into fooRonnie Sahlberg2011-09-121-0/+80
|\ | | | | | | | | | | | | | | | | Conflicts: Makefile.in tools/ctdb.c (This used to be ctdb commit 0fedef0ffba4178126eee9544c5e2db52f5db893)
| * ReadOnly: Add a ctdb_ltdb_fetch_readonly() helper functionRonnie Sahlberg2011-08-231-0/+34
| | | | | | | | (This used to be ctdb commit 8551420fb331dd2a897f4619278a981fcefb96e8)
| * ReadOnly: Add helper functions to manipulate a TDB_DATA as a bitmap for ↵Ronnie Sahlberg2011-08-231-0/+46
| | | | | | | | | | | | nodes that we are tracking as having a readonly delegation (This used to be ctdb commit d10084e62d37674bb8d9e31d457fd23e050545be)
* | Merge remote branch 'ddiss/master_pmda_and_client_timeouts'Ronnie Sahlberg2011-09-081-2/+3
|\ \ | | | | | | | | | (This used to be ctdb commit 7bebfc7bad8f36e54003b8e25372fdaf54836e21)
| * | client: add req timeout argument to ctdb_cmdline_clientDavid Disseldorp2011-09-061-2/+3
| |/ | | | | | | | | | | | | | | | | | | | | Following connection to the local ctdbd, ctdb_cmdline_client() currently issues a CTDB_CONTROL_GET_PNN request with a fixed 3 second timeout. The ctdb cmd line client accepts a --timelimit argument for specifying a per request timeout, pass this value through to ctdb_cmdline_client() for use as a CTDB_CONTROL_GET_PNN request timeout. (This used to be ctdb commit 0634d0305f42f17048b6830733767e8dc300e11c)
* / Check interfaces: when reading the public addresses file to create the vnn listRonnie Sahlberg2011-09-063-0/+28
|/ | | | | | check that the actual interface exist, print error and fail startup if the interface does not exist. (This used to be ctdb commit cd33bbe6454b7b0316bdfffbd06c67b29779e873)
* Remove an unused variableVolker Lendecke2011-08-221-2/+0
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit 04c3d9c7c9ffa8bb95b0bf1513fd79f6c1096a2f)
* io: Make queue_io_read() safe for reentryDavid Disseldorp2011-08-051-74/+63
| | | | | | | | | | | | | | | | | | queue_io_read() may be reentered via the queue callback, recoverd is particularly guilty of this. queue_io_read() is not safe for reentry if more than one packet is received and partial chunks follow - data read off the pipe on re-entry is assumed to be the start-of-packet four byte length. This leads to a wrongly aligned stream and the notorious "Invalid packet of length 0" errors. This change fixes queue_io_read() to be safe under reentry, only a single packet is processed per call. https://bugzilla.samba.org/show_bug.cgi?id=8319 (This used to be ctdb commit 9ea41d2fab612772f861270c8a59c01c43bd3a4c)
* ltdb: add the CTDB_REC_FLAG_AUTOMATIC to the initial header in ctdb_ltdb_fetch()Michael Adam2011-03-141-0/+1
| | | | | | Signals that this record was not created by a client level store. (This used to be ctdb commit 69d34983a37b0324ff7610b8dfdcd8d13bf81c54)
* server: Use the ctdb_ltdb_store_server() in the ctdb daemon for ↵Michael Adam2011-03-141-0/+4
| | | | | | | | | non-persistent dbs This is realized by adding a ctdb_ltdb_store_fn function pointer to the db context and filling it in the attach procedure for non-persistent dbs. (This used to be ctdb commit df49ec44de80affa5ccc637dec12a20a26e8706e)
* Remove LACOUNT and LACCESSOR and migrate the records immediately.Ronnie Sahlberg2011-02-181-1/+0
| | | | | | | | | | | | | | | This concept didnt work out and it is really just as expensive as a full migration anyway, without the benefit of caching the data for subsequence accesses. Now, migrate the records immediately on first access. This will be combined with a "cheap vacuum-lite" for special empty records to prevent growth of databases. Later extensions to mimic read-only behaviour of records will include proper shared read-only locking of database records, making the laccessor/lacount read-only access to the data obsolete anyway. By removing this special case and handling of lacount laccessor makes the codapath where shared read-only locking will be be implemented simpler, and frees up space in the ctdb_ltdb header for use by vacuuming flags as well as read-only locking flags. (This used to be ctdb commit 155dd1f4885fe142c6f8bd09430f65daf8a17e51)
* change the hash function to use the much better Jenkins hashRonnie Sahlberg2011-02-181-8/+1
| | | | | | | | from the tdb library cq S1020233 (This used to be ctdb commit b86feb6fe463dfdb67b2798491df18a4c434a430)
* Add ctdb_fork(0 which will fork a child process and drop the real-timeRonnie Sahlberg2011-01-112-7/+12
| | | | | | | | | scheduler for the child. Use ctdb_fork() from callers where we dont want the child to be running at real-time privilege. (This used to be ctdb commit 58795a4c9e0624e20fa3e0023b65127053edd103)
* Revert scheduling back to use real-time processesRonnie Sahlberg2011-01-111-8/+41
| | | | | | | | | Revert this patch: commit 482c302d46e2162d0cf552f8456bc49573ae729d We may need to use real-time processes for the main daemon and the recovery daemon to handle the cases where systems come under very high loads. (This used to be ctdb commit 08bef9dcab6e4da15fc783f8624e5ed09aa060b5)
* add a new ctdb_ltdb function to delete a record in a normal databaseRonnie Sahlberg2010-12-071-0/+19
| | | | (This used to be ctdb commit fe9070ec9be69e6a6fcbf9899e7ced24541c9c3a)
* Drop the loglevel of the "reqid wrap" developer debug message to DEBUGRonnie Sahlberg2010-10-281-1/+1
| | | | | | so that we dont spam the logs with this normal benign message. (This used to be ctdb commit dc57df549854e329b453ef14cff5cd352632ef73)
* Revert "change the hash function to use the much better Jenkins hash"Ronnie Sahlberg2010-10-111-1/+8
| | | | | | | | | | | | | This reverts commit f7e91ae905cd61249028e15f2cb509ea69f10b9e. This may require a change to the ctdb protocol, or a mechanism to negotiate/verify that we dont run with different hash fucntions across the cluster. Reverting the change until we decide how to solve this in the master version. (This used to be ctdb commit 2a2a7a201c90462295544ca23c8a3e215f140622)
* change the hash function to use the much better Jenkins hashRonnie Sahlberg2010-10-081-8/+1
| | | | | | | | from the tdb library cq S1020233 (This used to be ctdb commit f7e91ae905cd61249028e15f2cb509ea69f10b9e)
* Create macros to update the statistics counters and use these macrosRonnie Sahlberg2010-09-291-34/+0
| | | | | | everywhere instead of manipulating the coutenrs directly. (This used to be ctdb commit 2e648df890e5713bc575965d87937827b068d0d7)
* AIX bind wants the correct addrsizeHarald Klatte2010-09-031-1/+4
| | | | (This used to be ctdb commit b5169e037fe113a5b62f510646b8fefc055c053b)
* ouch, the ordering of the constants and the strings must be kept in syncRonnie Sahlberg2010-08-301-2/+2
| | | | | | manually and ther eis no check for errors. should fix this later (This used to be ctdb commit e824af1a41f8ceec1edf6b3d1d6e1758fa00deb2)
* Add a new event "ipreallocated"Ronnie Sahlberg2010-08-301-0/+1
| | | | | | | | | | | | | | | | | This is called everytime a reallocation is performed. While STARTRECOVERY/RECOVERED events are only called when we do ipreallocation as part of a full database/cluster recovery, this new event can be used to trigger on when we just do a light failover due to a node becomming unhealthy. I.e. situations where we do a failover but we do not perform a full cluster recovery. Use this to trigger for natgw so we select a new natgw master node when failover happens and not just when cluster rebuilds happen. (This used to be ctdb commit 7f4c591388adae20e98984001385cba26598ec67)
* Merge commit 'rusty/ports-from-1.0.112' into fooRonnie Sahlberg2010-08-191-1/+1
|\ | | | | | | (This used to be ctdb commit 13e58d92f5f1723e850a82ae030d0ca57e89b1ee)
| * logging: give a unique logging name to each forked child.Rusty Russell2010-08-181-1/+1
| | | | | | | | | | | | | | | | This means we can distinguish which child is logging, esp. via syslog where we have no pid. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 68b3761a0874429b90731741f0531f76dcfbb081)
* | event: Update events to latest Samba version 0.9.8Rusty Russell2010-08-187-8/+9
|/ | | | | | | | | | | | | 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-011-16/+43
| | | | | | | | | | 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)
* Merge commit 'rusty/idtree'Ronnie sahlberg2010-06-101-1/+7
|\ | | | | | | (This used to be ctdb commit 069db55ea6fa6b8dd278b880c1a325e259f3e172)
| * Delay reusing ids to make protocol more robustRusty Russell2010-06-101-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ronnie and I tracked down a bug which seems to be caused by a node running so slowly that we timed out the request and reused the request id before it responded. The result was that we unlocked the wrong record, leading to the following: ctdbd: tdb_unlock: count is 0 ctdbd: tdb_chainunlock failed smbd[1630912]: [2010/06/08 15:32:28.251716, 0] lib/util_sock.c:1491(get_peer_addr_internal) ctdbd: Could not find idr:43 ctdbd: server/ctdb_call.c:492 reqid 43 not found This exact problem is now detected, but in general we want to delay id reuse as long as possible to make our system more robust. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 9eb9c53ef29f4871ae2fe62fc5cb6145fca89eed)
* | print the db name qwhen a chainunlock fails tooRonnie Sahlberg2010-06-091-1/+1
| | | | | | | | (This used to be ctdb commit 7932156d7f25870e6937faca08bf75d3cdbad2e5)
* | when tdb_chainunlock() fails, print the tdb error that occuredRonnie Sahlberg2010-06-091-1/+1
|/ | | | (This used to be ctdb commit dcdd2010905b9007fbf7ab71f576cfbd48acce8a)
* Additional log messages when tdb databases can no longer be chainlocked or ↵Ronnie Sahlberg2010-06-081-1/+1
| | | | | | | | chainunlocked BZ64688 (This used to be ctdb commit b977901a49a9fed45cc8a2fe880eb749f58278f6)