From: Andrew Tridgell Date: Tue, 16 Dec 2008 03:41:21 +0000 (+1100) Subject: repack the ldb after re-indexing X-Git-Tag: samba-4.0.0alpha6~475 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4380a374c1dec46ad77939604e548f0c79d9e2ec;p=thirdparty%2Fsamba.git repack the ldb after re-indexing re-indexing in ldb is triggered on any modification to the @ATTRIBUTES or @INDEXLIST records. This happens to produce a worst-case fragmentation of the database, as all @INDEX records are deleted then re-created. By repacking after re-indexing we ensure that the database ends up without extreme fragmentation. --- diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c index 65711d9f4b9..eedbda41706 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_index.c +++ b/source4/lib/ldb/ldb_tdb/ldb_index.c @@ -1250,5 +1250,9 @@ int ltdb_reindex(struct ldb_module *module) return LDB_ERR_OPERATIONS_ERROR; } + if (tdb_repack(ltdb->tdb) != 0) { + return LDB_ERR_OPERATIONS_ERROR; + } + return LDB_SUCCESS; }