[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Resizing of LMDB map



On 2018-11-13 09:59, hyc@highlandsun.com wrote:
> On Tue, Nov 13, 2018 at 07:09:08AM +0000, Daniel Kraft wrote:
>> On 2018-11-12 21:21, Howard Chu wrote:
>> Ah ok, so mdb_txn_commit also frees the transaction if it then actually
>> fails with MDB_MAP_FULL -- I was missing that.  By avoiding the
>> mdb_txn_abort in that case, my example code indeed works now!
>>
>> So is it correct to assume that the transaction is "effectively aborted"
>> after mdb_txn_commit fails with MDB_MAP_FULL (or, for that matter, any
>> error)?
>
> http://www.lmdb.tech/doc/group__mdb.html#ga846fbd6f46105617ac9f4d76476f6597
> 
> The doc is quite clear. After you call commit the txn is freed.

Yes, that part is clear (I just missed it before).

But the doc doesn't say anything about what happens to the transaction
data in case of an error.  I think it is quite reasonable to assume that
the transaction is fully aborted (as if mdb_txn_abort was called instead
of mdb_txn_commit) in case of an error (since otherwise transaction
atomicity would be violated), but I just wanted to check this is indeed
what happens.

Yours,
Daniel

-- 
https://www.domob.eu/
OpenPGP: 1142 850E 6DFF 65BA 63D6  88A8 B249 2AC4 A733 0737
Namecoin: id/domob -> https://nameid.org/?name=domob
--
3.6.0: Bar-Pri-Ran-Rog-Sam-Val-Wiz
To go: Arc-Cav-Hea-Kni-Mon-Tou

Attachment: signature.asc
Description: OpenPGP digital signature