lib ldb: lmdb clear stale readers on write txn start
authorGary Lockyer <gary@catalyst.net.nz>
Sun, 29 Mar 2020 23:08:30 +0000 (12:08 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 31 Mar 2020 01:26:07 +0000 (01:26 +0000)
commit89041a6d18a1d091ea713e6986cac5ca66c2b481
treeafd103e97ec44383e71d34f4296445f1cef52046
parent1cc250b46e932511b878fd66bb9014b15dcaffaa
lib ldb: lmdb clear stale readers on write txn start

In use process failures and Bind9 shut downs leave stale entries in the
lmdb reader table.  This can result in lmdb filling it's database file, as
the free list can not be reclaimed due to the stale reader.

In this fix we call mdb_reader_check at the start of each transaction,
to free any stale readers.  As the default maximum number of readers is
127, this should not impact on performance to any great extent.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14330

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Mar 31 01:26:07 UTC 2020 on sn-devel-184
lib/ldb/ldb_mdb/ldb_mdb.c
lib/ldb/tests/ldb_lmdb_free_list_test.c