Commit 0e926701 authored by Rich Prohaska's avatar Rich Prohaska

the node size counter gets out of sync with reality. programs assert

during serialization to the disk when the real size is smaller than the
node size counter. so we are going to recompute the node size when
the node is being serialized.


addresses #676


git-svn-id: file:///svn/tokudb@3384 c7de825b-a66e-492c-adef-691d508d4ae1
parent b58a413b
......@@ -65,7 +65,7 @@ static unsigned int toku_serialize_brtnode_size_slow(BRTNODE node) {
LEAFENTRY le=vdata;
hsize+= PMA_ITEM_OVERHEAD + leafentry_disksize(le);
}));
assert(hsize==node->u.l.n_bytes_in_buffer);
assert(hsize<=node->u.l.n_bytes_in_buffer);
hsize+=4; /* the PMA size */
hsize+=4; /* add n entries in buffer table. */
return size+hsize;
......@@ -87,11 +87,17 @@ unsigned int toku_serialize_brtnode_size (BRTNODE node) {
result+=(4 /* n_entries in buffer table. */
+4); /* the pma size */
result+=node->u.l.n_bytes_in_buffer;
#if 0
if (toku_memory_check) {
unsigned int slowresult = toku_serialize_brtnode_size_slow(node);
if (result!=slowresult) printf("%s:%d result=%d slowresult=%d\n", __FILE__, __LINE__, result, slowresult);
assert(result==slowresult);
}
#else
unsigned int slowresult = toku_serialize_brtnode_size_slow(node);
if (result != slowresult)
result = slowresult;
#endif
}
return result;
}
......
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