ctdb-tools: There is no need for forcing a recovery
authorAmitay Isaacs <amitay@gmail.com>
Tue, 6 May 2014 04:15:45 +0000 (14:15 +1000)
committerMartin Schwenke <martins@samba.org>
Mon, 7 Jul 2014 11:29:49 +0000 (13:29 +0200)
This effectively reverts commit 442953c540424ad0c64f4264b5ee27c45a3130e8.
The correct way of telling recovery daemon to trigger a database recovery is
by setting recovery mode to active.  There is no need to freeze databases as
recovery master will do that across the cluster anyway.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/tools/ctdb.c

index aa0e4e3e4ea45ecc07ffb8ce4ef6f4e46dda0015..3b158fd7cdb72c37c0f3d9f933d1de96675ac858 100644 (file)
@@ -3463,23 +3463,10 @@ static int control_recover(struct ctdb_context *ctdb, int argc, const char **arg
 {
        int ret;
        uint32_t generation, next_generation;
-       bool force;
-
-       /* "force" option ignores freeze failure and forces recovery */
-       force = (argc == 1) && (strcasecmp(argv[0], "force") == 0);
 
        /* record the current generation number */
        generation = get_generation(ctdb);
 
-       ret = ctdb_ctrl_freeze_priority(ctdb, TIMELIMIT(), options.pnn, 1);
-       if (ret != 0) {
-               if (!force) {
-                       DEBUG(DEBUG_ERR, ("Unable to freeze node\n"));
-                       return ret;
-               }
-               DEBUG(DEBUG_WARNING, ("Unable to freeze node but proceeding because \"force\" option given\n"));
-       }
-
        ret = ctdb_ctrl_setrecmode(ctdb, TIMELIMIT(), options.pnn, CTDB_RECOVERY_ACTIVE);
        if (ret != 0) {
                DEBUG(DEBUG_ERR, ("Unable to set recovery mode\n"));