summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-11-25 13:55:20 +0100
committerMichael Adam <obnox@samba.org>2011-11-26 00:34:57 +0100
commit0c1e98c9b072a6f3aba2d7f967e8853091d54d4f (patch)
treef92bf8c5a938aaa88d87529168ab056672ec9bd2
parenta4988be457a440362c48a87da4cfb6651273d14f (diff)
downloadsamba-0c1e98c9b072a6f3aba2d7f967e8853091d54d4f.tar.gz
samba-0c1e98c9b072a6f3aba2d7f967e8853091d54d4f.tar.xz
samba-0c1e98c9b072a6f3aba2d7f967e8853091d54d4f.zip
vacuum: write a big and up-to-date explaining comment for ctdb_vacuum_db()
(This used to be ctdb commit 6b9d308985ef2363c62fde6340ad37d56f6d7702)
-rw-r--r--ctdb/server/ctdb_vacuum.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/ctdb/server/ctdb_vacuum.c b/ctdb/server/ctdb_vacuum.c
index 322d1b34ba..e30b6e857b 100644
--- a/ctdb/server/ctdb_vacuum.c
+++ b/ctdb/server/ctdb_vacuum.c
@@ -435,11 +435,37 @@ done:
return 0;
}
-/*
- * read-only traverse the database in order to find
- * records that can be deleted and try to delete these
- * records on the other nodes
- * this executes in the child context
+/**
+ * Vacuum a DB:
+ * - Always do the fast vacuuming run, which traverses
+ * the in-memory delete queue: these records have been
+ * scheduled for deletion.
+ * - Only if explicitly requested, the database is traversed
+ * in order to use the traditional heuristics on empty records
+ * to trigger deletion.
+ * This is done only every VacuumFastPathCount'th vacuuming run.
+ *
+ * The traverse runs fill two lists:
+ *
+ * - The delete_list:
+ * This is the list of empty records the current
+ * node is lmaster and dmaster for. These records are later
+ * deleted first on other nodes and then locally.
+ *
+ * The fast vacuuming run has a short cut for those records
+ * that have never been migrated with data: these records
+ * are immediately deleted locally, since they have left
+ * no trace on other nodes.
+ *
+ * - The vacuum_fetch lists
+ * (one for each other lmaster node):
+ * The records in this list are sent for deletion to
+ * their lmaster in a bulk VACUUM_FETCH message.
+ *
+ * The lmaster then migrates all these records to itelf
+ * so that they can be vacuumed there.
+ *
+ * This executes in the child context.
*/
static int ctdb_vacuum_db(struct ctdb_db_context *ctdb_db,
struct vacuum_data *vdata,