Commit 3a504883 authored by John Esmet's avatar John Esmet Committed by Yoni Fogel

fixes #5920 check that deserialization succeeded before attempting to use the...

fixes #5920 check that deserialization succeeded before attempting to use the ftnode for updating stats


git-svn-id: file:///svn/toku/tokudb@52380 c7de825b-a66e-492c-adef-691d508d4ae1
parent fe919603
...@@ -1720,7 +1720,9 @@ deserialize_ftnode_header_from_rbuf_if_small_enough (FTNODE *ftnode, ...@@ -1720,7 +1720,9 @@ deserialize_ftnode_header_from_rbuf_if_small_enough (FTNODE *ftnode,
r = 0; r = 0;
cleanup: cleanup:
toku_ft_status_update_deserialize_times(node, deserialize_time, decompress_time); if (r == 0) {
toku_ft_status_update_deserialize_times(node, deserialize_time, decompress_time);
}
if (r != 0) { if (r != 0) {
if (node) { if (node) {
toku_free(*ndd); toku_free(*ndd);
...@@ -2386,11 +2388,11 @@ deserialize_ftnode_from_rbuf( ...@@ -2386,11 +2388,11 @@ deserialize_ftnode_from_rbuf(
r = 0; r = 0;
cleanup: cleanup:
if (r == 0) {
t1 = toku_time_now(); t1 = toku_time_now();
deserialize_time = (t1 - t0) - decompress_time; deserialize_time = (t1 - t0) - decompress_time;
toku_ft_status_update_deserialize_times(node, deserialize_time, decompress_time); toku_ft_status_update_deserialize_times(node, deserialize_time, decompress_time);
}
if (r != 0) { if (r != 0) {
// NOTE: Right now, callers higher in the stack will assert on // NOTE: Right now, callers higher in the stack will assert on
// failure, so this is OK for production. However, if we // failure, so this is OK for production. However, if we
...@@ -2400,7 +2402,6 @@ cleanup: ...@@ -2400,7 +2402,6 @@ cleanup:
toku_free(node); toku_free(node);
} }
} }
return r; return r;
} }
......
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