diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-12-16 14:41:21 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-12-16 14:41:21 +1100 |
commit | 4380a374c1dec46ad77939604e548f0c79d9e2ec (patch) | |
tree | 46c8de27072521a4c20428c0a2b151cf8db23cdb /source4/lib | |
parent | f320e3a659d2ef701e3770071375ca9781d98325 (diff) | |
download | samba-4380a374c1dec46ad77939604e548f0c79d9e2ec.tar.gz samba-4380a374c1dec46ad77939604e548f0c79d9e2ec.tar.bz2 samba-4380a374c1dec46ad77939604e548f0c79d9e2ec.zip |
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.
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_index.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c index 65711d9f4b..eedbda4170 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; } |