mirror of
https://github.com/isar/libmdbx.git
synced 2025-02-02 05:58:22 +08:00
mdbx: double dirtyroom reserve for page stack.
Related to https://github.com/erthink/libmdbx/issues/186 Change-Id: I211fc9c849c9a45254e699d713475898fd20a58e
This commit is contained in:
parent
4111d7238c
commit
7d249c97ad
@ -5326,7 +5326,10 @@ static int mdbx_cursor_spill(MDBX_cursor *mc, const MDBX_val *key,
|
|||||||
if (mc->mc_dbi > MAIN_DBI)
|
if (mc->mc_dbi > MAIN_DBI)
|
||||||
need += txn->mt_dbs[MAIN_DBI].md_depth + 3;
|
need += txn->mt_dbs[MAIN_DBI].md_depth + 3;
|
||||||
}
|
}
|
||||||
/* 4) Factor the key+data which to be put in */
|
/* 4) Double the page chain estimation
|
||||||
|
* for extensively splitting, rebalance and merging */
|
||||||
|
need += need;
|
||||||
|
/* 5) Factor the key+data which to be put in */
|
||||||
need += bytes2pgno(txn->mt_env, node_size(key, data)) + 1;
|
need += bytes2pgno(txn->mt_env, node_size(key, data)) + 1;
|
||||||
return mdbx_txn_spill(txn, mc, need);
|
return mdbx_txn_spill(txn, mc, need);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user