Commit bc99f40d authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:3756] closes #3756 Fix dict_id to be 64 bits.

git-svn-id: file:///svn/toku/tokudb@33045 c7de825b-a66e-492c-adef-691d508d4ae1
parent 4f203954
...@@ -557,7 +557,7 @@ brtnode_memory_size (BRTNODE node) ...@@ -557,7 +557,7 @@ brtnode_memory_size (BRTNODE node)
static uint64_t dict_id_serial = 1; static uint64_t dict_id_serial = 1;
static DICTIONARY_ID static DICTIONARY_ID
next_dict_id(void) { next_dict_id(void) {
uint32_t i = toku_sync_fetch_and_increment_uint64(&dict_id_serial); uint64_t i = toku_sync_fetch_and_increment_uint64(&dict_id_serial);
assert(i); // guarantee unique dictionary id by asserting 64-bit counter never wraps assert(i); // guarantee unique dictionary id by asserting 64-bit counter never wraps
DICTIONARY_ID d = {.dictid = i}; DICTIONARY_ID d = {.dictid = i};
return d; return d;
...@@ -1818,7 +1818,7 @@ static int do_update(BRT t, BASEMENTNODE bn, SUBTREE_EST se, BRT_MSG cmd, int id ...@@ -1818,7 +1818,7 @@ static int do_update(BRT t, BASEMENTNODE bn, SUBTREE_EST se, BRT_MSG cmd, int id
return r; return r;
} }
// should be static, but used by test program(s) // Should be renamed as something like "apply_cmd_to_basement()."
static void static void
brt_leaf_put_cmd ( brt_leaf_put_cmd (
BRT t, BRT t,
...@@ -2957,6 +2957,8 @@ static void push_something_at_root (BRT brt, BRTNODE *nodep, BRT_MSG cmd) ...@@ -2957,6 +2957,8 @@ static void push_something_at_root (BRT brt, BRTNODE *nodep, BRT_MSG cmd)
node->dirty = 1; node->dirty = 1;
MSN cmd_msn = cmd->msn; MSN cmd_msn = cmd->msn;
invariant(cmd_msn.msn > node->max_msn_applied_to_node_on_disk.msn); invariant(cmd_msn.msn > node->max_msn_applied_to_node_on_disk.msn);
// max_msn_applied_to_node_on_disk is normally set only when leaf is serialized,
// but needs to be done here (for root leaf) so msn can be set in new commands.
node->max_msn_applied_to_node_on_disk = cmd_msn; node->max_msn_applied_to_node_on_disk = cmd_msn;
} else { } else {
brtnode_nonleaf_put_cmd_at_root(brt, node, cmd); brtnode_nonleaf_put_cmd_at_root(brt, node, cmd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment