On 16. okt. 2017 13:43, Леонид Юрьев wrote:
This is a bug (seems minor), I fixed it in the MDBX few days ago. https://github.com/leo-yuriev/libmdbx/commit/9fd7056b4f02098914d813f38ba1ed2...
That's rather different from mdb.c. mdb's page_touch() does not mess with loose pages, for example.
Inside freelist_save() the mt_loose_pages could be merged into the mt_free_pgs. http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=libraries/l...
But at this point all loose_pages also still present in the mt_u.dirty_list. On the next loop inside freelist_save() a one more page could be requested, and page_alloc() could return a page which is already in the mt_u.dirty_list. In this case mdb_mid2l_insert() will return -1.
I don't understand you. page_alloc doesn't call mdb_mid2l_insert() for loose pages, since they are in dirty_list.
freelist_save() does mess with loose pages - are you saying it is doing it incorrectly? If so, that's what we need to fix.