ctdb-vacuum: remove VacuumLimit criterion for triggering a repack
authorMichael Adam <obnox@samba.org>
Fri, 14 Feb 2014 21:05:21 +0000 (22:05 +0100)
committerAmitay Isaacs <amitay@gmail.com>
Thu, 6 Mar 2014 00:31:14 +0000 (11:31 +1100)
With the new vacuuming, we consider it an error if there are
records left for deletion after processing the various lists.
All records that can be deleted should have been deleted by
tdb_delete calls.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_vacuum.c

index 137e8d67573b67e999216c6da0e1f3113b9c3594..24d8cf9ecef421098ebf7c3d73ca3fa6610fe9dd 100644 (file)
@@ -53,7 +53,6 @@ struct ctdb_vacuum_handle {
 
 /*  a list of records to possibly delete */
 struct vacuum_data {
-       uint32_t vacuum_limit;
        uint32_t repack_limit;
        struct ctdb_context *ctdb;
        struct ctdb_db_context *ctdb_db;
@@ -1428,7 +1427,6 @@ static int ctdb_vacuum_and_repack_db(struct ctdb_db_context *ctdb_db,
                                     bool full_vacuum_run)
 {
        uint32_t repack_limit = ctdb_db->ctdb->tunable.repack_limit;
-       uint32_t vacuum_limit = ctdb_db->ctdb->tunable.vacuum_limit;
        const char *name = ctdb_db->db_name;
        int freelist_size = 0;
        struct vacuum_data *vdata;
@@ -1440,7 +1438,6 @@ static int ctdb_vacuum_and_repack_db(struct ctdb_db_context *ctdb_db,
        }
 
        vdata->ctdb = ctdb_db->ctdb;
-       vdata->vacuum_limit = vacuum_limit;
        vdata->repack_limit = repack_limit;
        vdata->delete_list = trbt_create(vdata, 0);
        vdata->ctdb_db = ctdb_db;
@@ -1471,8 +1468,7 @@ static int ctdb_vacuum_and_repack_db(struct ctdb_db_context *ctdb_db,
        /*
         * decide if a repack is necessary
         */
-       if ((repack_limit == 0 || (uint32_t)freelist_size < repack_limit) &&
-           (vacuum_limit == 0 || vdata->delete_left < vacuum_limit))
+       if ((repack_limit == 0 || (uint32_t)freelist_size < repack_limit))
        {
                talloc_free(vdata);
                return 0;