From fc7b70f7703f56922fb9443becb67aac6af96fbe Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Thu, 22 Jun 2017 17:45:20 +1000 Subject: [PATCH] ctdb-recovery: Get recmode unconditionally in the main_loop BUG: https://bugzilla.samba.org/show_bug.cgi?id=12857 This can be used later in the main_loop to avoid the local ip check. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke (cherry picked from commit 2fd2ccd4c8617cfa7374d7a5ee3d1cc61c4fa4ad) --- ctdb/server/ctdb_recoverd.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index d2338176073..c7f31e321c1 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -2596,6 +2596,13 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec, return; } + ret = ctdb_ctrl_getrecmode(ctdb, mem_ctx, CONTROL_TIMEOUT(), + CTDB_CURRENT_NODE, &ctdb->recovery_mode); + if (ret != 0) { + DEBUG(DEBUG_ERR, ("Failed to read recmode from local node\n")); + return; + } + /* if the local daemon is STOPPED or BANNED, we verify that the databases are also frozen and that the recmode is set to active. */ @@ -2608,10 +2615,6 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec, */ rec->priority_time = timeval_current(); - ret = ctdb_ctrl_getrecmode(ctdb, mem_ctx, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, &ctdb->recovery_mode); - if (ret != 0) { - DEBUG(DEBUG_ERR,(__location__ " Failed to read recmode from local node\n")); - } if (ctdb->recovery_mode == CTDB_RECOVERY_NORMAL) { DEBUG(DEBUG_ERR,("Node is stopped or banned but recovery mode is not active. Activate recovery mode and lock databases\n")); -- 2.47.2