summaryrefslogtreecommitdiffstats
path: root/wsrep-lib/src
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 13:22:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 13:22:53 +0000
commit347c164c35eddab388009470e6848cb361ac93f8 (patch)
tree2c0c44eac690f510bb0a35b2a13b36d606b77b6b /wsrep-lib/src
parentReleasing progress-linux version 1:10.11.7-4~progress7.99u1. (diff)
downloadmariadb-347c164c35eddab388009470e6848cb361ac93f8.tar.xz
mariadb-347c164c35eddab388009470e6848cb361ac93f8.zip
Merging upstream version 1:10.11.8.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--wsrep-lib/src/client_state.cpp3
-rw-r--r--wsrep-lib/src/reporter.cpp12
-rw-r--r--wsrep-lib/src/transaction.cpp13
3 files changed, 18 insertions, 10 deletions
diff --git a/wsrep-lib/src/client_state.cpp b/wsrep-lib/src/client_state.cpp
index 99c4222f..48501fdd 100644
--- a/wsrep-lib/src/client_state.cpp
+++ b/wsrep-lib/src/client_state.cpp
@@ -68,8 +68,7 @@ void wsrep::client_state::close()
keep_command_error_ = false;
lock.unlock();
if (transaction_.active() &&
- (mode_ != m_local ||
- transaction_.state() != wsrep::transaction::s_prepared))
+ (mode_ != m_local || !client_service_.is_prepared_xa()))
{
client_service_.bf_rollback();
transaction_.after_statement();
diff --git a/wsrep-lib/src/reporter.cpp b/wsrep-lib/src/reporter.cpp
index 511ef819..3b21a199 100644
--- a/wsrep-lib/src/reporter.cpp
+++ b/wsrep-lib/src/reporter.cpp
@@ -176,7 +176,7 @@ static std::string escape_json(const std::string& str)
void
wsrep::reporter::write_log_msg(std::ostream& os,
- const log_msg& msg)
+ const log_msg_t& msg)
{
os << "\t\t{\n";
os << "\t\t\t\"timestamp\": " << std::showpoint << std::setprecision(18)
@@ -187,7 +187,7 @@ wsrep::reporter::write_log_msg(std::ostream& os,
void
wsrep::reporter::write_event(std::ostream& os,
- const log_msg& msg)
+ const log_msg_t& msg)
{
os << "\t\t{\n";
os << "\t\t\t\"timestamp\": " << std::showpoint << std::setprecision(18)
@@ -199,9 +199,9 @@ wsrep::reporter::write_event(std::ostream& os,
void
wsrep::reporter::write_array(std::ostream& os,
const std::string& label,
- const std::deque<log_msg>& msgs,
+ const std::deque<log_msg_t>& msgs,
void (*element_writer)(std::ostream& os,
- const log_msg& msg))
+ const log_msg_t& msg))
{
os << "\t\"" << label << "\": [\n";
for (size_t i(0); i < msgs.size(); ++i)
@@ -351,7 +351,7 @@ wsrep::reporter::report_log_msg(log_level const lvl,
const std::string& msg,
double tstamp)
{
- std::deque<log_msg>& deque(lvl == error ? err_msg_ : warn_msg_);
+ std::deque<log_msg_t>& deque(lvl == error ? err_msg_ : warn_msg_);
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
@@ -363,7 +363,7 @@ wsrep::reporter::report_log_msg(log_level const lvl,
/* Log messages are not expected to be json formatted, so we escape
the message strings here to keep the report file well formatted. */
- log_msg entry({tstamp, escape_json(msg)});
+ log_msg_t entry({tstamp, escape_json(msg)});
deque.push_back(entry);
write_file(tstamp);
}
diff --git a/wsrep-lib/src/transaction.cpp b/wsrep-lib/src/transaction.cpp
index 451e94dd..7d9e31e6 100644
--- a/wsrep-lib/src/transaction.cpp
+++ b/wsrep-lib/src/transaction.cpp
@@ -1400,10 +1400,19 @@ bool wsrep::transaction::abort_or_interrupt(
}
return true;
}
- else if (client_service_.interrupted(lock))
+
+ if (client_service_.interrupted(lock))
{
+ assert(state() != s_must_abort &&
+ state() != s_aborting &&
+ state() != s_aborted);
+
+ // Client was interrupted. Set the appropriate error and abort.
+ // For transactions in prepared state, it is OK to interrupt the
+ // statement, but transaction must remain in prepared state until
+ // commit or rollback.
client_state_.override_error(wsrep::e_interrupted_error);
- if (state() != s_must_abort)
+ if (state() != s_prepared)
{
state(lock, s_must_abort);
}