It was possible for ->recovery_mode to get out of sync with the new three db prioriti...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 21 May 2010 04:25:47 +0000 (14:25 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 21 May 2010 04:25:47 +0000 (14:25 +1000)
->recovery_mode was set to normal   but database priorities leven2 or 3 was still set to frozen.

causing the recovery daemon to fail to detect that a recovery was needed to recover access to the database.

BZ63951

server/ctdb_control.c

index a87855030951b9f9dddaebaa907e93774b0fba3a..ed7324cfcc6b3ddae26fe6fbd88acdb19aa61e42 100644 (file)
@@ -162,7 +162,16 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
                return ctdb_control_push_db(ctdb, indata);
 
        case CTDB_CONTROL_GET_RECMODE: {
-               return ctdb->recovery_mode;
+               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;
        }
 
        case CTDB_CONTROL_SET_RECMASTER: {