1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-02 05:22:26 +03:00

Added open(), close(), cleanup() methods to client_state.

Depending on the DBMS client session allocation strategy the
client id may or may not be available when the client_session
is constructed, therefore there should be a method to assign
an id after construction. Close/cleanup methods were added to
clean up open transactions appropriately.
This commit is contained in:
Teemu Ollakka
2018-06-20 10:07:55 +03:00
parent 779f84e5df
commit bf7dad6815
9 changed files with 120 additions and 21 deletions

View File

@ -23,6 +23,7 @@ namespace
wsrep::provider::flag::start_transaction |
wsrep::provider::flag::commit)
{
cc.open(cc.id());
}
wsrep::mock_server_state sc;
wsrep::mock_client cc;
@ -94,6 +95,7 @@ BOOST_AUTO_TEST_CASE(server_state_streaming)
wsrep::stid(wsrep::id("1"), 1, 1),
wsrep::seqno(0),
wsrep::provider::flag::start_transaction);
cc.open(cc.id());
BOOST_REQUIRE(sc.on_apply(cc, ws_handle, ws_meta,
wsrep::const_buffer("1", 1)) == 0);
BOOST_REQUIRE(sc.find_streaming_applier(