vaccum: clear the fast-path vacuuming delete_queue after creating the vacuuming child.
authorMichael Adam <obnox@samba.org>
Fri, 17 Dec 2010 00:53:25 +0000 (01:53 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 9 Mar 2011 23:37:00 +0000 (00:37 +0100)
Maybe we should keep a copy for the case that the vacuuming fails?

server/ctdb_vacuum.c

index e5b3cd5e22788a199324048012da0775d1d99a5e..363954773872b7c4f610e7a11a31d2c4c7aae64c 100644 (file)
@@ -908,6 +908,17 @@ ctdb_vacuum_event(struct event_context *ev, struct timed_event *te,
        DLIST_ADD(ctdb->vacuumers, child_ctx);
        talloc_set_destructor(child_ctx, vacuum_child_destructor);
 
+       /*
+        * Clear the fastpath vacuuming list in the parent.
+        */
+       talloc_free(ctdb_db->delete_queue);
+       ctdb_db->delete_queue = trbt_create(ctdb_db, 0);
+       if (ctdb_db->delete_queue == NULL) {
+               /* fatal here? ... */
+               ctdb_fatal(ctdb, "Out of memory when re-creating vacuum tree "
+                                "in parent context. Shutting down\n");
+       }
+
        event_add_timed(ctdb->ev, child_ctx,
                timeval_current_ofs(ctdb->tunable.vacuum_max_run_time, 0),
                vacuum_child_timeout, child_ctx);