summaryrefslogtreecommitdiff
path: root/ctdb/server/ctdb_lock_helper.c
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-daemon: Fix signed/unsigned comparisons by declaring as unsignedMartin Schwenke2019-07-051-1/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-locking: Remove unnecessary global variableAmitay Isaacs2017-02-171-8/+5
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-locking: Explicitly unlock record/db in lock helperAmitay Isaacs2017-01-121-20/+157
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12469 Instead of killing lock helper processes with SIGKILL, send SIGTERM so lock helper processes can explicitly unlock record/db. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-locking: Remove support for locking multiple databasesAmitay Isaacs2017-01-121-11/+8
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12469 The code to lock multiple databases has been dropped from ctdb_lock.c. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-locking: Start locking helper using ctdb_vfork_execAmitay Isaacs2016-12-051-31/+22
| | | | | | | | This avoids the extra argument of logfd to ctdb_lock_helper. The log messages from lock helper are captured by ctdbd. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Drop CTDB's copy of sys_read() and sys_write()Martin Schwenke2016-11-291-0/+2
| | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Tue Nov 29 11:22:40 CET 2016 on sn-devel-144
* ctdb-lock-helper: Drop include of ctdb_private.hMartin Schwenke2016-11-291-1/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-locking: Reset real-time priority in lock helperAmitay Isaacs2016-11-181-0/+2
| | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12392 Earlier we were relying on SCHED_RESET_ON_FORK to reset the priority of lock helper processes. Since SCHED_RESET_ON_FORK support has been removed, the scheduling priority of child processes created using vfork() need to be reset explicitly in the helper processes. 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 Nov 18 10:18:27 CET 2016 on sn-devel-144
* ctdb-locking: Conditionally set real-time priority in lock helperAmitay Isaacs2016-06-201-18/+33
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-locking: Use real-time only for actual record or DB lockingAmitay Isaacs2016-03-071-5/+22
| | | | | | | | | | | | | Use real-time priority only for obtaining record and database locks. Do not open databases with real-time priority as it can cause thundering herd on fcntl lock while opening tdb database. Also relinquish real-time priority after the lock is obtained. 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 Mar 7 11:29:00 CET 2016 on sn-devel-144
* ctdb: Use ctdb_wait_for_process_to_exit()Martin Schwenke2016-02-231-3/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Remove dependency on includes.hAmitay Isaacs2015-10-301-2/+6
| | | | | | | Instead of includes.h, include the required header files explicitly. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Separate prototypes for system specific functionsAmitay Isaacs2015-10-301-0/+1
| | | | | | | | This groups function prototypes for system specific functions in common/system.h and removes them from ctdb_private.h. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Use correct tdb flags when enabling robust mutex supportAmitay Isaacs2014-12-191-10/+18
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11000 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ctdb-daemon: Fix the usage for lock helperAmitay Isaacs2014-09-251-2/+2
| | | | | | | | 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): Thu Sep 25 17:16:31 CEST 2014 on sn-devel-104
* ctdb-daemon: Make sure ctdb runs with real-time priorityAmitay Isaacs2014-09-121-1/+4
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-locking: Fork lock helper with vfork_with_logging()Martin Schwenke2014-09-121-9/+16
| | | | | | | | | | | | Otherwise errors printed by the lock helper get lost. lock_helper_args() no longer adds the program name to the list of arguments, since vfork_with_logging() does that. Update the lock helper to handle the extra log_fd parameter passed by vfork_with_logging() and send stdout/stderr there. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-locking: Set real-time priority for lock helpersAmitay Isaacs2014-09-111-0/+2
| | | | | | | | | | | | | | | | | To avoid lock helper starvation when userspace robust mutexes are enabled. Commit 6f072f85a138f595494dbec137bcf23d1e666acc removed reset_scheduler(), to avoid resetting scheduler priority. However, that is not sufficient because of commit 1be8564e553ce044426dbe7b3987edf514832940, which sets SCHED_RESET_ON_FORK flag. With SCHED_RESET_ON_FORK, all CTDB child processes will automatically have normal scheduling priority. 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): Thu Sep 11 11:31:10 CEST 2014 on sn-devel-104
* ctdb-common: Move hex_decode_talloc() to the lock helperMartin Schwenke2014-09-101-0/+16
| | | | | | | | | | This is the only place it is used. After migrating to Samba's lib/util, the lock helper can be changed to use strhex_to_data_blob(). Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-locking: Do not reset real-time priority for lock helpersAmitay Isaacs2014-09-051-2/+0
| | | | | | | | | | When using TDB robust mutexes, the kernel wakes waiting processes one by one, in the priority list order. To ensure that ctdb lock helper processes do not starve, lock helper processes need to run at a higher priority than smbd. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb: Use sys_read() and sys_write() to ensure correct signal interactionMartin Schwenke2014-08-211-1/+1
| | | | | | | ... and avoid compiler warnings in some cases. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Reset scheduler policy for helper processesAmitay Isaacs2014-06-121-0/+2
| | | | | | | | | | | | | Do not run helper processes with real-time priority. This regression was caused when locking and eventscript code switched to use vfork() and helper instead of ctdb_fork(). 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): Thu Jun 12 08:10:36 CEST 2014 on sn-devel-104
* ctdb-daemon: Remove duplicate code from helper binariesAmitay Isaacs2014-06-121-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* locking: Add a standalone helper to lock record/dbAmitay Isaacs2013-05-241-0/+148
Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit a08b6ac19506160f3fb5925ea025027dce07781d)