summaryrefslogtreecommitdiff
path: root/ctdb/include
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-recoverd: Move ctdb_ctrl_modflags() to ctdb_recoverd.cMartin Schwenke2020-08-271-5/+0
| | | | | | | | This file is the only user of this function. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit a88c10c5a9afcf0a3dcadef07dd95af498bfa47a)
* ctdb-daemon: Add extra logging of hot keysMartin Schwenke2020-05-221-0/+1
| | | | | | | | | | | ctdbd currently only logs when a new hot key is added. If a key gets hotter then nothing new is logged. Log hot key updates when the number of migrations has doubled since the last time that key was logged. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Add separate hot keys array for database statisticsMartin Schwenke2020-05-221-0/+6
| | | | | | | | | | There are 2 reasons for this. Sorting of hot keys is broken and will be changed to an implementation that needs a named (i.e. not anonymous) structure. Also, at least one non-protocol field will be added to facilitate more useful logging. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Remove more unused old client database functionsMartin Schwenke2020-03-231-12/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Remove unused old client database functionsMartin Schwenke2020-03-232-22/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Fix signed/unsigned comparisonMartin Schwenke2020-02-181-1/+1
| | | | | | | | | | csbuild says: ctdb/server/ctdb_lock.c: scope_hint: In function ‘ctdb_find_lock_context’ ctdb/server/ctdb_lock.c:671:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Pass more information to ctdb_start_daemon()Martin Schwenke2020-02-101-1/+3
| | | | | | | | | | No functional changes. This is staging for a change that makes ctdbd fork when test mode is enabled but interactive is not set. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Rename ctdb_context private_data to transport_dataMartin Schwenke2019-11-141-1/+1
| | | | | | | This gives a casual reader a useful clue. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Rename ctdb_node private_data to transport_dataMartin Schwenke2019-11-141-1/+1
| | | | | | | This gives a casual reader a useful clue. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb/include/ctdb_private.h: typo fixesBjörn Jacke2019-10-311-1/+1
| | | | | Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Implement DB_VACUUM controlMartin Schwenke2019-10-241-0/+5
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: Simplify recording of in-progress vacuuming childMartin Schwenke2019-10-241-1/+1
| | | | | | | There can only be one, so simplify the logic. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Add implementation of VACUUM_FETCH controlAmitay Isaacs2019-10-241-0/+3
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Drop unused function ctdb_local_node_got_banned()Martin Schwenke2019-08-201-1/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14087 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Factor out new function ctdb_node_become_inactive()Martin Schwenke2019-08-201-0/+2
| | | | | | | | | | This is a superset of ctdb_local_node_got_banned() so will replace that function, and will also be used in the NODE_STOP control. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14087 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Add function ctdb_ip_to_node()Martin Schwenke2019-08-161-0/+2
| | | | | | | | | | | | | | This is the core logic from ctdb_ip_to_pnn(), so re-implement that that function using ctdb_ip_to_node(). Something similar (ctdb_ip_to_nodeid()) was recently removed in commit 010c1d77cd7e192b1fff39b7b91fccbdbbf4a786 because it wasn't required. Now there is a use case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Drop unused function ctdb_vfork_with_logging()Martin Schwenke2019-07-051-10/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Replace function ctdb_ip_to_nodeid() with ctdb_ip_to_pnn()Martin Schwenke2019-07-051-1/+2
| | | | | | | | | | | Node ID is a poorly defined concept, indicating the slot in the node map where the IP address was found. This signed value also ends up compared to num_nodes, which is unsigned, producing unwanted warnings. Just return the PNN because this what both callers really want. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Fix signed/unsigned comparisons by declaring as unsignedMartin Schwenke2019-07-051-1/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Make old list_of_nodes() function staticMartin Schwenke2019-07-051-3/+0
| | | | | | | | The next commit will change the type of this function, which is only used in this file. So, make it static to isolate the change. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-version: Simplify version string usageAmitay Isaacs2019-03-151-3/+0
| | | | | | | | | | | | | | | There is no need to write SAMBA_VERSION_STRING as CTDB_VERSION_STRING. Wherever required use SAMBA_VERSION_STRING directly. Avoids the confusion with two version.h files. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13789 Signed-off-by: Amitay Isaacs <amitay@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Fri Mar 15 06:31:50 UTC 2019 on sn-devel-144
* ctdb-build: use a fixed ctdb_version.h using SAMBA_VERSION_STRINGStefan Metzmacher2019-03-151-0/+3
| | | | | | | | | | | This way we don't get constant rebuild as SAMBA_VERSION_STRING is "4.7.0pre1.DEVELOPERBUILD" for the binaries under bin/ instead of "4.7.0pre1.GIT.59e51f6". BUG: https://bugzilla.samba.org/show_bug.cgi?id=13789 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Drop unused function ctdb_set_socketname()Martin Schwenke2018-11-061-1/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Drop implementation of RECEIVE_RECORDS controlAmitay Isaacs2018-10-081-2/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13641 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Add invalid_records flag to ctdb_db_contextAmitay Isaacs2018-10-081-0/+1
| | | | | | | | | | | If a node becomes INACTIVE, then all the records in volatile databases are invalidated. This avoids the need to include records from such nodes during subsequent recovery after the node comes out INACTIVE state. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13641 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Only consider client ID for local database attachMartin Schwenke2018-07-021-2/+5
| | | | | | | | | | | | | | | | The comment immediately above this code says "don't allow local clients to attach" and then looks up the client ID regardless of whether the request is local or remote. This means that an intentional remote attach from a client will not work correctly. No real client should ever do that since clients attach so they an access databases locally. Perhaps some sanity checks should be added. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13500 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Move ctdb_init() to the only place it is usedMartin Schwenke2018-05-011-5/+0
| | | | | | | | | This used to be used by client code but not anymore, so move it to where it is used. Drop the comment because it is wrong. Modernise logging. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Drop unused function ctdb_set_notification_script()Martin Schwenke2018-05-011-1/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-client: Remove ununsed functions from old client codeAmitay Isaacs2018-05-011-218/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13411 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Drop ctdbd --public-interface optionMartin Schwenke2018-03-191-1/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Add code to process ctdb_req_tunnel packetsAmitay Isaacs2017-10-101-0/+7
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Add implementation of tunnel controlsAmitay Isaacs2017-10-102-0/+19
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Add implementation of control CHECK_PID_SRVIDAmitay Isaacs2017-09-211-0/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13042 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* Revert "ctdb-daemon: Remove unused function ctdb_stop_monitoring()"Martin Schwenke2017-09-191-0/+2
| | | | | | | This reverts commit b119104267635d96b1f99a2e98d35438841585bf. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-client: Drop old client code for monitor controlsMartin Schwenke2017-09-141-18/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Remove unused function ctdb_stop_monitoring()Martin Schwenke2017-09-141-2/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Drop implementation of monitor controlsMartin Schwenke2017-09-141-5/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Add a function to check if db access is allowedAmitay Isaacs2017-09-121-0/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13021 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Fix ctdb_attach() to use database flagsAmitay Isaacs2017-08-251-1/+1
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12978 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Aug 25 13:32:58 CEST 2017 on sn-devel-144
* ctdb-client: Optionally return database id from ctdb_ctrl_createdb()Amitay Isaacs2017-08-251-1/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12978 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Fix ctdb_ctrl_createdb() to use database flagsAmitay Isaacs2017-08-251-1/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12978 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Drop the implementation of CHECK_SRVIDS controlAmitay Isaacs2017-08-141-2/+0
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Mon Aug 14 13:00:16 CEST 2017 on sn-devel-144
* ctdb-client: Drop client code to send CHECK_SRVIDS controlAmitay Isaacs2017-08-141-3/+0
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Pass db_flags instead of passing persistent flagAmitay Isaacs2017-06-291-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Store db_flags instead of individual boolean flagsAmitay Isaacs2017-06-291-3/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Add a function to get db open flagsAmitay Isaacs2017-06-261-0/+3
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Drop tdb_flags argument to ctdb_attach()Amitay Isaacs2017-06-261-2/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Ignore tdb open flags passed to DB attach controlsAmitay Isaacs2017-06-261-1/+1
| | | | | | | | The tdb open flags should be calculated based on the database type and ctdb tunables. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-locking: Reduce logging in case of contentionAmitay Isaacs2017-06-191-0/+3
| | | | | | | | | | | | | | | Currently, every lock helper will log a message if it cannot get a lock. This can spam the logs and overwhelm syslog if there are hundreds of lock helpers waiting for contended record. Instead keep track of the record for which we have already logged once with specific timeout interval. If we get timeout interval larger than the previously logged interval, then log again once. This will reduce the amount of logs for contended records to a single log entry per 10 seconds per record. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Do not allow mixed ctdb versions in a clusterAmitay Isaacs2017-05-242-0/+5
| | | | | | | | Extend CTDB_REQ_KEEPALIVE packet to include version and uptime. If CTDB versions do not match shutdown ctdb. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>