Ken Wenzel wrote:
Hello,
I like to implement an autogrow functionality for LMDB.
The documentation for mdb_env_set_mapsize says that no transactions should be active when using this function.
When looking at the code I can see that the function only checks if there is an active WRITE transaction and in this case it returns an error.
Is it possible to reuse existing READ transactions or even associated cursors after mdb_env_set_mapsize has been called?
Yes, you can reuse the existing structures as long as you have done txn_reset / txn_renew / cursor_renew. Naturally you must do txn_reset before the resize, otherwise the read txn is still active.