ldb_tdb: Update comments for the delete_index() pass of ltdb_reindex()
authorAndrew Bartlett <abartlet@samba.org>
Mon, 11 Sep 2017 10:00:40 +0000 (22:00 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 22 Sep 2017 19:20:25 +0000 (21:20 +0200)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
lib/ldb/ldb_tdb/ldb_index.c

index 621d819ae8e95d5fe4fffca90f307defd60fa671..566372380f8546fd8ba7fa91039e4e27218dfdda 100644 (file)
@@ -2224,7 +2224,12 @@ int ltdb_index_delete(struct ldb_module *module, const struct ldb_message *msg)
 
 
 /*
-  traversal function that deletes all @INDEX records
+  traversal function that deletes all @INDEX records in the in-memory
+  TDB.
+
+  This does not touch the actual DB, that is done at transaction
+  commit, which in turn greatly reduces DB churn as we will likely
+  be able to do a direct update into the old record.
 */
 static int delete_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *state)
 {
@@ -2249,6 +2254,11 @@ static int delete_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, vo
        v.length = strnlen((char *)key.dptr, key.dsize) - 3;
 
        dn = ldb_dn_from_ldb_val(ltdb, ldb_module_get_ctx(module), &v);
+
+       /*
+        * This does not actually touch the DB quite yet, just
+         * the in-memory index cache
+        */
        ret = ltdb_dn_list_store(module, dn, &list);
        if (ret != LDB_SUCCESS) {
                ldb_asprintf_errstring(ldb_module_get_ctx(module),