Revert "It was possible for ->recovery_mode to get out of sync with the new three...
authorAmitay Isaacs <amitay@gmail.com>
Tue, 6 May 2014 04:07:00 +0000 (14:07 +1000)
committerMartin Schwenke <martins@samba.org>
Mon, 7 Jul 2014 11:29:49 +0000 (13:29 +0200)
This reverts commit 6578a97bd94fc14d5b6df85b84e50447f7bdb2e3.

This condition cannot happen since when recovery is triggered, all the
databases would get frozen and thawed in the order of priority.  The only
other place where databases get frozen are for implementation of ctdb
wipedb/restoredb commands.

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

index b0220de15058a0e4dcc70fec81858a5c282a3fca..4c5a26ecaecdeea391da82854fcb94c49116ace0 100644 (file)
@@ -198,16 +198,7 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
                return ctdb_control_push_db(ctdb, indata);
 
        case CTDB_CONTROL_GET_RECMODE: {
-               int i;
-               if (ctdb->recovery_mode == CTDB_RECOVERY_ACTIVE) {
-                       return CTDB_RECOVERY_ACTIVE;
-               }                 
-               for (i=1; i<=NUM_DB_PRIORITIES; i++) {
-                       if (ctdb->freeze_mode[i] == CTDB_FREEZE_FROZEN) {
-                               return CTDB_RECOVERY_ACTIVE;
-                       }
-               }
-               return CTDB_RECOVERY_NORMAL;
+               return ctdb->recovery_mode;
        }
 
        case CTDB_CONTROL_SET_RECMASTER: {