ldb tests: Confirm lmdb free list handling
authorGary Lockyer <gary@catalyst.net.nz>
Mon, 16 Mar 2020 02:18:12 +0000 (15:18 +1300)
committerKarolin Seeger <kseeger@samba.org>
Thu, 14 May 2020 07:25:44 +0000 (07:25 +0000)
commit2b8faefabb49e6823762fe1d0ae26ff6f54f8319
tree270af0d5e8132dcf7e327819ff32b101cb75c4ba
parentf6468de046e93dc45d4bcc76dc27daef75a0152d
ldb tests: Confirm lmdb free list handling

Add cmocka tests to confirm lmdb's handling of the free list.

As a result of lmdb's MVCC (Multiversion Concurrency Control) long
running read transactions or stale readers (read transactions where the
process exited without ending the transaction) can cause the database to
run out of space.

Items in the free list are only reused when they would not be visible in
a read transaction.  So long running read transactions prevent entries
in the free list being reused, and the database can run out of space.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit fc13304d1575ad6bc6e04cdb3eedf46d3c3678c7)
lib/ldb/tests/ldb_lmdb_free_list_test.c [new file with mode: 0644]
lib/ldb/wscript