lib ldb key value: fix index buffering
authorGary Lockyer <gary@catalyst.net.nz>
Wed, 6 Mar 2019 02:28:45 +0000 (15:28 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 21 Jun 2019 04:27:13 +0000 (04:27 +0000)
commitb6b5b5fe355fee2a4096e9214831cb88c7a2a4c6
tree441343c7c0f3d1f413067876f2854a9e28830aff
parent1a52b03b2f4c1503b52784f1a01f8291b78e7604
lib ldb key value: fix index buffering

As a performance enhancement the key value layer maintains a cache of
the index records, which is written to disk as part of a prepare commit.
This patch adds an extra cache at the operation layer to ensure that the
cached indexes remain consistent in the event of an operation failing.

Add test to test for index corruption in a failed modify.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/ldb_key_value/ldb_kv.c
lib/ldb/ldb_key_value/ldb_kv.h
lib/ldb/ldb_key_value/ldb_kv_index.c
lib/ldb/tests/python/api.py