Ken Wenzel wrote:
> Thank you for the quick response. But this means that also READ transactions
> must be closed/reset before using mdb_env_set_mapsize?

The documentation is quite explicit. No active transactions.

> It is not enough to lock any readers while calling mdb_env_set_mapsize?
> Would it be hard to support resyncing read transactions and cursors after a
> map resize directly in the LMDB library?

Not a goal for LMDB. The documented way to use LMDB is to set the size once
at env creation time.
> 
> Thank you and best regards,
> Ken 
> 
> -----Ursprüngliche Nachricht-----
> Von: Howard Chu <[email protected]> 
> Gesendet: Montag, 31. Januar 2022 17:42
> An: Ken Wenzel <[email protected]>; [email protected]
> Betreff: Re: [LMDB] mdb_env_set_mapsize and read transactions
> 
> 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.
> 
> 
> --
>   -- Howard Chu
>   CTO, Symas Corp.           http://www.symas.com
>   Director, Highland Sun     http://highlandsun.com/hyc/
>   Chief Architect, OpenLDAP  http://www.openldap.org/project/
> 
> 


-- 
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/

Reply via email to