mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-31 18:24:25 +03:00
Add method client_service::is_prepared_xa()
This commit is contained in:
@ -82,6 +82,11 @@ namespace db
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_prepared_xa() override
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool is_xa_rollback() override
|
bool is_xa_rollback() override
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -194,6 +194,16 @@ namespace wsrep
|
|||||||
*/
|
*/
|
||||||
virtual bool is_explicit_xa() = 0;
|
virtual bool is_explicit_xa() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the client has an ongoing XA transaction
|
||||||
|
* in prepared state.
|
||||||
|
* Notice: one could simply check if wsrep::transaction is
|
||||||
|
* in s_prepared state. However, wsrep::transaction does not
|
||||||
|
* transition to prepared state for read-only / empty
|
||||||
|
* transactions.
|
||||||
|
*/
|
||||||
|
virtual bool is_prepared_xa() = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the currently executing command is
|
* Returns true if the currently executing command is
|
||||||
* a rollback for XA. This is used to avoid setting a
|
* a rollback for XA. This is used to avoid setting a
|
||||||
|
@ -68,8 +68,7 @@ void wsrep::client_state::close()
|
|||||||
keep_command_error_ = false;
|
keep_command_error_ = false;
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
if (transaction_.active() &&
|
if (transaction_.active() &&
|
||||||
(mode_ != m_local ||
|
(mode_ != m_local || !client_service_.is_prepared_xa()))
|
||||||
transaction_.state() != wsrep::transaction::s_prepared))
|
|
||||||
{
|
{
|
||||||
client_service_.bf_rollback();
|
client_service_.bf_rollback();
|
||||||
transaction_.after_statement();
|
transaction_.after_statement();
|
||||||
|
@ -176,6 +176,11 @@ namespace wsrep
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_prepared_xa() WSREP_OVERRIDE
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool is_xa_rollback() WSREP_OVERRIDE
|
bool is_xa_rollback() WSREP_OVERRIDE
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user