mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-06-16 02:01:44 +03:00
Fixed dbsim BF aborts
This commit is contained in:
@ -30,8 +30,7 @@ void db::client::start()
|
|||||||
|
|
||||||
bool db::client::bf_abort(wsrep::seqno seqno)
|
bool db::client::bf_abort(wsrep::seqno seqno)
|
||||||
{
|
{
|
||||||
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
|
return client_context_.bf_abort(seqno);
|
||||||
return client_context_.bf_abort(lock, seqno);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -53,17 +53,15 @@ void db::storage_engine::bf_abort_some(const wsrep::transaction_context& txc)
|
|||||||
for (auto victim : transactions_)
|
for (auto victim : transactions_)
|
||||||
{
|
{
|
||||||
wsrep::client_context& cc(victim->client_context());
|
wsrep::client_context& cc(victim->client_context());
|
||||||
wsrep::unique_lock<wsrep::mutex> lock(cc.mutex());
|
|
||||||
if (cc.mode() == wsrep::client_context::m_replicating)
|
if (cc.mode() == wsrep::client_context::m_replicating)
|
||||||
{
|
{
|
||||||
lock.unlock();
|
|
||||||
if (victim->bf_abort(txc.seqno()))
|
if (victim->bf_abort(txc.seqno()))
|
||||||
{
|
{
|
||||||
++bf_aborts_;
|
++bf_aborts_;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -397,9 +397,9 @@ namespace wsrep
|
|||||||
//
|
//
|
||||||
// BF aborting
|
// BF aborting
|
||||||
//
|
//
|
||||||
int bf_abort(wsrep::unique_lock<wsrep::mutex>& lock,
|
int bf_abort(wsrep::seqno bf_seqno)
|
||||||
wsrep::seqno bf_seqno)
|
|
||||||
{
|
{
|
||||||
|
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
|
||||||
assert(mode_ == m_replicating);
|
assert(mode_ == m_replicating);
|
||||||
return transaction_.bf_abort(lock, bf_seqno);
|
return transaction_.bf_abort(lock, bf_seqno);
|
||||||
}
|
}
|
||||||
|
@ -125,9 +125,8 @@ int wsrep::server_context::on_apply(
|
|||||||
{
|
{
|
||||||
int ret(0);
|
int ret(0);
|
||||||
const wsrep::transaction_context& txc(client_context.transaction());
|
const wsrep::transaction_context& txc(client_context.transaction());
|
||||||
// wsrep::log_debug() << "server_context::on apply flags: "
|
assert(client_context.mode() == wsrep::client_context::m_high_priority);
|
||||||
// << flags_to_string(ws_meta.flags());
|
|
||||||
assert(ws_handle.opaque());
|
|
||||||
bool not_replaying(txc.state() !=
|
bool not_replaying(txc.state() !=
|
||||||
wsrep::transaction_context::s_replaying);
|
wsrep::transaction_context::s_replaying);
|
||||||
|
|
||||||
|
@ -88,7 +88,6 @@ int wsrep::transaction_context::start_replaying(const wsrep::ws_meta& ws_meta)
|
|||||||
assert(active());
|
assert(active());
|
||||||
assert(client_context_.mode() == wsrep::client_context::m_high_priority);
|
assert(client_context_.mode() == wsrep::client_context::m_high_priority);
|
||||||
assert(state() == s_replaying);
|
assert(state() == s_replaying);
|
||||||
assert(ws_handle_.opaque());
|
|
||||||
assert(ws_meta_.seqno().nil() == false);
|
assert(ws_meta_.seqno().nil() == false);
|
||||||
certified_ = true;
|
certified_ = true;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -10,16 +10,14 @@
|
|||||||
// Simple BF abort method to BF abort unordered transasctions
|
// Simple BF abort method to BF abort unordered transasctions
|
||||||
void wsrep_test::bf_abort_unordered(wsrep::client_context& cc)
|
void wsrep_test::bf_abort_unordered(wsrep::client_context& cc)
|
||||||
{
|
{
|
||||||
wsrep::unique_lock<wsrep::mutex> lock(cc.mutex());
|
|
||||||
assert(cc.transaction().ordered() == false);
|
assert(cc.transaction().ordered() == false);
|
||||||
cc.bf_abort(lock, wsrep::seqno(1));
|
cc.bf_abort(wsrep::seqno(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void wsrep_test::bf_abort_ordered(wsrep::client_context& cc)
|
void wsrep_test::bf_abort_ordered(wsrep::client_context& cc)
|
||||||
{
|
{
|
||||||
wsrep::unique_lock<wsrep::mutex> lock(cc.mutex());
|
|
||||||
assert(cc.transaction().ordered());
|
assert(cc.transaction().ordered());
|
||||||
cc.bf_abort(lock, wsrep::seqno(0));
|
cc.bf_abort(wsrep::seqno(0));
|
||||||
}
|
}
|
||||||
// BF abort method to abort transactions via provider
|
// BF abort method to abort transactions via provider
|
||||||
void wsrep_test::bf_abort_provider(wsrep::mock_server_context& sc,
|
void wsrep_test::bf_abort_provider(wsrep::mock_server_context& sc,
|
||||||
|
Reference in New Issue
Block a user