repack limit tunable
authorWolfgang Mueller-Friedt <wolfmuel@de.ibm.com>
Tue, 28 Jul 2009 20:09:28 +0000 (23:09 +0300)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 29 Jul 2009 03:30:39 +0000 (13:30 +1000)
Signed-off-by: Wolfgang Mueller-Friedt <wolfmuel@de.ibm.com>
(This used to be ctdb commit a2768b0732f2ab2e3fafda55587bd2e99eedf0fa)

ctdb/include/ctdb_private.h
ctdb/server/ctdb_tunables.c
ctdb/server/ctdb_vacuum.c

index 0ddcb7918fab1ad23f673a62dbd256764ad29757..63e3d3889bc3321b8234dc9b1ab0b5c4e77cd82a 100644 (file)
@@ -110,6 +110,7 @@ struct ctdb_tunable {
        uint32_t verify_recovery_lock;
        uint32_t vacuum_default_interval;
        uint32_t vacuum_max_run_time;
+       uint32_t repack_limit;
 };
 
 /*
index 2d2580d6a1907a17f0417af4cf15e99d43d8a9e9..bdf86528d92f9b9cc9da307ea71e15e10a946cda 100644 (file)
@@ -57,7 +57,8 @@ static const struct {
        { "RecoveryDropAllIPs",  60,  offsetof(struct ctdb_tunable, recovery_drop_all_ips) },
        { "VerifyRecoveryLock",   1,  offsetof(struct ctdb_tunable, verify_recovery_lock) },
        { "VacuumDefaultInterval", 10,  offsetof(struct ctdb_tunable, vacuum_default_interval) },
-       { "VacuumMaxRunTime",      5,  offsetof(struct ctdb_tunable, vacuum_max_run_time) },
+       { "VacuumMaxRunTime",     5,  offsetof(struct ctdb_tunable, vacuum_max_run_time) },
+       { "RepackLimit",      10000,  offsetof(struct ctdb_tunable, repack_limit) },
 };
 
 /*
index a7587fd96d146f6818a77f11711a95d804a5b9a6..4188c854054c2f34a6717155543ef0d91f67b82b 100644 (file)
@@ -146,7 +146,7 @@ static int ctdb_repack_tdb(struct tdb_context *tdb, TALLOC_CTX *mem_ctx)
 
 static int ctdb_repack_db(struct ctdb_db_context *ctdb_db, TALLOC_CTX *mem_ctx)
 {
-       uint32_t repack_limit = 10000;   /* should be made tunable */
+       uint32_t repack_limit = ctdb_db->ctdb->tunable.repack_limit;
        const char *name = ctdb_db->db_name;
        int size = tdb_freelist_size(ctdb_db->ltdb->tdb);