summaryrefslogtreecommitdiff
path: root/sql/wsrep_mysqld.cc
diff options
context:
space:
mode:
authorSachin Setiya <sachinsetia1001@gmail.com>2016-12-14 17:14:42 +0530
committerSachin Setiya <sachinsetia1001@gmail.com>2016-12-14 17:14:42 +0530
commit5ddd8149e44122feb0989b9944113d2b92d6f84a (patch)
treebaa490d8ee88ad74f5b9be88c445b6fd228eef60 /sql/wsrep_mysqld.cc
parent95422c445db7db60fca688711d98955e59e009e2 (diff)
downloadmariadb-git-5ddd8149e44122feb0989b9944113d2b92d6f84a.tar.gz
MDEV-11479 Improved wsrep_dirty_reads
Tasks:- Changes in wsrep_dirty_reads variable 1.) Global + Session scope (Current: session-only) 2.) Can be set using command line. 3.) Allow all commands that do not change data (besides SELECT) 4.) Allow prepared Statements that do not change data 5.) Works with wsrep_sync_wait enabled
Diffstat (limited to 'sql/wsrep_mysqld.cc')
-rw-r--r--sql/wsrep_mysqld.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 48114fcba34..21c7e94096d 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -65,6 +65,8 @@ my_bool wsrep_restart_slave_activated = 0; // node has dropped, and slave
// restart will be needed
my_bool wsrep_slave_UK_checks = 0; // slave thread does UK checks
my_bool wsrep_slave_FK_checks = 0; // slave thread does FK checks
+// Allow reads even if the node is not in the primary component.
+bool wsrep_dirty_reads = false;
/*
Set during the creation of first wsrep applier and rollback threads.
@@ -894,6 +896,8 @@ bool wsrep_must_sync_wait (THD* thd, uint mask)
{
return (thd->variables.wsrep_sync_wait & mask) &&
thd->variables.wsrep_on &&
+ !(thd->variables.wsrep_dirty_reads &&
+ !is_update_query(thd->lex->sql_command)) &&
!thd->in_active_multi_stmt_transaction() &&
thd->wsrep_conflict_state != REPLAYING &&
thd->wsrep_sync_wait_gtid.seqno == WSREP_SEQNO_UNDEFINED;