ldb key_value: Add batch_mode option
authorGary Lockyer <gary@catalyst.net.nz>
Tue, 2 Jul 2019 00:30:44 +0000 (12:30 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 4 Jul 2019 10:02:23 +0000 (10:02 +0000)
commit652258768ae82f62a5b64464ca52252a7796fbdc
tree4d187a776ea959b3fc3a7dea3d9ed332e72d0f4c
parent7d17dbd10eb203bd48183fd3527165f244bbf4c4
ldb key_value: Add batch_mode option

When performing a join the overhead of the sub transactions protecting
key value operations becomes significant.  This commit adds a new
"batch_mode" option that disables the sub transactions around key value
operations.

The operation level index cache is also disabled, which means the
overall transaction level index cache can become inconsistent if an
operation fails. To protect against this and other possible on disk
inconsistencies, if any operation fails during a batch_mode
transaction the commit will fail and transaction will be rolled back.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/ldb_key_value/ldb_kv.c
lib/ldb/ldb_key_value/ldb_kv.h