mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
Hacked fix for #832. Don't promote unless there's space for a max pivot key.
git-svn-id: file:///svn/tokudb@4105 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
f60c54cad0
commit
fbc83b1cda
1 changed files with 4 additions and 1 deletions
|
@ -652,6 +652,9 @@ static int brtnode_put_cmd (BRT t, BRTNODE node, BRT_CMD cmd,
|
|||
DBT *split,
|
||||
TOKULOGGER);
|
||||
|
||||
// The maximum row size is 16KB according to the PRD. That means the max pivot key size is 16KB.
|
||||
#define MAX_PIVOT_KEY_SIZE (1<<14)
|
||||
|
||||
/* key is not in the buffer. Either put the key-value pair in the child, or put it in the node. */
|
||||
static int push_brt_cmd_down_only_if_it_wont_push_more_else_put_here (BRT t, BRTNODE node, BRTNODE child,
|
||||
BRT_CMD cmd,
|
||||
|
@ -661,7 +664,7 @@ static int push_brt_cmd_down_only_if_it_wont_push_more_else_put_here (BRT t, BRT
|
|||
DBT *k = cmd->u.id.key;
|
||||
DBT *v = cmd->u.id.val;
|
||||
unsigned int oldsize = toku_serialize_brtnode_size(child);
|
||||
unsigned int newsize_bounded = oldsize + k->size + v->size + KEY_VALUE_OVERHEAD + LE_OVERHEAD_BOUND;
|
||||
unsigned int newsize_bounded = oldsize + k->size + v->size + KEY_VALUE_OVERHEAD + LE_OVERHEAD_BOUND + MAX_PIVOT_KEY_SIZE;
|
||||
newsize_bounded += (child->height > 0) ? BRT_CMD_OVERHEAD : OMT_ITEM_OVERHEAD;
|
||||
|
||||
int to_child = newsize_bounded <= child->nodesize;
|
||||
|
|
Loading…
Add table
Reference in a new issue