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

Total order BF abort client_state method to differentiate BF

aborts caused by conflicts between transactions and conflicts
between TOI operations and transactions.
This commit is contained in:
Teemu Ollakka
2018-07-13 18:33:22 +03:00
parent 4cfb9b6413
commit 13487781d8
3 changed files with 43 additions and 6 deletions

View File

@ -93,6 +93,7 @@ wsrep::transaction::transaction(
, bf_abort_state_(s_executing)
, bf_abort_provider_status_()
, bf_abort_client_state_()
, bf_aborted_in_total_order_()
, ws_handle_()
, ws_meta_()
, flags_()
@ -521,7 +522,7 @@ int wsrep::transaction::before_rollback()
// fall through
case s_executing:
// Voluntary rollback
if (is_streaming())
if (is_streaming() && bf_aborted_in_total_order_ == false)
{
streaming_rollback();
}
@ -534,7 +535,7 @@ int wsrep::transaction::before_rollback()
}
else
{
if (is_streaming())
if (is_streaming() && bf_aborted_in_total_order_ == false)
{
streaming_rollback();
}
@ -542,16 +543,16 @@ int wsrep::transaction::before_rollback()
}
break;
case s_cert_failed:
if (is_streaming())
if (is_streaming() && bf_aborted_in_total_order_ == false)
{
streaming_rollback();
}
state(lock, s_aborting);
break;
case s_aborting:
if (is_streaming())
if (is_streaming() && bf_aborted_in_total_order_ == false)
{
provider().rollback(id_);
streaming_rollback();
}
break;
case s_must_replay:
@ -840,6 +841,18 @@ bool wsrep::transaction::bf_abort(
return ret;
}
bool wsrep::transaction::total_order_bf_abort(
wsrep::unique_lock<wsrep::mutex>& lock WSREP_UNUSED,
wsrep::seqno bf_seqno)
{
bool ret(bf_abort(lock, bf_seqno));
if (ret)
{
bf_aborted_in_total_order_ = true;
}
return ret;
}
////////////////////////////////////////////////////////////////////////////////
// Private //
////////////////////////////////////////////////////////////////////////////////
@ -1278,6 +1291,7 @@ void wsrep::transaction::cleanup()
bf_abort_state_ = s_executing;
bf_abort_provider_status_ = wsrep::provider::success;
bf_abort_client_state_ = 0;
bf_aborted_in_total_order_ = false;
ws_meta_ = wsrep::ws_meta();
flags_ = 0;
certified_ = false;