]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-recovery: Get recmode unconditionally in the main_loop
authorAmitay Isaacs <amitay@gmail.com>
Thu, 22 Jun 2017 07:45:20 +0000 (17:45 +1000)
committerKarolin Seeger <kseeger@samba.org>
Mon, 26 Jun 2017 10:34:23 +0000 (12:34 +0200)
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 <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 2fd2ccd4c8617cfa7374d7a5ee3d1cc61c4fa4ad)

ctdb/server/ctdb_recoverd.c

index d2338176073cf719a180fcbd8a759fc2af42c76a..c7f31e321c1a1e08828ea7b9dff369d542886246 100644 (file)
@@ -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"));