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

Re: LMDB: issue with mdb_cursor_del

2017-10-20 16:34 GMT+03:00  <timur.kristof@gmail.com>:
> Hi Leonid,
>> 1) With MDB_WRITEMAP the mdb_mid2l_append() will be used.
>> Internally mdb_mid2l_append() don't check for duplicated, but just
>> append a given page number to the list.
>> Therefore when database opens with MDB_WRITEMAP this bug leads to
>> duplicates inside the dirty-list and then (seems) to database
>> corruption.
>> 2) Without MDB_WRITEMAP the mdb_mid2l_insert() will be used.
>> Internally mdb_mid2l_insert() made insertion into a sorted list, so
>> it
>> checks for duplicates and returns -1 for such case.
>> Therefore when database opens without MDB_WRITEMAP this bug leads
>> only
>> to assertion failure, or nothing if assertions checking was disabled.
> Yes, that's exactly what I said.
> That simply allowing -1 would fix the problem for the non-writemap
> case, because then there is no duplicate. Right?

Yes, obvious.