Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Commit

Permalink
mdbx: fix wrong freeDB search.
Browse files Browse the repository at this point in the history
Avoid search freeDB while tree is updating.
Bug was inherited from LMDB.
#31
  • Loading branch information
erthink committed May 4, 2018
1 parent 2bccc85 commit 0c4b39b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,10 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp, int flags)
/* If mc is updating the freeDB, then the freelist cannot play
* catch-up with itself by growing while trying to save it. */
flags &= ~(MDBX_ALLOC_GC | MDBX_ALLOC_KICK | MDBX_COALESCE | MDBX_LIFORECLAIM);
} else if (unlikely(txn->mt_dbs[FREE_DBI].md_entries == 0)) {
/* avoid (recursive) search inside empty tree and while tree is updating,
* https://github.com/leo-yuriev/libmdbx/issues/31 */
flags &= ~MDBX_ALLOC_GC;
}
}

Expand Down

0 comments on commit 0c4b39b

Please sign in to comment.