summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_call.c
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-readonly: Do not use hard-coded value for readonly revoke timeoutAmitay Isaacs2014-03-311-2/+2
| | | | | | | | | | | | In case of control timeouts, readonly revoke code currently aborts. This needs to be fixed. Meanwhile, using control_timeout instead of 5 seconds, increases the timeout to 60 seconds. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Mon Mar 31 07:20:48 CEST 2014 on sn-devel-104
* ctdbd: Remove transaction code related to TRANS2 commitsAmitay Isaacs2013-10-041-1/+1
| | | | | | | | | This removes data types and structure elements related to TRANS2 persistent transaction code. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 22a253b7ccf1ff854cddf0b67969dc84d7d6a654)
* server: standardize formatting of comment block for ctdb_reply_dmaster() ↵Michael Adam2013-08-261-7/+7
| | | | | | | | | | | | while I'm at it.. This was the comment block I was touching and meant to adapt in commit 00d3bf092e2f72eda330978c75ec85f17e870553. My search was apparently not unique... Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit 09940255011b119dc6af3304f5d3e9568e6006fd)
* ctdbd: Make sure call data is freed if doing an early returnAmitay Isaacs2013-08-221-2/+10
| | | | | | | | This should avoid memory bloat when a request bounces between nodes. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 7677fb263f06a97398e2c546e32273fb96edca69)
* Revert "LACOUNT: Add back lacount mechanism to defer migrating a ↵Amitay Isaacs2013-08-221-12/+8
| | | | | | | | | | | | | | | | | | | fetched/read copy until after default of 20 consecutive requests from the same node" This reverts commit 035c0d981bde8c0eee8b3f24ba8e2dc817e5b504. This is a premature optimization. Record can bounce between nodes very quickly if it is a contended record. There is no need to hold a record on a node unnecessarily. In case record contention becomes bad, enabling sticky records on a database is a better idea. Conflicts: include/ctdb_private.h server/ctdb_tunables.c Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit ac417b0003f0116f116834ad2ac51482d25cfa0d)
* ctdbd: Print a log message when a key becomes hotAmitay Isaacs2013-08-221-0/+2
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 48f40985f4592c28402303ccbb458756f4914f75)
* server: standardize formatting of comment block for ctdb_reply_dmaster() ↵Michael Adam2013-08-191-6/+6
| | | | | | | | while I'm at it.. Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit 00d3bf092e2f72eda330978c75ec85f17e870553)
* server: fix wording and punctuation in comment block for ctdb_reply_dmaster().Michael Adam2013-08-191-2/+2
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit cb3a1c5af3b796dba30cae07118670d3c9e57df7)
* ctdbd: When a record is made sticky, log only onceAmitay Isaacs2013-08-091-2/+3
| | | | | | | | | | Instead of logging from ctdb_request_call(), log the message from ctdb_make_record_sticky(). That way if the record is already sticky, the message is not repeated unnecessarily. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 44a64d1c388bfe3c3388b191edfaedecfb7bb831)
* ctdbd: Improve high hopcount log messages when request is redirectedAmitay Isaacs2013-08-091-5/+5
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 9cde47e1a5bf1b9ca3b4da8c2db94caac2b1aa5e)
* ctdbd: Don't consider a hot record if the hopcount is zeroAmitay Isaacs2013-07-301-0/+3
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit ab35773518ad15588013f4d859f7bee790437450)
* ctdbd: Fix updating of hot keys in database statisticsAmitay Isaacs2013-07-291-7/+13
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit fde4b4db5a57f75c5efa5647c309f33e0d5a68f3)
* ctdbd: Set process names for child processesAmitay Isaacs2013-07-101-0/+1
| | | | | | | | This helps distinguish processes in process list in top, perf, etc. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 2493f57ce268d6fe7e4c40a87852c347fd60d29e)
* 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: fix comment explaining redirection of CTDB_REQ_CALL redirection.Michael Adam2013-05-241-2/+5
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit b697625b184227dad1be31a41b7a3fd9bd312e29)
* ctdbd: remove a nonempty blank lineMichael Adam2013-05-241-1/+0
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit d9e24782a90d9ce29c0e6584b75d2b186142174d)
* ctdbd: update comment describing ctdb_call_send_redirect()Michael Adam2013-05-241-12/+1
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit 9a21d417c51fb9cad8f2e87e00ca54d379aef860)
* ctdb_call: use CTDB_REC_RO_FLAGS where appropriateMichael Adam2013-04-241-1/+1
| | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-By: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit f99eb2f56d8ca27110a45ae0e1c4bff40ac7a60e)
* ctdb_call: don't bump the rsn in ctdb_become_dmaster() any moreMichael Adam2013-04-171-1/+1
| | | | | | | | | | This is now done in ctdb_ltdb_store_server(), so this extra bump can be spared. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-By: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit cad3107b12e8392f786f9a758ee38cf3a3d58538)
* STATISTICS: Add tracking of the 10 hottest keys per database measured in ↵Ronnie Sahlberg2012-06-131-1/+49
| | | | | | | | hopcount and add mechanisms to dump it using the ctdb dbstatistics command (This used to be ctdb commit 8307c70ed98996b430c470e9641a09fdeeb81bd8)
* server: Replace BOOL datatype with bool, True/False with true/falseAmitay Isaacs2012-05-281-4/+4
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 6e5cbe8fff71985e5a2fc16b7e9f2b868011ff5d)
* Track all child process so we never send a signal to an unrelated process ↵Ronnie Sahlberg2012-05-031-2/+2
| | | | | | | | | | | (our child died and kernel wrapped the pid-space and reused the pid for a different process Wrap all creation of child processes inside ctdb_fork() which is used to track all processes we have spawned. Capture SIGCHLD to track also which child processes have terminated. Wrap kill() inside ctdb_kill() and make sure that we never send a !0 signal to a child process pid that has already terminated (and might have been replaced with a (This used to be ctdb commit f73a4b1495830bcdd094a93732a89dd53b3c2f78)
* 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)
* STICKY: add prototype code to make records stick to a node to "calm" down if ↵Ronnie Sahlberg2012-03-201-6/+243
| | | | | | | | they are found to be very hot and accessed by a lot of clients. This can improve performance and stop clients from having to chase a rapidly migrating/bouncing record (This used to be ctdb commit d0d98f7e45e5084b81335b004d50bddc80cdc219)
* LACOUNT: Add back lacount mechanism to defer migrating a fetched/read copy ↵Ronnie Sahlberg2012-03-201-8/+12
| | | | | | | | 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)
* STATISTICS: add per-db hop count statisticsRonnie Sahlberg2012-03-201-2/+3
| | | | (This used to be ctdb commit 1c976d83b1d7dac6f0ef81306774998e4c8b56a1)
* add max hop count buckets to see how bad hopcounts areRonnie Sahlberg2012-03-201-0/+12
| | | | (This used to be ctdb commit 7d3931298e6477d92f43652c3006b0c426cb1307)
* READONLY: when updating a remote node to revoke a delegation, make sure we ↵Ronnie Sahlberg2012-03-021-0/+1
| | | | | | dont create the record if it doesnt already exist (This used to be ctdb commit fb00e1290fcea3386132a46c883994019a43799a)
* ReadOnly: add per-database statistics to view how much delegations/revokes ↵Ronnie Sahlberg2012-02-081-0/+2
| | | | | | we have (This used to be ctdb commit 751ed46197661eb841042ab6a02855a51dd0b17c)
* STATISTICS: add total counts for number of delegations and number of revokesRonnie Sahlberg2012-02-081-0/+2
| | | | | | | | | Everytime we give a delegation to another node we count this as one delegation. If the same record is delegated to several nodes we count one for each node. Everytime a record has all its delegations revoked we count this as one revoke. (This used to be ctdb commit b098bcf8007be63889aaed640a951b0eeaa9d191)
* server: fix a comment typoMichael Adam2012-01-101-1/+1
| | | | (This used to be ctdb commit 85879edd09ffa26f87c566954cbd2c14f1e331ed)
* typoRonnie Sahlberg2011-12-141-1/+1
| | | | (This used to be ctdb commit 8fc71ad4da746e28406c06a95928052b29803062)
* Clean up warnings: log some unchecked return codes from function callsMartin Schwenke2011-11-091-0/+3
| | | | | | | | | | | | | | | | | | 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)
* Fix some typosVolker Lendecke2011-11-021-2/+2
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit f24e943eb7d8b86ce6b32ae37e3884ec4af0f7df)
* ReadOnly: fix bug writing incorrect amount of data in delegated recordRonnie Sahlberg2011-10-281-1/+7
| | | | | | | Fix bug when ctdbd updates the local copy of a delegated record to write the correct amount of data to the record. (This used to be ctdb commit 8814d8bc159a5e368afaa236ac7d865165db04b2)
* ReadOnly: Dont update the record header from the calling client. While it is ↵Ronnie Sahlberg2011-10-241-0/+54
| | | | | | | | | 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: Check the readonly flag instead of whether the tdb pointer is NULL ↵Ronnie Sahlberg2011-08-231-1/+1
| | | | | | or not (This used to be ctdb commit 01314c2cb3a480917d6a632b83c39f0a48bba0e7)
* ReadOnly: clear out the tracking record once a revoke is completedRonnie Sahlberg2011-08-231-0/+4
| | | | (This used to be ctdb commit 7af255551f058d1f6bfdd38ca603e7a19d1bb7ba)
* ReadOnly: Add processing for ReadOnly delegation requests and revoke ↵Ronnie Sahlberg2011-08-231-14/+116
| | | | | | | | requests to the processing loop for CALL packets we receive from different nodes. This implements the ReadOnly and ReadWrite request processing, delegation and revoking of delegations for all requests coming in across the network from a remote node. (This used to be ctdb commit 78f2c2ea70e6270cec59db7c3f174a511bf608a9)
* ReadOnly: When releasing all deferred calls that blocked during revoke of ↵Ronnie Sahlberg2011-08-231-1/+1
| | | | | | all previous delegations, add a 1 second grace/delay for any new readonly delegation requests so that the read-write fetch-lock porcess has a chance to make progress (This used to be ctdb commit 2a4e9e69850d64dd8aef695f587ebe04393a688f)
* ReadOnly: Add a function to start a revoke of all delegations for a record.Ronnie Sahlberg2011-08-231-0/+266
| | | | | | This triggers a child process to be created to perform the actual potentially blocking calls that are required. (This used to be ctdb commit 7d575ee92c95bc4aab78a33bc1aac7ff0811ab3a)
* ReadOnly: Add functions to register CALLs to a context used to handle ↵Ronnie Sahlberg2011-08-231-0/+93
| | | | | | | | | | | deferal of processing of CALL commands. Once the contexts are freed, the deferred calls are re-issued to the input packet processing functions again. This is needed when/if a CALL can not currently be processed by the main engine due to the record being locked down for revoking of all delegations. The data is passed through several layers of callbacks, and finally a timed event callback to ensure that the processing of the packet will be restarted again at the topmost eventloop, avoinding event loop nesting. (This used to be ctdb commit cc6f78efcfa3b8caeffbd68018e6dfbf81488dce)
* ReadOnly: Add an extra flag to ctdb_call_local to specify whether we want to ↵Ronnie Sahlberg2011-08-231-3/+7
| | | | | | write the record and header back to the tdb (for example we do when performing dmaster migrations) (This used to be ctdb commit b935e83255aeb3754b2fd37cf5611e02f7283514)
* ctdbd: fix lock held on error ("ctdb_req_dmaster from non-master.")Rusty Russell2011-03-211-0/+1
| | | | | | | | | | | | | | | We should release the lock on the record before returning; otherwise the recovery (which tries to freeze the database) will fail. Symptoms are as follows: ctdbd: pnn 15 dmaster request for new-dmaster 19 from non-master 1 real-dmaster=5 key f049c3c8 dbid 0x6cf2837d gen=1148812532 curgen=1148812532 c->rsn=2 header.rsn=15 reqid=2147483585 keyval=0x4f464e49 ctdbd: ctdb_req_dmaster from non-master. Force a recovery. ... ctdbd: freeze_lock-1:server/ctdb_freeze.c:55 Failed to lock database registry.tdb CQ:1022545 (This used to be ctdb commit 38b2dbe0605816742e74e2b8a811eaba99c7e12d)
* call: becoming dmaster in VACUUM_MIGRATION, set the VACUUM_MIGRATED record flagMichael Adam2011-03-141-1/+14
| | | | | | | | | This temporary flag is used for the local record storage function to decide whether to delete an empty record which has never been migrated with data as part of the fast-path vacuuming process or, or to store the record. (This used to be ctdb commit c11ca778ee90444c44dee0a629cd2eefa3a1f75e)
* call: hand the submitted record_flags to local record storage function.Michael Adam2011-03-141-0/+1
| | | | (This used to be ctdb commit 4079b8bf7a57a27a45d29784a1b0a414c778e552)
* call: transfer the record flags in the ctdb call packets.Michael Adam2011-03-141-6/+26
| | | | | | | | | | | | | This way, the MIGRATED_WITH_DATA information can be transported along with the records. This is important for vacuuming to function properly. The record flags are appended to the data section of the ctdb_req_dmaster and ctdb_reply_dmaster structs. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 945187d64cfc7bd30a0c3b0d548cbe582d95dde3)
* server: when we migrate off a record with data, set the MIGRATED_WITH_DATA flagMichael Adam2011-03-141-0/+4
| | | | (This used to be ctdb commit f5fb232117886186066ab3430fdd2307cba94960)
* server: add a comment explaining the call redirect logic in ↵Michael Adam2011-02-241-3/+24
| | | | | | ctdb_call_send_redirect(). (This used to be ctdb commit 81663b81687c0ba681500cca6aa8174bb9587ad2)
* ctdb_req_dmaster from non-masterRonnie Sahlberg2011-02-181-1/+3
| | | | | | | | | | If we find a situatior where we get a stray packet with the wrong dmaster, dont suicide with ctdb_fatal() since this is too disruptive. Just drop the stray packet and force a recovery to make sure all is good again. CQ S1022004 (This used to be ctdb commit 62b7fe853db37c0a90e48a0332a3426a8dcb4ed8)