From: Amitay Isaacs Date: Thu, 22 Jun 2017 07:45:20 +0000 (+1000) Subject: ctdb-recovery: Get recmode unconditionally in the main_loop X-Git-Tag: tdb-1.3.14~199 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fd2ccd4c8617cfa7374d7a5ee3d1cc61c4fa4ad;p=thirdparty%2Fsamba.git 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 --- diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index 751a08eb159..35b8d4248ff 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -2608,6 +2608,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) { + D_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. */ @@ -2620,10 +2627,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"));