]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-recovery: Setting up of recmode should be idempotent
authorAmitay Isaacs <amitay@gmail.com>
Thu, 22 Jun 2017 04:49:02 +0000 (14:49 +1000)
committerKarolin Seeger <kseeger@samba.org>
Mon, 26 Jun 2017 10:34:22 +0000 (12:34 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12857

If the recovery mode is already set to the expected value, there is
nothing to do.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit f2771fcbf438e8b06321752c7203f01bbe33b573)

ctdb/server/ctdb_recover.c

index 6bed61cd48dcf9101f4c96efb51179ef919f6499..410117a557b9818d01177d2f50b132fdbb40c481 100644 (file)
@@ -856,6 +856,13 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
        struct set_recmode_state *state;
        struct ctdb_cluster_mutex_handle *h;
 
+       if (recmode == ctdb->recovery_mode) {
+               DEBUG(DEBUG_INFO,
+                     ("Recovery mode already set to %s\n",
+                      recmode == CTDB_RECOVERY_NORMAL ? "NORMAL" : "ACTIVE"));
+               return 0;
+       }
+
        /* if we enter recovery but stay in recovery for too long
           we will eventually drop all our ip addresses
        */