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

Made client_id, transaction_id constructors explicit.

This commit is contained in:
Teemu Ollakka
2018-07-11 15:00:31 +03:00
parent d564a6f154
commit ddc6c6495b
13 changed files with 102 additions and 84 deletions

View File

@ -554,7 +554,7 @@ int wsrep::transaction::before_rollback()
case s_aborting:
if (is_streaming())
{
provider().rollback(id_.get());
provider().rollback(id_);
}
break;
case s_must_replay:
@ -782,12 +782,12 @@ bool wsrep::transaction::bf_abort(
wsrep::seqno victim_seqno;
enum wsrep::provider::status
status(client_state_.provider().bf_abort(
bf_seqno, id_.get(), victim_seqno));
bf_seqno, id_, victim_seqno));
switch (status)
{
case wsrep::provider::success:
WSREP_TC_LOG_DEBUG(1, "Seqno " << bf_seqno
<< " succesfully BF aborted " << id_.get()
<< " succesfully BF aborted " << id_
<< " victim_seqno " << victim_seqno);
bf_abort_state_ = state();
state(lock, s_must_abort);
@ -796,7 +796,7 @@ bool wsrep::transaction::bf_abort(
default:
WSREP_TC_LOG_DEBUG(1,
"Seqno " << bf_seqno
<< " failed to BF abort " << id_.get()
<< " failed to BF abort " << id_
<< " with status " << status
<< " victim_seqno " << victim_seqno);
break;
@ -882,7 +882,7 @@ void wsrep::transaction::state(
{
std::ostringstream os;
os << "unallowed state transition for transaction "
<< id_.get() << ": " << wsrep::to_string(state_)
<< id_ << ": " << wsrep::to_string(state_)
<< " -> " << wsrep::to_string(next_state);
wsrep::log_error() << os.str();
throw wsrep::runtime_error(os.str());
@ -963,7 +963,7 @@ int wsrep::transaction::certify_fragment(
wsrep::ws_meta sr_ws_meta;
enum wsrep::provider::status
cert_ret(provider().certify(client_state_.id().get(),
cert_ret(provider().certify(client_state_.id(),
ws_handle_,
flags(),
sr_ws_meta));
@ -1062,7 +1062,7 @@ int wsrep::transaction::certify_commit(
client_service_.debug_sync("wsrep_before_certification");
enum wsrep::provider::status
cert_ret(provider().certify(client_state_.id().get(),
cert_ret(provider().certify(client_state_.id(),
ws_handle_,
flags(),
ws_meta_));
@ -1213,10 +1213,10 @@ void wsrep::transaction::streaming_rollback()
streaming_context_.cleanup();
streaming_context_.rolled_back(id_);
enum wsrep::provider::status ret;
if ((ret = provider().rollback(id_.get())))
if ((ret = provider().rollback(id_)))
{
wsrep::log_warning() << "Failed to replicate rollback fragment for "
<< id_.get() << ": " << ret;
<< id_ << ": " << ret;
}
debug_log_state("streaming_rollback leave");
}

View File

@ -135,7 +135,8 @@ namespace
~mutable_ws_handle()
{
ws_handle_ = wsrep::ws_handle(native_.trx_id, native_.opaque);
ws_handle_ = wsrep::ws_handle(
wsrep::transaction_id(native_.trx_id), native_.opaque);
}
wsrep_ws_handle_t* native()
@ -192,8 +193,8 @@ namespace
seqno_from_native(trx_meta_.gtid.seqno)),
wsrep::stid(wsrep::id(trx_meta_.stid.node.data,
sizeof(trx_meta_.stid.node.data)),
trx_meta_.stid.trx,
trx_meta_.stid.conn),
wsrep::transaction_id(trx_meta_.stid.trx),
wsrep::client_id(trx_meta_.stid.conn)),
seqno_from_native(trx_meta_.depends_on), flags_);
}
@ -368,15 +369,17 @@ namespace
assert(high_priority_service);
wsrep::const_buffer data(buf->ptr, buf->len);
wsrep::ws_handle ws_handle(wsh->trx_id, wsh->opaque);
wsrep::ws_handle ws_handle(wsrep::transaction_id(wsh->trx_id),
wsh->opaque);
wsrep::ws_meta ws_meta(
wsrep::gtid(wsrep::id(meta->gtid.uuid.data,
sizeof(meta->gtid.uuid.data)),
wsrep::seqno(meta->gtid.seqno)),
wsrep::stid(wsrep::id(meta->stid.node.data,
sizeof(meta->stid.node.data)),
meta->stid.trx,
meta->stid.conn), wsrep::seqno(seqno_from_native(meta->depends_on)),
wsrep::transaction_id(meta->stid.trx),
wsrep::client_id(meta->stid.conn)),
wsrep::seqno(seqno_from_native(meta->depends_on)),
map_flags_from_native(flags));
try
{