summaryrefslogtreecommitdiffstats
path: root/ctdb/client
Commit message (Collapse)AuthorAgeFilesLines
...
* fix zero-initialization of header in _ctdbd_allocate_pkt to the correct sizeMichael Adam2011-12-231-2/+1
| | | | (This used to be ctdb commit 6c4d1b768ccade344a7462ecad7cf5cbbf3873d4)
* traverse: fix traversing with empty records by adding a new (internal) ↵Michael Adam2011-12-031-2/+2
| | | | | | | | | | | | | control CTDB_CONTROL_TRAVERSE_START_EXT By this, the original CTDB_CONTROL_TRAVERSE_START control that is used by e.g. samba's smbstatus, is not changed, so that samba continues working without code change. The CTDB_CONTROL_TRAVERSE_START currently just adds the "withemptyrecords" flag to the state and processon on as CTDB_CONTROL_TRAVERSE_START_EXT. (This used to be ctdb commit 8281bb210858ed04992eacea7f6d02261e0fc1b1)
* ctdb: add an option --print-recordflags to trigger printing record flags in ↵Michael Adam2011-11-291-9/+11
| | | | | | | | catdb and dumpdbbackup This changes the default behaviour to not print record flags. (This used to be ctdb commit 2d2ce07c51055d9400b22cd3c1fd682597cb921c)
* ctdb: add an option --print-hash to enable printing of record hashes when ↵Michael Adam2011-11-291-0/+4
| | | | | | dumping dbs (This used to be ctdb commit efc033c28ade97f9884794256d59a4553e052d5f)
* ctdb: add an option --print-lmaster to enable printing of lmaster in "ctdb ↵Michael Adam2011-11-291-0/+5
| | | | | | catdb" (This used to be ctdb commit 326f88ef622620cb9e0569c4497bc0e86124beaa)
* ctdb: add an option --print-datasize to only print datasize instead of ↵Michael Adam2011-11-291-7/+11
| | | | | | | | dumping data in db dumps Used in catdb, cattdb and dumpdbbackup. (This used to be ctdb commit dd866116041e71cbf91e7fd91edcc9501634051d)
* ctdb: add an option --print-emptyrecords to enable printing of empty records ↵Michael Adam2011-11-291-3/+6
| | | | | | | | in dumping databases this option is used with the commands catdb, cattdb and dumpdbbackup. (This used to be ctdb commit 6ec68a2e667f66d2b194fe48cb75229a2777842e)
* client: add version ctdb_traverse_ext() of ctdb_traverse() that can list ↵Michael Adam2011-11-291-7/+28
| | | | | | empty records. (This used to be ctdb commit 4ada4bfc4510886c5c7fcf49e09711b9d2dcb75d)
* traverse: add a flag to enable transferring empty records in cluster wide ↵Michael Adam2011-11-291-0/+1
| | | | | | | | | traverse This will be useful for also printing information about empty/deleted records in "ctdb catdb", e.g. for debugging vacuuming issues. (This used to be ctdb commit ddc5da3a0df7701934404192a0a0aa659a806acb)
* Rename ctdb_ctrl_getscriptstatus() parameter to avoid shadowing a globalMartin Schwenke2011-11-111-3/+3
| | | | | | | | | | | | Rename parameter script_status to scripts to avoid shadowing a global function with the same name in eventscript.c. 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 668358057c1e6b9bbad7209212f9135c5e6241a0)
* Rename ctdb_control_destructor() to ctdb_client_control_destructor()Martin Schwenke2011-11-111-2/+2
| | | | | | | | | | | | This avoids a name clash with a slightly different function in ctdb_control.c. 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 82f6108bfbc7e48ca88650297c6a1c6ede0e1c9c)
* Move some common functions to common/ctdb_ltdb.cMartin Schwenke2011-11-111-38/+0
| | | | | | | | | | | | | 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)
* Clean up warnings: log some unchecked return codes from function callsMartin Schwenke2011-11-091-0/+6
| | | | | | | | | | | | | | | | | | In a few places functions are called, the return code is assigned into a variable but it is not checked. This generates a compiler warning like this: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Instead we remove the warning by checking the return code variable and log a warning at DEBUG level if the return code indicates an error. The justification is that there may have been a future intent to check the return code but it hasn't been important enough to follow-up. If it matters, it will be logged for easy debugging. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 1932466c76de2b184c2a257120768ab8c9d6c12a)
* ReadOnly: Dont update the record header from the calling client. While it is ↵Ronnie Sahlberg2011-10-241-26/+0
| | | | | | | | | convenient since it avoids having to create a child process from the main dameon for writing the updated record it makes the cleitn more complex. Remove the code in the example client code that writes the record to the local tdb. Add code to the local ctdbd processing of replies to check if this reply contain a ro delegation and if so, spawn a child process to lock the tdb and then write the data. (This used to be ctdb commit bf1d429227dc4f5818263cc39401d0a22663cdba)
* ReadOnly: Rename the function ctdb_ltdb_fetch_readonly() to ↵Ronnie Sahlberg2011-09-131-2/+2
| | | | | | 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-4/+371
|\ | | | | | | | | | | | | | | | | Conflicts: Makefile.in tools/ctdb.c (This used to be ctdb commit 0fedef0ffba4178126eee9544c5e2db52f5db893)
| * ReadOnly: add a new control to activate readonly lock capability for a database.Ronnie Sahlberg2011-09-011-0/+42
| | | | | | | | | | | | let all databases default to not support this until enabled through this control (This used to be ctdb commit 908a07c42e5135a3ba30a625fc4f4e4916de197a)
| * ReadOnly: When the client wants a readwrite lock but the local node is the ↵Ronnie Sahlberg2011-08-231-0/+19
| | | | | | | | | | | | dmaster and also have delegations active we must send a CALL to the local daemon to trigger it to revoke the delegations (This used to be ctdb commit 1b7d42c3425e39dd2a1c4460e8a01fb1ea4a513c)
| * ReadOnly: Add clientside code to fetch readonly recordsRonnie Sahlberg2011-08-231-0/+207
| | | | | | | | (This used to be ctdb commit 6fccc902bce21fa6ff13ed08ee3341bbf8be39f2)
| * ReadOnly: Add an extra flag to ctdb_call_local to specify whether we want to ↵Ronnie Sahlberg2011-08-231-4/+4
| | | | | | | | | | | | write the record and header back to the tdb (for example we do when performing dmaster migrations) (This used to be ctdb commit b935e83255aeb3754b2fd37cf5611e02f7283514)
| * ReadOnly: Add printing of the record flags when we are traversing a database ↵Ronnie Sahlberg2011-08-231-0/+9
| | | | | | | | | | | | to print its content. (This used to be ctdb commit 5eaa9a8683babac27f9f0144ff4cb5364fcd54f6)
| * ReadOnly: Add clientside functions to send the UPDATE_RECORD controlRonnie Sahlberg2011-08-231-0/+67
| | | | | | | | (This used to be ctdb commit 74a5b3d7bafd8827a4ee80095fde5798263821e4)
| * ReadOnly records: Add a new RPC function FETCH_WITH_HEADER.Ronnie Sahlberg2011-08-231-0/+23
| | | | | | | | | | | | This function differs from the old FETCH in that this function will also fetch the record header and not just the record data (This used to be ctdb commit c7196d16e8e03bb2a64be164d15a7502300eae0e)
* | pmda: Attempt reconnects while ctdbd is unavailableDavid Disseldorp2011-09-061-1/+1
| | | | | | | | | | | | | | | | | | Attempt to reconnect to ctdbd on fetch while it is unreachable. We must provide our own queue callback wrapper, as ctdb_client_read_cb() exits on transport failure. (This used to be ctdb commit 28df6fbf1273b8d095a2bc38dca6a6c35c5c31bd)
* | client: add timeout argument to ctdb_attachDavid Disseldorp2011-09-061-2/+6
|/ | | | | | Rather than using a fixed 2 second CTDB_CONTROL_GETDBPATH timeout. (This used to be ctdb commit 9e178671560cb95121e11d718a76b05380ecd6c5)
* client: handle transient connection errorsDavid Disseldorp2011-06-231-5/+30
| | | | | | | | | | | | | Client connections to the ctdbd unix domain socket may fail intermittently while the server is under heavy load. This change introduces a client connect retry loop. During failure the client will retry for a maximum of 64 seconds, the ctdb --timelimit option can be used to cap client runtime. Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit dc0c58547cd4b20a8e2cd21f3c8363f34fd03e75)
* ctdb catdb: fix escaping of '"' and '\'Gregor Beck2011-05-041-1/+1
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit 2b5cb0841fd813cd54be170c305a828885e0f038)
* client: add accessor function ctdb_header_from_record_handle().Michael Adam2011-03-141-0/+9
| | | | (This used to be ctdb commit cf57efd440ccc3db381386f4749bfcbf8ac5ecae)
* Remove LACOUNT and LACCESSOR and migrate the records immediately.Ronnie Sahlberg2011-02-181-11/+4
| | | | | | | | | | | | | | | 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)
* Revert scheduling back to use real-time processesRonnie Sahlberg2011-01-111-0/+5
| | | | | | | | | 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 rolling statistics that are collected across 10 second intervals.Ronnie Sahlberg2010-09-291-0/+20
| | | | | | Add a new command "ctdb stats [num]" that prints the [num] most recent statistics intervals collected. (This used to be ctdb commit e6e16fcd5a45ebd3739a8160c8fb5f44494edb9e)
* Dont use the deprecated talloc_append_string()Ronnie Sahlberg2010-08-201-4/+1
| | | | | | Use talloc_strdup_append() instead (This used to be ctdb commit e41581347af5ef26d429d38ed48fa46244f0dbfc)
* We need the deprecated talloc_append_string() for nowRonnie Sahlberg2010-08-191-0/+3
| | | | | | | so set the TALLOC_DEPRECATED sympol to allow use of this call from ctdb_client.c (This used to be ctdb commit 3afa5d945a56952a7f211af068d671945de960e5)
* Merge commit 'rusty/ports-from-1.0.112' into fooRonnie Sahlberg2010-08-191-1/+7
|\ | | | | | | (This used to be ctdb commit 13e58d92f5f1723e850a82ae030d0ca57e89b1ee)
| * logging: give a unique logging name to each forked child.Rusty Russell2010-08-181-1/+7
| | | | | | | | | | | | | | | | 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)
* | We use eventloop nesting in a couple of places, notably the syncRonnie Sahlberg2010-08-181-0/+1
| | | | | | | | | | | | | | | | parts of the recovery daemon. Initialize all event contexts to allow nesting (This used to be ctdb commit 5bf6bd5e7f33aabbeb7b9707716ef99cf471e590)
* | 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)
* Report client for queue errors.Rusty Russell2010-07-011-1/+1
| | | | | | | | | | 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)
* Wrap the IDR early, but not too early.Ronnie Sahlberg2010-06-101-1/+1
| | | | | | | We dont want it to wrap almost immediately so that basically all "ctdb ..." commands log the "Reqid wrap" warning. (This used to be ctdb commit f26b59d8b96a70baa80ab1bad406ee6a21330b68)
* Delay reusing ids to make protocol more robustRusty Russell2010-06-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | 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)
* Add a variable for start/current time to ctdb statisticsRonnie Sahlberg2010-06-021-0/+2
| | | | | | 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)
* add a function to read the current socketname from the ctdb structureRonnie Sahlberg2010-06-021-0/+5
| | | | (This used to be ctdb commit 112d252b2ab614eeac38e4a1658cd1e85f6eb829)
* rename ctdb_remove_message_handler to ctdb_client_remove_message_handlerRonnie Sahlberg2010-06-021-3/+3
| | | | | | 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-021-1/+1
| | | | | | 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-021-2/+2
| | | | | | 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-021-1/+1
| | | | | | with the function of the same name in libctdb (This used to be ctdb commit ac3292c12832484a22715f1d46aa23f3b7c8a6f6)
* Fix a compiler warningRonnie Sahlberg2010-04-081-1/+1
| | | | (This used to be ctdb commit 8825a8e3936e4ddfc1482d07a63a620249f01fe7)
* In ctdb catdb, print the payload data length without the ctdb header lengthVolker Lendecke2010-03-291-1/+1
| | | | (This used to be ctdb commit 45b3fe253c1d00c571b351fc73415bc799df3083)
* client: implement ctdb_ctrl_set_iface_link()Stefan Metzmacher2010-01-201-1/+18
| | | | | | metze (This used to be ctdb commit e2d6582001be28c1800e4da8b0f2dc541538c314)
* client: implement ctdb_ctrl_get_ifaces()Stefan Metzmacher2010-01-201-2/+57
| | | | | | metze (This used to be ctdb commit a21e3765dd83e837d93111f387448bf0a5dd4652)