vacuum: traverse the delete_queue befor traversing the database.
authorMichael Adam <obnox@samba.org>
Mon, 20 Dec 2010 16:25:35 +0000 (17:25 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 9 Mar 2011 23:37:01 +0000 (00:37 +0100)
server/ctdb_vacuum.c

index 01887bda8ad41b94aded8f8971dbbb522607a491..c44c33badbfd8c49ec2572c23ce4206bea23131a 100644 (file)
@@ -410,6 +410,12 @@ static int ctdb_vacuum_db(struct ctdb_db_context *ctdb_db, struct vacuum_data *v
                vdata->list[i]->db_id = ctdb_db->db_id;
        }
 
+       /*
+        * Traverse the delete_queue.
+        * This builds the same lists as the db traverse.
+        */
+       trbt_traversearray32(ctdb_db->delete_queue, 1, delete_queue_traverse, vdata);
+
        /* read-only traverse, looking for records that might be able to be vacuumed */
        if (tdb_traverse_read(ctdb_db->ltdb->tdb, vacuum_traverse, vdata) == -1 ||
            vdata->traverse_error) {