Commit 43675fa5 authored by Christian Rober's avatar Christian Rober Committed by Yoni Fogel

refs #5025 Fixed issue where the verification tool incorrectly decompresses old nodes.

git-svn-id: file:///svn/toku/tokudb@45679 c7de825b-a66e-492c-adef-691d508d4ae1
parent c3db83c9
......@@ -524,6 +524,11 @@ int toku_deserialize_bp_from_disk(FTNODE node, FTNODE_DISK_DATA ndd, int childnu
int toku_deserialize_bp_from_compressed(FTNODE node, int childnum, DESCRIPTOR desc, ft_compare_func cmp);
int toku_deserialize_ftnode_from (int fd, BLOCKNUM off, u_int32_t /*fullhash*/, FTNODE *ftnode, FTNODE_DISK_DATA* ndd, struct ftnode_fetch_extra* bfe);
// <CER> For verifying old, non-upgraded nodes (versions 13 and 14).
int
decompress_from_raw_block_into_rbuf(u_int8_t *raw_block, size_t raw_block_size, struct rbuf *rb, BLOCKNUM blocknum);
//
//////////////// <CER> TODO: Move these function declarations
int
deserialize_ft_from_fd_into_rbuf(int fd,
......
......@@ -2749,7 +2749,7 @@ deserialize_rollback_log_from_rbuf_versioned (u_int32_t version, BLOCKNUM blockn
return r;
}
static int
int
decompress_from_raw_block_into_rbuf(u_int8_t *raw_block, size_t raw_block_size, struct rbuf *rb, BLOCKNUM blocknum) {
toku_trace("decompress");
int r = 0;
......
......@@ -239,7 +239,16 @@ check_block(BLOCKNUM blocknum, int64_t UU(blocksize), int64_t UU(address), void
// of the nodes on disk does indeed change in the future.
if (version < FT_FIRST_LAYOUT_VERSION_WITH_BASEMENT_NODES)
{
r = check_old_node(node, &rb, version);
struct rbuf nrb;
// Use old decompression method for legacy nodes.
r = decompress_from_raw_block_into_rbuf(rb.buf, rb.size, &nrb, blocknum);
if (r != 0) {
failure++;
goto cleanup;
}
// Check the end-to-end checksum.
r = check_old_node(node, &nrb, version);
if (r != 0) {
failure++;
}
......
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