mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-06-14 15:02:27 +03:00
Rollback and release streaming appliers in unit tests
Unit tests which cause streaming rollback leaked memory because the streaming applier handle which was created for rollback fragment handling was not released. Roll back a streaming transaction and release applier handle appropriately in corresponding tests.
This commit is contained in:
@ -1067,6 +1067,15 @@ BOOST_FIXTURE_TEST_CASE(transaction_row_streaming_rollback,
|
||||
BOOST_REQUIRE(sc.provider().fragments() == 2);
|
||||
BOOST_REQUIRE(sc.provider().start_fragments() == 1);
|
||||
BOOST_REQUIRE(sc.provider().rollback_fragments() == 1);
|
||||
|
||||
wsrep::high_priority_service* hps(
|
||||
sc.find_streaming_applier(
|
||||
sc.id(), wsrep::transaction_id(1)));
|
||||
BOOST_REQUIRE(hps);
|
||||
hps->rollback(wsrep::ws_handle(), wsrep::ws_meta());
|
||||
hps->after_apply();
|
||||
sc.stop_streaming_applier(sc.id(), wsrep::transaction_id(1));
|
||||
server_service.release_high_priority_service(hps);
|
||||
}
|
||||
|
||||
//
|
||||
@ -1087,6 +1096,15 @@ BOOST_FIXTURE_TEST_CASE(transaction_row_streaming_cert_fail_non_commit,
|
||||
BOOST_REQUIRE(sc.provider().fragments() == 2);
|
||||
BOOST_REQUIRE(sc.provider().start_fragments() == 1);
|
||||
BOOST_REQUIRE(sc.provider().rollback_fragments() == 1);
|
||||
|
||||
wsrep::high_priority_service* hps(
|
||||
sc.find_streaming_applier(
|
||||
sc.id(), wsrep::transaction_id(1)));
|
||||
BOOST_REQUIRE(hps);
|
||||
hps->rollback(wsrep::ws_handle(), wsrep::ws_meta());
|
||||
hps->after_apply();
|
||||
sc.stop_streaming_applier(sc.id(), wsrep::transaction_id(1));
|
||||
server_service.release_high_priority_service(hps);
|
||||
}
|
||||
|
||||
//
|
||||
@ -1109,6 +1127,15 @@ BOOST_FIXTURE_TEST_CASE(transaction_row_streaming_cert_fail_commit,
|
||||
BOOST_REQUIRE(sc.provider().fragments() == 2);
|
||||
BOOST_REQUIRE(sc.provider().start_fragments() == 1);
|
||||
BOOST_REQUIRE(sc.provider().rollback_fragments() == 1);
|
||||
|
||||
wsrep::high_priority_service* hps(
|
||||
sc.find_streaming_applier(
|
||||
sc.id(), wsrep::transaction_id(1)));
|
||||
BOOST_REQUIRE(hps);
|
||||
hps->rollback(wsrep::ws_handle(), wsrep::ws_meta());
|
||||
hps->after_apply();
|
||||
sc.stop_streaming_applier(sc.id(), wsrep::transaction_id(1));
|
||||
server_service.release_high_priority_service(hps);
|
||||
}
|
||||
|
||||
//
|
||||
@ -1243,6 +1270,15 @@ BOOST_FIXTURE_TEST_CASE(transaction_statement_streaming_cert_fail,
|
||||
BOOST_REQUIRE(sc.provider().fragments() == 1);
|
||||
BOOST_REQUIRE(sc.provider().start_fragments() == 0);
|
||||
BOOST_REQUIRE(sc.provider().rollback_fragments() == 1);
|
||||
|
||||
wsrep::high_priority_service* hps(
|
||||
sc.find_streaming_applier(
|
||||
sc.id(), wsrep::transaction_id(1)));
|
||||
BOOST_REQUIRE(hps);
|
||||
hps->rollback(wsrep::ws_handle(), wsrep::ws_meta());
|
||||
hps->after_apply();
|
||||
sc.stop_streaming_applier(sc.id(), wsrep::transaction_id(1));
|
||||
server_service.release_high_priority_service(hps);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user