Skip to content

Commit

Permalink
Properly release items in test cases that are got from tap streams
Browse files Browse the repository at this point in the history
==18786== 240 (144 direct, 96 indirect) bytes in 2 blocks are definitely lost in loss record 20 of 23
==18786==    at 0x4C285BC: operator new(unsigned long) (vg_replace_malloc.c:298)
==18786==    by 0x7D76331: StoredValue::toItem(bool, unsigned short) const (stored-value.cc:704)
==18786==    by 0x7D327D8: EventuallyPersistentStore::getInternal(...) (ep.cc:1843)
==18786==    by 0x7D7FE1B: TapProducer::getNextItem(...) (ep.h:268)
==18786==    by 0x7D4A45E: EventuallyPersistentEngine::walkTapQueue(...) (ep_engine.cc:2382)
==18786==    by 0x7D4A78E: EvpTapIterator (ep_engine.cc:1420)
==18786==    by 0x7036B18: test_tap_sends_deleted (ep_testsuite.cc:5976)
==18786==    by 0x4024C6: main (engine_testapp.c:1057)

Change-Id: Id62dbadafc6ebd07d62c4b976f8bc568b763ce7d
Reviewed-on: http://review.couchbase.org/48343
Reviewed-by: Manu Dhundi <manu@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
  • Loading branch information
mikewied authored and Michael Wiederhold committed Mar 17, 2015
1 parent 1e6ebcb commit 02ee4f2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/ep_testsuite.cc
Expand Up @@ -5984,9 +5984,11 @@ static enum test_result test_tap_sends_deleted(ENGINE_HANDLE *h, ENGINE_HANDLE_V
case TAP_DISCONNECT:
break;
case TAP_MUTATION:
h1->release(h, NULL, it);
num_mutations++;
break;
case TAP_DELETION:
h1->release(h, NULL, it);
num_deletes++;
break;
default:
Expand Down Expand Up @@ -6048,8 +6050,8 @@ static enum test_result test_sent_from_vb(ENGINE_HANDLE *h,
case TAP_DISCONNECT:
break;
case TAP_MUTATION:
break;
case TAP_DELETION:
h1->release(h, NULL, it);
break;
default:
std::cerr << "Unexpected event: " << event << std::endl;
Expand Down Expand Up @@ -6601,6 +6603,7 @@ static enum test_result test_tap_implicit_ack_stream(ENGINE_HANDLE *h, ENGINE_HA
} else {
if (event == TAP_MUTATION) {
++mutations;
h1->release(h, cookie, it);
}
if (seqno == static_cast<uint32_t>(4294967294UL)) {
testHarness.unlock_cookie(cookie);
Expand Down Expand Up @@ -6632,6 +6635,7 @@ static enum test_result test_tap_implicit_ack_stream(ENGINE_HANDLE *h, ENGINE_HA
} else {
if (event == TAP_MUTATION) {
++mutations;
h1->release(h, cookie, it);
}
if (seqno == 1) {
testHarness.unlock_cookie(cookie);
Expand Down Expand Up @@ -6664,6 +6668,7 @@ static enum test_result test_tap_implicit_ack_stream(ENGINE_HANDLE *h, ENGINE_HA
} else {
if (event == TAP_MUTATION) {
++mutations;
h1->release(h, cookie, it);
} else if (event == TAP_DISCONNECT) {
done = true;
}
Expand Down Expand Up @@ -11390,6 +11395,7 @@ static enum test_result test_est_vb_move(ENGINE_HANDLE *h,
break;
case TAP_CHECKPOINT_START:
case TAP_CHECKPOINT_END:
h1->release(h, NULL, it);
break;
case TAP_MUTATION:
case TAP_DELETION:
Expand All @@ -11405,6 +11411,7 @@ static enum test_result test_est_vb_move(ENGINE_HANDLE *h,
remaining = 10 - total_sent;
check(chk_items == remaining, "Invalid Estimate of chk items");
}
h1->release(h, NULL, it);
break;
default:
std::cerr << "Unexpected event: " << event << std::endl;
Expand Down

0 comments on commit 02ee4f2

Please sign in to comment.