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)
committerMichael Adam <obnox@samba.org>
Mon, 26 Aug 2013 11:35:51 +0000 (13:35 +0200)
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 74952e1b76c8e2743ee0393658b7b46675c55fea..36423e07b8fd5952919903493ad7d6be868ec00f 100644 (file)
@@ -267,6 +267,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);
 
@@ -290,8 +292,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;
@@ -303,6 +303,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;
        }