summaryrefslogtreecommitdiff
path: root/lib/ldb
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2013-01-01 20:57:25 -0800
committerAndrew Bartlett <abartlet@samba.org>2013-05-20 15:47:32 +0200
commit96f972460ca458e86edbd97c682bfa462e01a242 (patch)
treef10df2facbcbcdcdc03f2cd1e81870e64455d789 /lib/ldb
parent74fa70cdece0aabf86f8d70e4b48268d48879b9e (diff)
downloadsamba-96f972460ca458e86edbd97c682bfa462e01a242.tar.gz
samba-96f972460ca458e86edbd97c682bfa462e01a242.tar.bz2
samba-96f972460ca458e86edbd97c682bfa462e01a242.zip
ldb_tdb: Warn when reindexing is done
Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon May 20 15:47:33 CEST 2013 on sn-devel-104
Diffstat (limited to 'lib/ldb')
-rw-r--r--lib/ldb/ldb_tdb/ldb_tdb.c12
-rw-r--r--lib/ldb/ldb_tdb/ldb_tdb.h1
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/ldb/ldb_tdb/ldb_tdb.c b/lib/ldb/ldb_tdb/ldb_tdb.c
index 4fb151622a..30c58f5ee3 100644
--- a/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -229,7 +229,13 @@ static int ltdb_modified(struct ldb_module *module, struct ldb_dn *dn)
if (ldb_dn_is_special(dn) &&
(ldb_dn_check_special(dn, LTDB_INDEXLIST) ||
- ldb_dn_check_special(dn, LTDB_ATTRIBUTES)) ) {
+ ldb_dn_check_special(dn, LTDB_ATTRIBUTES)) )
+ {
+ if (ltdb->warn_reindex) {
+ ldb_debug(ldb_module_get_ctx(module),
+ LDB_DEBUG_ERROR, "Reindexing %s due to modification on %s",
+ tdb_name(ltdb->tdb), ldb_dn_get_linearized(dn));
+ }
ret = ltdb_reindex(module);
}
@@ -1565,6 +1571,10 @@ static int ltdb_connect(struct ldb_context *ldb, const char *url,
ltdb->warn_unindexed = true;
}
+ if (getenv("LDB_WARN_REINDEX")) {
+ ltdb->warn_reindex = true;
+ }
+
ltdb->sequence_number = 0;
module = ldb_module_new(ldb, ldb, "ldb_tdb backend", &ltdb_ops);
diff --git a/lib/ldb/ldb_tdb/ldb_tdb.h b/lib/ldb/ldb_tdb/ldb_tdb.h
index b9aa36caaa..35218000eb 100644
--- a/lib/ldb/ldb_tdb/ldb_tdb.h
+++ b/lib/ldb/ldb_tdb/ldb_tdb.h
@@ -32,6 +32,7 @@ struct ltdb_private {
int read_lock_count;
bool warn_unindexed;
+ bool warn_reindex;
};
struct ltdb_context {