Commit a761fd63 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5367 fix verify to work with marked messages

git-svn-id: file:///svn/toku/tokudb@46852 c7de825b-a66e-492c-adef-691d508d4ae1
parent 35face2a
...@@ -127,10 +127,8 @@ struct verify_message_tree_extra { ...@@ -127,10 +127,8 @@ struct verify_message_tree_extra {
int keep_going_on_failure; int keep_going_on_failure;
}; };
// template-only function, but must be extern __attribute__((nonnull(3)))
int verify_message_tree(const int32_t &offset, const uint32_t UU(idx), struct verify_message_tree_extra *const e) static int verify_message_tree(const int32_t &offset, const uint32_t UU(idx), struct verify_message_tree_extra *const e)
__attribute__((nonnull(3)));
int verify_message_tree(const int32_t &offset, const uint32_t UU(idx), struct verify_message_tree_extra *const e)
{ {
int verbose = e->verbose; int verbose = e->verbose;
BLOCKNUM blocknum = e->blocknum; BLOCKNUM blocknum = e->blocknum;
...@@ -144,8 +142,10 @@ int verify_message_tree(const int32_t &offset, const uint32_t UU(idx), struct ve ...@@ -144,8 +142,10 @@ int verify_message_tree(const int32_t &offset, const uint32_t UU(idx), struct ve
VERIFY_ASSERTION(ft_msg_type_applies_once((enum ft_msg_type) entry->type), VERIFY_ASSERTION(ft_msg_type_applies_once((enum ft_msg_type) entry->type),
e->i, "message found in fresh or stale message tree that does not apply once"); e->i, "message found in fresh or stale message tree that does not apply once");
if (e->is_fresh) { if (e->is_fresh) {
VERIFY_ASSERTION(entry->is_fresh, // Disabling this assert because of
e->i, "message found in fresh message tree that is not fresh"); // marked messages in the fresh tree
//VERIFY_ASSERTION(entry->is_fresh,
// e->i, "message found in fresh message tree that is not fresh");
} else { } else {
VERIFY_ASSERTION(!entry->is_fresh, VERIFY_ASSERTION(!entry->is_fresh,
e->i, "message found in stale message tree that is fresh"); e->i, "message found in stale message tree that is fresh");
...@@ -155,6 +155,19 @@ int verify_message_tree(const int32_t &offset, const uint32_t UU(idx), struct ve ...@@ -155,6 +155,19 @@ int verify_message_tree(const int32_t &offset, const uint32_t UU(idx), struct ve
return result; return result;
} }
__attribute__((nonnull(3)))
static int verify_marked_messages(const int32_t &offset, const uint32_t UU(idx), struct verify_message_tree_extra *const e)
{
int verbose = e->verbose;
BLOCKNUM blocknum = e->blocknum;
int keep_going_on_failure = e->keep_going_on_failure;
int result = 0;
const struct fifo_entry *entry = toku_fifo_get_entry(e->fifo, offset);
VERIFY_ASSERTION(!entry->is_fresh, e->i, "marked message found in the fresh message tree that is fresh");
done:
return result;
}
template<typename verify_omt_t> template<typename verify_omt_t>
static int static int
verify_sorted_by_key_msn(FT_HANDLE brt, FIFO fifo, const verify_omt_t &mt) { verify_sorted_by_key_msn(FT_HANDLE brt, FIFO fifo, const verify_omt_t &mt) {
...@@ -294,14 +307,19 @@ toku_verify_ftnode (FT_HANDLE brt, ...@@ -294,14 +307,19 @@ toku_verify_ftnode (FT_HANDLE brt,
count = count_eq_key_msn(brt, bnc->buffer, bnc->fresh_message_tree, toku_fill_dbt(&keydbt, key, keylen), msn); count = count_eq_key_msn(brt, bnc->buffer, bnc->fresh_message_tree, toku_fill_dbt(&keydbt, key, keylen), msn);
if (is_fresh) { if (is_fresh) {
VERIFY_ASSERTION(count == 1, i, "a fresh message was not found in the fresh message tree"); VERIFY_ASSERTION(count == 1, i, "a fresh message was not found in the fresh message tree");
assert(count == 1);
} else { } else {
VERIFY_ASSERTION(count == 0, i, "a stale message was found in the fresh message tree"); // Disabling this assert because of
// marked messages in the fresh tree
//VERIFY_ASSERTION(count == 0, i, "a stale message was found in the fresh message tree");
} }
count = count_eq_key_msn(brt, bnc->buffer, bnc->stale_message_tree, &keydbt, msn); count = count_eq_key_msn(brt, bnc->buffer, bnc->stale_message_tree, &keydbt, msn);
if (is_fresh) { if (is_fresh) {
VERIFY_ASSERTION(count == 0, i, "a fresh message was found in the stale message tree"); VERIFY_ASSERTION(count == 0, i, "a fresh message was found in the stale message tree");
} else { } else {
VERIFY_ASSERTION(count == 1, i, "a stale message was not found in the stale message tree"); // Disabling this assert because of
// marked messages in the fresh tree
//VERIFY_ASSERTION(count == 1, i, "a stale message was not found in the stale message tree");
} }
} else { } else {
VERIFY_ASSERTION(ft_msg_type_applies_all(type) || ft_msg_type_does_nothing(type), i, "a message was found that does not apply either to all or to only one key"); VERIFY_ASSERTION(ft_msg_type_applies_all(type) || ft_msg_type_does_nothing(type), i, "a message was found that does not apply either to all or to only one key");
...@@ -317,6 +335,8 @@ toku_verify_ftnode (FT_HANDLE brt, ...@@ -317,6 +335,8 @@ toku_verify_ftnode (FT_HANDLE brt,
extra.is_fresh = false; extra.is_fresh = false;
r = bnc->stale_message_tree.iterate<struct verify_message_tree_extra, verify_message_tree>(&extra); r = bnc->stale_message_tree.iterate<struct verify_message_tree_extra, verify_message_tree>(&extra);
if (r != 0) { result = r; goto done; } if (r != 0) { result = r; goto done; }
r = bnc->fresh_message_tree.iterate_over_marked<struct verify_message_tree_extra, verify_marked_messages>(&extra);
if (r != 0) { result = r; goto done; }
extra.broadcast = true; extra.broadcast = true;
r = bnc->broadcast_list.iterate<struct verify_message_tree_extra, verify_message_tree>(&extra); r = bnc->broadcast_list.iterate<struct verify_message_tree_extra, verify_message_tree>(&extra);
if (r != 0) { result = r; goto done; } if (r != 0) { result = r; goto done; }
......
...@@ -890,7 +890,7 @@ static int UU() verify_op(DB_TXN* UU(txn), ARG UU(arg), void* UU(operation_extra ...@@ -890,7 +890,7 @@ static int UU() verify_op(DB_TXN* UU(txn), ARG UU(arg), void* UU(operation_extra
int r = 0; int r = 0;
for (int i = 0; i < arg->cli->num_DBs; i++) { for (int i = 0; i < arg->cli->num_DBs; i++) {
DB* db = arg->dbp[i]; DB* db = arg->dbp[i];
r = db->verify_with_progress(db, NULL, NULL, 0, 0); r = db->verify_with_progress(db, NULL, NULL, 1, 0);
CKERR(r); CKERR(r);
} }
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