mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
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
This commit is contained in:
parent
a7d60e5577
commit
98b45ab5cf
3 changed files with 26 additions and 12 deletions
|
@ -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_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);
|
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
|
//////////////// <CER> TODO: Move these function declarations
|
||||||
int
|
int
|
||||||
deserialize_ft_from_fd_into_rbuf(int fd,
|
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;
|
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) {
|
decompress_from_raw_block_into_rbuf(u_int8_t *raw_block, size_t raw_block_size, struct rbuf *rb, BLOCKNUM blocknum) {
|
||||||
toku_trace("decompress");
|
toku_trace("decompress");
|
||||||
int r = 0;
|
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.
|
// of the nodes on disk does indeed change in the future.
|
||||||
if (version < FT_FIRST_LAYOUT_VERSION_WITH_BASEMENT_NODES)
|
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) {
|
if (r != 0) {
|
||||||
failure++;
|
failure++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue