1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

ctdb-locking: Log if ctdb is unable to take db locks in INACTIVE state

This is useful information if ctdb is unable to freeze any of the
databases on banning or stopping.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2016-09-22 13:58:06 +10:00 committed by Amitay Isaacs
parent 25c7fa285d
commit cdc46ef9d7

View File

@ -401,12 +401,6 @@ static void ctdb_lock_timeout_handler(struct tevent_context *ev,
lock_ctx = talloc_get_type_abort(private_data, struct lock_context);
ctdb = lock_ctx->ctdb;
/* If a node stopped/banned, don't spam the logs */
if (ctdb->nodes[ctdb->pnn]->flags & NODE_FLAGS_INACTIVE) {
lock_ctx->ttimer = NULL;
return;
}
elapsed_time = timeval_elapsed(&lock_ctx->start_time);
if (lock_ctx->ctdb_db) {
DEBUG(DEBUG_WARNING,
@ -419,6 +413,11 @@ static void ctdb_lock_timeout_handler(struct tevent_context *ev,
elapsed_time));
}
/* If a node stopped/banned, don't spam the logs */
if (ctdb->nodes[ctdb->pnn]->flags & NODE_FLAGS_INACTIVE) {
goto skip_lock_debug;
}
if (ctdb_set_helper("lock debugging helper",
debug_locks, sizeof(debug_locks),
"CTDB_DEBUG_LOCKS",
@ -435,6 +434,8 @@ static void ctdb_lock_timeout_handler(struct tevent_context *ev,
" Unable to setup lock debugging\n"));
}
skip_lock_debug:
/* Back-off logging if lock is not obtained for a long time */
if (elapsed_time < 100.0) {
new_timer = 10;