diff options
author | Amitay Isaacs <amitay@gmail.com> | 2012-10-11 11:29:29 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@gmail.com> | 2012-10-20 02:48:44 +1100 |
commit | 83306337df00f11dd03e06c2043e2b27b2f0c17c (patch) | |
tree | 00e5c68d7a10d8c2a027285a253f01248313682e /ctdb/include/ctdb_protocol.h | |
parent | 1011d10a515f165c29fb5470ad04acf856a6217a (diff) | |
download | samba-83306337df00f11dd03e06c2043e2b27b2f0c17c.tar.gz samba-83306337df00f11dd03e06c2043e2b27b2f0c17c.tar.xz samba-83306337df00f11dd03e06c2043e2b27b2f0c17c.zip |
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)
Diffstat (limited to 'ctdb/include/ctdb_protocol.h')
-rw-r--r-- | ctdb/include/ctdb_protocol.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ctdb/include/ctdb_protocol.h b/ctdb/include/ctdb_protocol.h index 96827563c1..78e7437f1d 100644 --- a/ctdb/include/ctdb_protocol.h +++ b/ctdb/include/ctdb_protocol.h @@ -661,6 +661,14 @@ struct ctdb_statistics { struct latency_counter ctdbd; struct latency_counter recd; } reclock; + struct { + uint32_t num_calls; + uint32_t num_current; + uint32_t num_pending; + uint32_t num_failed; + struct latency_counter latency; + uint32_t buckets[MAX_COUNT_BUCKETS]; + } locks; uint32_t total_calls; uint32_t pending_calls; uint32_t lockwait_calls; @@ -697,6 +705,14 @@ struct ctdb_db_hot_key { TDB_DATA key; }; struct ctdb_db_statistics { + struct { + uint32_t num_calls; + uint32_t num_current; + uint32_t num_pending; + uint32_t num_failed; + struct latency_counter latency; + uint32_t buckets[MAX_COUNT_BUCKETS]; + } locks; uint32_t db_ro_delegations; uint32_t db_ro_revokes; uint32_t hop_count_bucket[MAX_COUNT_BUCKETS]; |