1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

16 Commits

Author SHA1 Message Date
Amitay Isaacs
a21a4de2cb ctdb-locking: Conditionally set real-time priority in lock helper
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-06-20 16:21:19 +02:00
Amitay Isaacs
ace23f0a81 ctdb-locking: Use real-time only for actual record or DB locking
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
2016-03-07 11:29:00 +01:00
Martin Schwenke
6695fa50ae ctdb: Use ctdb_wait_for_process_to_exit()
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-02-23 07:23:18 +01:00
Amitay Isaacs
01c6c90e98 ctdb-daemon: Remove dependency on includes.h
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>
2015-10-30 02:00:27 +01:00
Amitay Isaacs
b900adc55c ctdb-daemon: Separate prototypes for system specific functions
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>
2015-10-30 02:00:27 +01:00
Amitay Isaacs
e0bf5dd456 ctdb-daemon: Use correct tdb flags when enabling robust mutex support
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>
2014-12-19 13:15:12 +01:00
Amitay Isaacs
0f92de8463 ctdb-daemon: Fix the usage for lock helper
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
2014-09-25 17:16:31 +02:00
Amitay Isaacs
d410b20601 ctdb-daemon: Make sure ctdb runs with real-time priority
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-09-12 08:46:14 +02:00
Martin Schwenke
7ae7a9c463 ctdb-locking: Fork lock helper with vfork_with_logging()
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>
2014-09-12 08:46:14 +02:00
Amitay Isaacs
4e5a6b154e ctdb-locking: Set real-time priority for lock helpers
To avoid lock helper starvation when userspace robust mutexes are
enabled.

Commit 6f072f85a1 removed reset_scheduler(),
to avoid resetting scheduler priority.  However, that is not sufficient
because of commit 1be8564e55, 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
2014-09-11 11:31:10 +02:00
Martin Schwenke
94a5e28ffb ctdb-common: Move hex_decode_talloc() to the lock helper
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>
2014-09-10 01:36:14 +02:00
Amitay Isaacs
6f072f85a1 ctdb-locking: Do not reset real-time priority for lock helpers
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>
2014-09-05 07:05:10 +02:00
Martin Schwenke
c1558adeaa ctdb: Use sys_read() and sys_write() to ensure correct signal interaction
... and avoid compiler warnings in some cases.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-08-21 04:46:13 +02:00
Amitay Isaacs
9e6e48750d ctdb-daemon: Reset scheduler policy for helper processes
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
2014-06-12 08:10:36 +02:00
Amitay Isaacs
71ed758c72 ctdb-daemon: Remove duplicate code from helper binaries
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-06-12 05:40:10 +02:00
Amitay Isaacs
30aa825c1e locking: Add a standalone helper to lock record/db
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit a08b6ac19506160f3fb5925ea025027dce07781d)
2013-05-24 09:06:39 +10:00