From cdc46ef9d72b0beb8696c8b6f7c3c40768834045 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Thu, 22 Sep 2016 13:58:06 +1000 Subject: [PATCH] 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 Reviewed-by: Martin Schwenke --- ctdb/server/ctdb_lock.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ctdb/server/ctdb_lock.c b/ctdb/server/ctdb_lock.c index 405a29e5573..46498e079ef 100644 --- a/ctdb/server/ctdb_lock.c +++ b/ctdb/server/ctdb_lock.c @@ -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;