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>
Tue, 25 May 2010 02:45:54 +0000 (12:45 +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 b0c094950711e43536d51d9cf0afec07665aea9a..3cd79f1ad80c9c78ed2a2fcccde84c15d3819128 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: {