mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-28 20:02:00 +03:00
Split commit_or_rollback_by_xid()
in two methods
Split `client_state::commit_or_rollback_by_xid()` into `client_state::commit_by_xid()` and `client_state::rollback_by_xid()`.
This commit is contained in:
@ -550,22 +550,39 @@ namespace wsrep
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Terminate transaction with the given xid
|
* Commit transaction with the given xid
|
||||||
*
|
*
|
||||||
* Sends a commit or rollback fragment to terminate a
|
* Sends a commit fragment to terminate the transaction with
|
||||||
* transaction with the given xid. For the fragment to be
|
* the given xid. For the fragment to be sent, a streaming
|
||||||
* sent, a streaming applier for the transaction must exist
|
* applier for the transaction must exist, and the transaction
|
||||||
* and the transaction must be in prepared state.
|
* must be in prepared state.
|
||||||
*
|
*
|
||||||
* @param xid the xid of the the transaction to terminate
|
* @param xid the xid of the the transaction to commit
|
||||||
* @param commit whether to send a commmit or rollback fragment
|
|
||||||
*
|
*
|
||||||
* @return Zero on success, non-zero on error. In case of error
|
* @return Zero on success, non-zero on error. In case of error
|
||||||
* the client_state's current_error is set
|
* the client_state's current_error is set
|
||||||
*/
|
*/
|
||||||
int commit_or_rollback_by_xid(const std::string& xid, bool commit)
|
int commit_by_xid(const std::string& xid)
|
||||||
{
|
{
|
||||||
return transaction_.commit_or_rollback_by_xid(xid, commit);
|
return transaction_.commit_or_rollback_by_xid(xid, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rollback transaction with the given xid
|
||||||
|
*
|
||||||
|
* Sends a rollback fragment to terminate the transaction with
|
||||||
|
* the given xid. For the fragment to be sent, a streaming
|
||||||
|
* applier for the transaction must exist, and the transaction
|
||||||
|
* must be in prepared state.
|
||||||
|
*
|
||||||
|
* @param xid the xid of the the transaction to commit
|
||||||
|
*
|
||||||
|
* @return Zero on success, non-zero on error. In case of error
|
||||||
|
* the client_state's current_error is set
|
||||||
|
*/
|
||||||
|
int rollback_by_xid(const std::string& xid)
|
||||||
|
{
|
||||||
|
return transaction_.commit_or_rollback_by_xid(xid, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1209,14 +1209,14 @@ int wsrep::transaction::streaming_step(wsrep::unique_lock<wsrep::mutex>& lock,
|
|||||||
assert(streaming_context_.fragment_size() || is_xa());
|
assert(streaming_context_.fragment_size() || is_xa());
|
||||||
|
|
||||||
if (client_service_.bytes_generated() <
|
if (client_service_.bytes_generated() <
|
||||||
streaming_context_.bytes_certified())
|
streaming_context_.log_position())
|
||||||
{
|
{
|
||||||
/* Something went wrong on DBMS side in keeping track of
|
/* Something went wrong on DBMS side in keeping track of
|
||||||
generated bytes. Return an error to abort the transaction. */
|
generated bytes. Return an error to abort the transaction. */
|
||||||
wsrep::log_warning() << "Bytes generated "
|
wsrep::log_warning() << "Bytes generated "
|
||||||
<< client_service_.bytes_generated()
|
<< client_service_.bytes_generated()
|
||||||
<< " less than bytes certified "
|
<< " less than bytes certified "
|
||||||
<< streaming_context_.bytes_certified()
|
<< streaming_context_.log_position()
|
||||||
<< ", aborting streaming transaction";
|
<< ", aborting streaming transaction";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Submodule wsrep-API/v26 updated: 75a5f452f2...35b9ecedd8
Reference in New Issue
Block a user