mdbx: backport - ITS#8336 fix page_search_root assert on FreeDB.

Let "illegal" branch pages thru on the FreeDB - the condition
is only temporary and will be fixed by the time rebalance finishes.

Change-Id: I5d34fd96096f88638db55166aba7194dcef7e429
This commit is contained in:
Howard Chu 2015-12-08 18:17:24 +00:00 committed by Leo Yuriev
parent 4fcbaa44f3
commit 3df7c4b1e1

6
mdb.c
View File

@ -5410,7 +5410,11 @@ mdb_page_search_root(MDB_cursor *mc, MDB_val *key, int flags)
indx_t i;
mdb_debug("branch page %zu has %u keys", mp->mp_pgno, NUMKEYS(mp));
mdb_cassert(mc, NUMKEYS(mp) > 1);
/* Don't assert on branch pages in the FreeDB. We can get here
* while in the process of rebalancing a FreeDB branch page; we must
* let that proceed. ITS#8336
*/
mdb_cassert(mc, !mc->mc_dbi || NUMKEYS(mp) > 1);
mdb_debug("found index 0 to page %zu", NODEPGNO(NODEPTR(mp, 0)));
if (flags & (MDB_PS_FIRST|MDB_PS_LAST)) {