ldb_tdb: Remove the idxptr DB before we re-index
authorAndrew Bartlett <abartlet@samba.org>
Fri, 9 Jun 2017 02:09:30 +0000 (14:09 +1200)
committerGarming Sam <garming@samba.org>
Wed, 14 Jun 2017 23:24:25 +0000 (01:24 +0200)
commitf6f73f70919e3360197713e378d49e6eecfe2f1c
tree8704405687e7efa9812f25133f616f921e8df2fe
parentd8f3034c163831c5143d95fd803b8c765bf5767f
ldb_tdb: Remove the idxptr DB before we re-index

We do not want the cache or any of the values in it, we want to read the real DB
@INDEX: records.

This matters if a re-index is tiggered in the same transaction
as the modify of the values in the index.  Otherwise we won't see
the old index record (it will not show up in the tdb_traverse)
and so fail to remove it.

That in turn can cause a spurious unqiue index violation.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
lib/ldb/ldb_tdb/ldb_index.c