mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-31 18:24:25 +03:00
More strict check for read-only
Only local transactions can be RO
This commit is contained in:
@ -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<wsrep::mutex>&);
|
||||
int before_commit_local(wsrep::unique_lock<wsrep::mutex>&);
|
||||
int before_commit_high_priority(wsrep::unique_lock<wsrep::mutex>&);
|
||||
|
@ -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");
|
||||
|
Reference in New Issue
Block a user