When wiping a database, clear the delete_queue.
authorMichael Adam <obnox@samba.org>
Fri, 17 Dec 2010 01:22:02 +0000 (02:22 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 9 Mar 2011 23:37:00 +0000 (00:37 +0100)
server/ctdb_freeze.c

index 86cb5edc120e5b2ff4f5838356eefe7b80482b93..0f70fd35023df539dceab412195cd741fed02a9c 100644 (file)
@@ -25,6 +25,7 @@
 #include "../include/ctdb_private.h"
 #include "lib/util/dlinklist.h"
 #include "db_wrap.h"
+#include "../common/rb_tree.h"
 
 static bool later_db(const char *name)
 {
@@ -605,5 +606,15 @@ int32_t ctdb_control_wipe_database(struct ctdb_context *ctdb, TDB_DATA indata)
                return -1;
        }
 
+       if (!ctdb_db->persistent) {
+               talloc_free(ctdb_db->delete_queue);
+               ctdb_db->delete_queue = trbt_create(ctdb_db, 0);
+               if (ctdb_db->delete_queue == NULL) {
+                       DEBUG(DEBUG_ERR, (__location__ " Failed to re-create "
+                                         "the vacuum tree.\n"));
+                       return -1;
+               }
+       }
+
        return 0;
 }