summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* libctdb: add logging infrastructureRusty Russell2010-06-046-4/+105
| | | | | | | | | | | | | | This is based on Ronnie's work, merged with mine. That means errors are all my fault. Differences from Ronnie's: 1) use syslog's LOG_ levels directly. 2) typesafe arg to log function, and use it (eg stderr) in helper function. 3) store fn in ctdb context, and expose ctdb_log_level directly thru API. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 86259aa395555aaf7b2fae7326caa2ea62961092)
* libctdb: add ctdb arg to more functions.Rusty Russell2010-06-047-55/+68
| | | | | | | | This is going to help for logging, since we want it there. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 0786152472bc43efae4c896f7c6c07c6e080b9b2)
* Readrecordlock changes:Ronnie Sahlberg2010-06-041-1/+21
| | | | | | | | | | | | | Make the use of ctdb_release_lock() mandatory from the callback. Split ctdb_release_lock() in two, release the tdb lock in the ctdb_release_lock() function and move the freeing of the lock structure to ctdb_free_lock() which is private to libctdb. When the callback returns, verify that the callback has actually released the lock and warn (FIXME) if not. Update ctdb_writerecord to warn and fail (FIXME) if writing while the lock is not held. (This used to be ctdb commit 87dc18a3a051da04685f14529c53c428d37c2912)
* remove the global rrl_cb_called from the libctdb exampleRonnie Sahlberg2010-06-041-4/+15
| | | | | | | | | | | and psss it through the callback via private_data. add a comment that the callback may sometimes have already been invoked when the ctdb_readrecordlock_async() call returns and that the application can use *private_data IF the application needs to know if the callback has already triggered or not. (This used to be ctdb commit 0ba458a91ba510215a9c8770286a68e19911515f)
* libctdb: change callback for ctdb_readrecordlock.Rusty Russell2010-06-043-66/+47
| | | | | | | | | | | | | | | | After discussion with Ronnie, we decided to revisit this interface. We use the name ctdb_readrecordlock_async, as it is *not* always a send, and we use a specific callback to avoid the "fake request" creation on the fast path. The request itself is never exposed: this means it can't be cancelled, but we can revisit that later if need be. This makes both use and implementation simpler. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 03b5546ae45a60ab41eb4f7159a45bfdbf959888)
* libctdb: fix wrong argument being handed to callback on attachdb failRusty Russell2010-06-041-2/+2
| | | | | | | | | When attachdb failed, we were handing the db, not the user-supplied arg to the callback. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 8626b6d7d4e5c747b6bac9d5e5b2cd302b6e144c)
* When we say "current time of statistics" in the "ctdb statistics" output,Ronnie Sahlberg2010-06-021-1/+1
| | | | | | print the current time and not the start time (This used to be ctdb commit d42ea3b1892f6a4abd1dbcf822d0a4d5db422d38)
* ctdb_req_control contains 4 padding bytes. Create an explicit pad variable ↵Ronnie Sahlberg2010-06-023-0/+9
| | | | | | | | | here and set it to 0 when creating a control to keep valgrind happy. PDUs are padded to 8 byte boundary. If padding is used, memset it to 0 to keep valgrind happy. (This used to be ctdb commit 8818d5c483558c0faa6a3923ed5e675fdcfc13af)
* Add the offsetof macro to libctdbRonnie Sahlberg2010-06-023-3/+7
| | | | | | change all calls to new_ctdb_request() to use the offset macro to calculate the correct size (instead of allocating one byte too many and hoping the alignment padding saves us.) (This used to be ctdb commit 07b395258ab08218e8eed3b4a52654925b85275c)
* Make the call to free the request explicit in the callbackRonnie Sahlberg2010-06-023-4/+8
| | | | | | instead of implicit (This used to be ctdb commit 573e4e2d2bd09dd9579150cce926de774a0b609c)
* Automatically free the request once the callback has returned.Ronnie Sahlberg2010-06-021-0/+1
| | | | (This used to be ctdb commit 2b3904d3113737d57ac0ec78f33ad163ed7f623c)
* Add a variable for start/current time to ctdb statisticsRonnie Sahlberg2010-06-024-0/+22
| | | | | | and print the time startistics was taken and for how long the statistics have been collected to the "ctdb statistics" output. (This used to be ctdb commit 1bdfe0cd3370a335b960ce1ef97eade93b0cd2fa)
* link ctdb with libctdb and connect to the daemon both the old way and by ↵Ronnie Sahlberg2010-06-022-6/+19
| | | | | | | | using libctdb update the function "control_pnn()" to use libctdb to ask the daemon for the pnn (This used to be ctdb commit 3f651eb8d71c7af0268460bc4b1476112140b290)
* add a sync wrapper for the getpnn controlRonnie Sahlberg2010-06-021-0/+17
| | | | (This used to be ctdb commit 01c2acdf3cb29bb44c74d9d792cf1d3706534ad2)
* add a function to read the current socketname from the ctdb structureRonnie Sahlberg2010-06-022-0/+6
| | | | (This used to be ctdb commit 112d252b2ab614eeac38e4a1658cd1e85f6eb829)
* rename ctdb_remove_message_handler to ctdb_client_remove_message_handlerRonnie Sahlberg2010-06-022-3/+5
| | | | | | to avoid conflict with the function of the same name in libctdb (This used to be ctdb commit 636ed76d04c8c499a911eb0d72d54b71b0a73d31)
* rename ctdb_message_fn_t to ctdb_msg_fn_t to avoid a conflict with the type ↵Ronnie Sahlberg2010-06-024-10/+6
| | | | | | of the same name used in libctdb (This used to be ctdb commit 49e23f8329649e4d9eefab47c9b158fcc7210d07)
* rename ctdb_set_message_handler to ctdb_client_set_message_handlerRonnie Sahlberg2010-06-026-19/+19
| | | | | | to avoid a colission with the function of the same name in libctdb (This used to be ctdb commit 41dbdd4fc0ab560420fb0e24a3179ff7c94c5bb7)
* rename ctdb_send_message to ctdb_client_send_message to resolve colission ↵Ronnie Sahlberg2010-06-029-18/+18
| | | | | | with the function of the same name in libctdb (This used to be ctdb commit ac3292c12832484a22715f1d46aa23f3b7c8a6f6)
* Dont link with libctdbRonnie Sahlberg2010-06-021-1/+1
| | | | | | | | This makes it easier to ensure we catch all places when we rename old api functions due to colissions with functions in libctdb (This used to be ctdb commit d643240783d4847591c5f72ee4d65e5daf1dbcf7)
* Update the tst.c example application for libctdb toRonnie Sahlberg2010-06-021-5/+13
| | | | | | | use the headers from /usr/include and add a comment about how to compile it (This used to be ctdb commit c0f38e0936c487b63964fd9cef7a9370f227275f)
* rename ccan/typesafe_cb.h to ctdb_typesafe_cb.h andRonnie Sahlberg2010-06-024-1/+3
| | | | | | add this file to the install/rpm (This used to be ctdb commit 96f186240a17386de1e02eb3af392d97bb55a1ae)
* When adding an ip at runtime, it might not yet have an iface assigned to it, ↵Ronnie Sahlberg2010-06-011-0/+5
| | | | | | so ensure that the next takover_ip call will fall through to accept the ip and add it. (This used to be ctdb commit 2d60f96680d16c2992e2a35517822f88c12538b7)
* Dont check linkstatus for loopback. This interface never hasRonnie Sahlberg2010-06-011-0/+3
| | | | | | issues with the physical layer (This used to be ctdb commit d938b80a1c409a9ec4b554ddca5b0d949be53d9e)
* Prevent clients from connecting to the natgw address.Ronnie Sahlberg2010-06-011-0/+8
| | | | | | | | This address is dedicated for outgoing connections. BZ62613 (This used to be ctdb commit f0e48dd833a4408449083148c172c2136b934e5b)
* add a gplv3 boilerplate to the example application for libctdbRonnie Sahlberg2010-05-261-0/+19
| | | | (This used to be ctdb commit 53df35aff1e10201a38931bbb82fb266a38892c0)
* check if vnn is a valid pointer before dereferencing itRonnie Sahlberg2010-05-261-1/+3
| | | | | | based on rustys patch for bz62783 (This used to be ctdb commit bdd250b9afdd1060cfd1e2b0f0a5a567150bb380)
* move the header files and libctdb.a out into a separate ctdb-devel rpmRonnie Sahlberg2010-05-261-5/+16
| | | | (This used to be ctdb commit 3587df065669972a631ba08918df37536c9cb633)
* make install to install libctdb.aRonnie Sahlberg2010-05-261-0/+1
| | | | (This used to be ctdb commit 93f1622cd4106fb1a2acbe643cbb2b3dc9fd0103)
* make sure we build libctdb for "make all"Ronnie Sahlberg2010-05-261-1/+1
| | | | (This used to be ctdb commit 76acb97ebcfc378e98767113a81e413969917bb1)
* Merge commit 'rusty/libctdb2'Ronnie Sahlberg2010-05-2529-938/+2892
|\ | | | | | | (This used to be ctdb commit d41b802250ddc0a89581eb6285edfd66bdc7a78a)
| * libctdb: tweak interface for readrecordlockRusty Russell2010-05-245-29/+29
| | | | | | | | | | | | | | | | | | | | | | Previously we could hang in poll with the callback pending (since we fake it): explicitly call it immediately. Note: I experienced corruption using DLIST_ADD_END (ctdb->pnn was blatted when adding to the message_handler list). I switched them all to DLIST_ADD, but maybe I'm using it wrong? (This used to be ctdb commit 3727165f0d206999d2cfc2800ff8868640868c7c)
| * libctdb: uniform callbacks, _recv functions to pull out data.Rusty Russell2010-05-2410-386/+661
| | | | | | | | | | | | | | | | This is a bit tricky for those cases where we need to do multiple or zero I/Os (eg. attachdb and readrecordlock), but works well for the simple cases. (This used to be ctdb commit ebe4dd724338c156423cfdcc10a75b68c2084cde)
| * patch libctdb-single-callback.patchRusty Russell2010-05-210-0/+0
| | | | | | | | (This used to be ctdb commit 1c2f08f104cf6b5f97998a3b9a426a4c5dfd4752)
| * tst.c: update to Ronnie's latestRusty Russell2010-05-201-5/+92
| | | | | | | | | | | | This provides a slightly more comprehensive test of the library. (This used to be ctdb commit f36e891c00c63d5b9dfbaddacff86d9da72d3bb7)
| * libctdb: Ronnie's build changes, so we actually build libctdb with make.Rusty Russell2010-05-202-2/+16
| | | | | | | | | | | | Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit f02526486680db1473bdf10328e8f62a2590c745)
| * libctdb: first cut, supports getrecmaster onlyRusty Russell2010-05-2111-0/+1266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a completely standalone library using only ctdb_protocol.h. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Header from folded patch 'libctdb-message-handling.patch': libctdb: add message handling to libctdb. Now clients can send and receive ctdb messages. (This used to be ctdb commit 732cf6ead4aa2fbefc2b81328171f52c8d935341)
| * libctdb: API changes from Ronnie's versionRusty Russell2010-05-202-111/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These simplifications mostly came up due to the implementation. o Rename ctdb_context to ctdb_connection. We already have a ctdb_context internally in ctdbd; don't confuse them! o Rename ctdb_handle to struct ctdb_request. From the user POV it's a request, and it's also useful internally to avoid implicit cast to/from void *. o Rename ctdb_db_context to ctdb_db. o Introduce ctdb_lock. This provides an explicit "lock object" you get from readrecordlock and have to hand to those functions which need you to hold a lock. o status args are "int" not int32_t. Should this be a bool? o Remove last traces on generic callback. Without semi-sync API, this doesn't help anything and loses type safety. o Remove the semi-async API. We can add this later, but I think a sync and async API is enough for our poor users for the moment :) o Registering a message handler also takes a callback. This way you can tell if it failed. Not sure if this is overkill, but it's consistent. o ctdb_service() takes an revents arg Strictly not necessary for a nonblocking fd, but nice to know if a read or write is possible. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 86e1f93df856f9627182ed0e18bfcff6866c0954)
| * libctdb: ctdb.h and tst.c from RonnieRusty Russell2010-05-202-0/+311
| | | | | | | | | | | | | | | | | | This imports ctdb.h and tst.c from Ronnie's work: it's a separate commit for now to make the changes obvious. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 09f05cbfc883e5aac33d3781b163cde178ece4cf)
| * libctdb: reorganize headers: remove ctdb.h, add ctdb_client.h and ↵Rusty Russell2010-05-2016-504/+529
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ctdb_protocol.h ctdb_client.h is the existing internal client interface (which was mainly in ctdb.h), and ctdb_protocol.h is the information needed for the wire protocol only. ctdb.h will be the new, shiny, libctdb API. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 4bba6b8cd47b352f98d41f9f06258d5ac3c9adef)
* | new version 1.9Ronnie Sahlberg2010-05-251-1/+3
| | | | | | | | (This used to be ctdb commit e553da6a060c9cd2514bdb888cf0e50d35572b88)
* | Add monitoring of quorum and make the node UNHEALTHY when quarum is lostRonnie Sahlberg2010-05-251-0/+26
| | | | | | | | (This used to be ctdb commit d58b575e15015c5ef9493ab3ad3e8657c5787e2c)
* | in 62.cnfs, lines in /etc/exports can have hte exports quoted,Ronnie Sahlberg2010-05-251-1/+2
| | | | | | | | | | | | so strip off any initial " on the exports line (This used to be ctdb commit dce2244e8ac6617c335cfcd721c3795071b9f2b2)
* | It was possible for ->recovery_mode to get out of sync with the new three db ↵Ronnie Sahlberg2010-05-251-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | priorities in such a way that ->recovery_mode was set to normal but database priorities leven2 or 3 was still set to frozen. causing the recovery daemon to fail to detect that a recovery was needed to recover access to the database. BZ63951 (This used to be ctdb commit 7411b2b577a16f85ad6913e1bfccce7ea260a613)
* | In control_ipreallocate() we wait at most 5 tries before aborting the commandRonnie Sahlberg2010-05-201-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and returning an error. This might not be sufficient if there are several recoveries in a row. Instead loop as long as it takes for the recovery master to finish the recoveries and re spond to the ipreallocate call. Increase the log level of the error message when the recovery master was busy and could not perform the ipreallocation promptly BZ61783 (This used to be ctdb commit 8e9fd36e4619b7cc7bb6f7f7416d13e4c00a296a)
* | document how to restore a backup into a different databaseRonnie sahlberg2010-05-203-82/+88
| | | | | | | | (This used to be ctdb commit 66e05500b6e5c8fa5efbcba4447e488dd4232897)
* | Enhance the "ctdb restoredb" command so you can restore a backup into a ↵Ronnie Sahlberg2010-05-201-5/+11
| | | | | | | | | | | | different database. (This used to be ctdb commit c692b09851fce85b61c8c654faafb49db8cb601b)
* | Merge commit 'obnox/master-rebase'Ronnie sahlberg2010-05-112-2/+7
|\ \ | |/ |/| | | (This used to be ctdb commit 3f0346dc758d3b05ccb86785e7c8a2d5679ff68c)
| * functions: when checking for a directory also check whether it can be accessed.Michael Adam2010-05-111-1/+1
| | | | | | | | | | | | | | | | Thanks to "waKKu" on irc for this improvement. Michael (This used to be ctdb commit 81e1483dd0ce2cd091721e456c0c194cc58442f3)
| * tests:ctdb_bench: make send_start_messages() static - eliminates compile warningMichael Adam2010-05-111-1/+1
| | | | | | | | | | | | Michael (This used to be ctdb commit e1a16c23d7dbf011ad220572f1bf081331efa8f8)