mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-13 14:27:59 +08:00
Fix mdb_rebalance
Need to check NUMKEYS as well as fill threshold, when deciding whether to change anything. Don't let the page drop below the minimum number of keys.
This commit is contained in:
parent
14c5a5dff1
commit
0cccf79a02
@ -6295,6 +6295,7 @@ mdb_rebalance(MDB_cursor *mc)
|
||||
unsigned int ptop, minkeys;
|
||||
MDB_cursor mn;
|
||||
|
||||
minkeys = 1 + (IS_BRANCH(mc->mc_pg[mc->mc_top]));
|
||||
#if MDB_DEBUG
|
||||
{
|
||||
pgno_t pgno;
|
||||
@ -6305,7 +6306,8 @@ mdb_rebalance(MDB_cursor *mc)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (PAGEFILL(mc->mc_txn->mt_env, mc->mc_pg[mc->mc_top]) >= FILL_THRESHOLD) {
|
||||
if (PAGEFILL(mc->mc_txn->mt_env, mc->mc_pg[mc->mc_top]) >= FILL_THRESHOLD &&
|
||||
NUMKEYS(mc->mc_pg[mc->mc_top] >= minkeys)) {
|
||||
#if MDB_DEBUG
|
||||
pgno_t pgno;
|
||||
COPY_PGNO(pgno, mc->mc_pg[mc->mc_top]->mp_pgno);
|
||||
|
Loading…
Reference in New Issue
Block a user