freeze: Log message from ctdb_start_freeze() and ctdb_control_freeze()
authorAmitay Isaacs <amitay@gmail.com>
Mon, 1 Jul 2013 03:26:33 +0000 (13:26 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 2 Jul 2013 07:41:54 +0000 (17:41 +1000)
This ensures that whenever databases are frozen either via sending
control or by calling ctdb_start_freeze(), the action is logged.
Since ctdb_control_freeze() calls ctdb_start_freeze(), move logging of
message in early return condition if databases are already frozen.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 478e24bceda3fedfba54ccb48faa115df726b819)

server/ctdb_freeze.c

index 81c5b560807fe61060667edcf6eaa3189a103885..620d4c51b283e30c8a3df49e6e1e99a4bfbd7c80 100644 (file)
@@ -295,6 +295,8 @@ int ctdb_start_freeze(struct ctdb_context *ctdb, uint32_t priority)
                return 0;
        }
 
+       DEBUG(DEBUG_ERR, ("Freeze priority %u\n", priority));
+
        /* Stop any vacuuming going on: we don't want to wait. */
        ctdb_stop_vacuuming(ctdb);
 
@@ -322,8 +324,6 @@ int32_t ctdb_control_freeze(struct ctdb_context *ctdb, struct ctdb_req_control *
 
        priority = (uint32_t)c->srvid;
 
-       DEBUG(DEBUG_ERR, ("Freeze priority %u\n", priority));
-
        if (priority == 0) {
                DEBUG(DEBUG_ERR,("Freeze priority 0 requested, remapping to priority 1\n"));
                priority = 1;
@@ -335,6 +335,7 @@ int32_t ctdb_control_freeze(struct ctdb_context *ctdb, struct ctdb_req_control *
        }
 
        if (ctdb->freeze_mode[priority] == CTDB_FREEZE_FROZEN) {
+               DEBUG(DEBUG_ERR, ("Freeze priority %u\n", priority));
                /* we're already frozen */
                return 0;
        }