mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-25 00:59:45 -05:00
ITS#7385, check further for bad splits
More for 48ef27b6f5
Our definition of "large" data item needs to be smaller to
handle more cases where a bad split is possible
This commit is contained in:
parent
ba6c3281a1
commit
0c4c6fe72a
1 changed files with 7 additions and 3 deletions
|
|
@ -6117,15 +6117,19 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno
|
|||
* This check is only needed when the data items are
|
||||
* relatively large, such that being off by one will
|
||||
* make the difference between success or failure.
|
||||
* When the size of the data items is much smaller than
|
||||
* one-half of a page, this check is irrelevant.
|
||||
*
|
||||
* It's also relevant if a page happens to be laid out
|
||||
* such that one half of its nodes are all "small" and
|
||||
* the other half of its nodes are "large." If the new
|
||||
* item is also "large" and falls on the half with
|
||||
* "large" nodes, it also may not fit.
|
||||
*/
|
||||
if (IS_LEAF(mp)) {
|
||||
unsigned int psize, nsize;
|
||||
/* Maximum free space in an empty page */
|
||||
pmax = mc->mc_txn->mt_env->me_psize - PAGEHDRSZ;
|
||||
nsize = mdb_leaf_size(mc->mc_txn->mt_env, newkey, newdata);
|
||||
if ((nkeys < 20) || (nsize > pmax/4)) {
|
||||
if ((nkeys < 20) || (nsize > pmax/16)) {
|
||||
if (newindx <= split_indx) {
|
||||
psize = nsize;
|
||||
newpos = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue