diff --git a/include/wsrep/client_state.hpp b/include/wsrep/client_state.hpp index 688542a..48b54e2 100644 --- a/include/wsrep/client_state.hpp +++ b/include/wsrep/client_state.hpp @@ -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 - * 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. + * Sends a commit 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 terminate - * @param commit whether to send a commmit or rollback fragment + * @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 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); } // diff --git a/src/transaction.cpp b/src/transaction.cpp index 25f2bc2..ff86d89 100644 --- a/src/transaction.cpp +++ b/src/transaction.cpp @@ -1209,14 +1209,14 @@ int wsrep::transaction::streaming_step(wsrep::unique_lock& lock, assert(streaming_context_.fragment_size() || is_xa()); if (client_service_.bytes_generated() < - streaming_context_.bytes_certified()) + streaming_context_.log_position()) { /* Something went wrong on DBMS side in keeping track of generated bytes. Return an error to abort the transaction. */ wsrep::log_warning() << "Bytes generated " << client_service_.bytes_generated() << " less than bytes certified " - << streaming_context_.bytes_certified() + << streaming_context_.log_position() << ", aborting streaming transaction"; return 1; } diff --git a/wsrep-API/v26 b/wsrep-API/v26 index 75a5f45..35b9ece 160000 --- a/wsrep-API/v26 +++ b/wsrep-API/v26 @@ -1 +1 @@ -Subproject commit 75a5f452f2ba07b0f4a3a9a94825fccc71b27398 +Subproject commit 35b9ecedd84bac9931851e3f388fc96271e61f97