1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-06 13:18:07 +03:00
Commit Graph

109 Commits

Author SHA1 Message Date
Amitay Isaacs
a73f13ada7 daemon: Add a tunable to enable automatic database priority setting
Samba versions 3.6.x and older do not set the database priority.
This can cause deadlock between Samba and CTDB since the locking order
of database will be different. A hack was added for automatic promotion
of priority for specific databases to avoid deadlock.  This code should
not be invoked with Samba version 4.x which correctly specifies the
priority for each database.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 4a9e96ad3d8fc46da1cd44cd82309c1b54301eb7)
2013-01-05 01:14:57 +01:00
Amitay Isaacs
442d9905fe locking: Do not use RECLOCK for tracking DB locks and latencies
RECLOCK is for recovery lock in CTDB. Do not override the meaning for
tracking locks on databases.  Database lock latency has nothing to do
with recovery lock latency.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 54e24a151d2163954e5a2a1c0f41a2b5c19ae44b)
2012-11-14 15:51:59 +11:00
Martin Schwenke
861d5304ac ctdbd: Fix compilation warning in locking code
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit cd64035d71ddff6aebe6c15a49e09527283425d2)
2012-10-31 12:33:25 +11:00
Amitay Isaacs
d39fbd60b9 locking: Do not use ctdb_kill() to kill smbd processes
ctdb_kill() is used to terminate processes spawned by CTDB.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 7d025281ee70c91ebcd4d9a908de1045a689786b)
2012-10-20 02:48:45 +11:00
Amitay Isaacs
1d83df7516 locking: Add database priority handling for older versions of samba
In samba versions 3.6.x and older, database priorities are not set.
later_db() function implements higher database priority (locking order)
for these databases -
   brlock, g_lock, notify_onelevel, serverid, xattr_tdb

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit edbc8a6669b594d3c413d603e1c9fada9244c2ee)
2012-10-20 02:48:45 +11:00
Amitay Isaacs
3c34207481 locking: Schedule a new lock request everytime a lock is released
Since the number of active lock requests is limited to
MAX_LOCK_PROCESSES_PER_DB (= 100), any new requests won't get scheduled
when they are created. So schedule a pending request once current active
request is done.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit c8eb4a3170ab8524e638047053831ba547e9cce8)
2012-10-20 02:48:44 +11:00
Amitay Isaacs
83306337df ctdbd: locking: Provide non-blocking API for locking of TDB record/db/alldb
This introduces a consistent API for handling locks on single record, complete
db or all dbs. The locks are taken out in a child process. In cases of timeout,
find the processes that currently hold the lock and log.

Callback functions for locking requests take locked boolean to indicate
whether the lock was successfully obtained or not.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 1af99cf0de9919dd89af1feab6d1bd18b95d82ff)
2012-10-20 02:48:44 +11:00
Amitay Isaacs
733bc2c03c Revert "server: locking: Provide a common API for non-blocking locking of TDBs"
This reverts commit 6a92fc2b8da2bba98dca29b781ab459ba4e879a5.

Reverting incomplete changes to ctdb_lock.c

(This used to be ctdb commit 2a3d22431948f849c93762a6ab49344acb687feb)
2012-05-01 12:09:48 +10:00
Amitay Isaacs
c3c5dec52c server: locking: Provide a common API for non-blocking locking of TDBs
(This used to be ctdb commit 6a92fc2b8da2bba98dca29b781ab459ba4e879a5)
2012-05-01 12:09:38 +10:00