ReadOnly: After recovering all databases, make sure to clear out the tracking databas...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 20 Jul 2011 03:20:32 +0000 (13:20 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 23 Aug 2011 00:24:44 +0000 (10:24 +1000)
server/ctdb_recover.c

index 38466ab56038bb398028b47e4acccf89e682de9a..71f9b6eec6f2a38e7e29f4b90166412d34e5f323 100644 (file)
@@ -489,6 +489,17 @@ int32_t ctdb_control_push_db(struct ctdb_context *ctdb, TDB_DATA indata)
        DEBUG(DEBUG_DEBUG,("finished push of %u records for dbid 0x%x\n",
                 reply->count, reply->db_id));
 
+       if (ctdb_db->readonly) {
+               DEBUG(DEBUG_CRIT,("Clearing the tracking database for dbid 0x%x\n",
+                                 ctdb_db->db_id));
+               if (tdb_wipe_all(ctdb_db->rottdb) != 0) {
+                       DEBUG(DEBUG_ERR,("Failed to wipe tracking database for 0x%x. Dropping read-only delegation support\n", ctdb_db->db_id));
+                       ctdb_db->readonly = false;
+                       tdb_close(ctdb_db->rottdb);
+                       ctdb_db->rottdb = NULL;
+               }
+       }
+
        ctdb_lock_all_databases_unmark(ctdb, ctdb_db->priority);
        return 0;