diff options
Diffstat (limited to 'ctdb/include')
-rw-r--r-- | ctdb/include/ctdb_private.h | 39 | ||||
-rw-r--r-- | ctdb/include/ctdb_protocol.h | 16 |
2 files changed, 55 insertions, 0 deletions
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 5689c58b2f..35a1210c8e 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -136,6 +136,7 @@ struct ctdb_tunable { uint32_t db_size_warn; uint32_t pulldb_preallocation_size; uint32_t no_ip_takeover_on_disabled; + uint32_t deadlock_timeout; }; /* @@ -538,6 +539,12 @@ struct ctdb_context { const char *public_addresses_file; struct trbt_tree *child_processes; TALLOC_CTX *debug_hung_script_ctx; + + /* Used for locking record/db/alldb */ + int lock_num_current; + int lock_num_pending; + struct lock_context *lock_current; + struct lock_context *lock_pending; }; struct ctdb_db_context { @@ -1542,4 +1549,36 @@ int32_t ctdb_control_reload_public_ips(struct ctdb_context *ctdb, struct ctdb_re int ctdb_start_monitoring_interfaces(struct ctdb_context *ctdb); +/* from server/ctdb_lock.c */ +struct lock_request; + +int ctdb_lockall_prio(struct ctdb_context *ctdb, uint32_t priority); +int ctdb_unlockall_prio(struct ctdb_context *ctdb, uint32_t priority); +int ctdb_lockall_mark_prio(struct ctdb_context *ctdb, uint32_t priority); +int ctdb_lockall_unmark_prio(struct ctdb_context *ctdb, uint32_t priority); + +void ctdb_lock_free_request_context(struct lock_request *lock_req); + +struct lock_request *ctdb_lock_record(struct ctdb_db_context *ctdb_db, + TDB_DATA key, + bool auto_mark, + void (*callback)(void *, bool), + void *private_data); + +struct lock_request *ctdb_lock_db(struct ctdb_db_context *ctdb_db, + bool auto_mark, + void (*callback)(void *, bool), + void *private_data); + +struct lock_request *ctdb_lock_alldb_prio(struct ctdb_context *ctdb, + uint32_t priority, + bool auto_mark, + void (*callback)(void *, bool), + void *private_data); + +struct lock_request *ctdb_lock_alldb(struct ctdb_context *ctdb, + bool auto_mark, + void (*callback)(void *, bool), + void *private_data); + #endif 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]; |