diff --git a/include/wsrep/transaction.hpp b/include/wsrep/transaction.hpp index 823b8cc..1fe6523 100644 --- a/include/wsrep/transaction.hpp +++ b/include/wsrep/transaction.hpp @@ -238,7 +238,7 @@ namespace wsrep wsrep::provider& provider(); void flags(int flags) { flags_ = flags; } - bool is_read_only() const; + bool is_local_read_only() const; int before_commit_local_read_only(wsrep::unique_lock&); int before_commit_local(wsrep::unique_lock&); int before_commit_high_priority(wsrep::unique_lock&); diff --git a/src/transaction.cpp b/src/transaction.cpp index 4f36069..b5a2c0f 100644 --- a/src/transaction.cpp +++ b/src/transaction.cpp @@ -438,9 +438,10 @@ int wsrep::transaction::after_prepare( return ret; } -bool wsrep::transaction::is_read_only() const +bool wsrep::transaction::is_local_read_only() const { - return sr_keys_.empty(); + return client_state_.mode() == wsrep::client_state::m_local + && sr_keys_.empty(); } int wsrep::transaction::before_commit_local_read_only( @@ -465,7 +466,7 @@ int wsrep::transaction::before_commit_local( { assert(lock.owns_lock()); - if (is_read_only()) { + if (is_local_read_only()) { return before_commit_local_read_only(lock); } @@ -597,7 +598,7 @@ int wsrep::transaction::ordered_commit() debug_log_state("ordered_commit_enter"); assert(state() == s_committing); - if (is_read_only()) + if (is_local_read_only()) { state(lock, s_ordered_commit); debug_log_state("ordered_commit_leave read_only");