summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorVasil Dimov <vasil.dimov@galeracluster.com>2018-06-06 17:25:51 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2018-10-10 13:14:36 +0300
commit27dcef390026ab2ac547ed8592b9fed22cd93b70 (patch)
tree2c99f68083a6a286cc1eac56317d9ecc248a7b2f /sql
parent6aa578ec5a4009e33757d91d15947f51c98a5c88 (diff)
downloadmariadb-git-27dcef390026ab2ac547ed8592b9fed22cd93b70.tar.gz
Add a new config variable wsrep_certification_rules
This is used for controlling whether to use a new/optimized certification rules or the old/classic ones that could cause more certification failures - when foreign keys are used and two INSERTs are done concurrently to the child table from different nodes. (cherry picked from commit 815d73e6af8daace6262ab63ca6c043ffc4204b3)
Diffstat (limited to 'sql')
-rw-r--r--sql/sys_vars.cc13
-rw-r--r--sql/wsrep_mysqld.cc1
-rw-r--r--sql/wsrep_mysqld.h2
3 files changed, 15 insertions, 1 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 8a9120abdd0..d0b07472894 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -3887,6 +3887,19 @@ static Sys_var_mybool Sys_wsrep_certify_nonPK(
GLOBAL_VAR(wsrep_certify_nonPK),
CMD_LINE(OPT_ARG), DEFAULT(TRUE));
+static const char *wsrep_certification_rules_names[]= { "strict", "optimized", NullS };
+static Sys_var_enum Sys_wsrep_certification_rules(
+ "wsrep_certification_rules",
+ "Certification rules to use in the cluster. Possible values are: "
+ "\"strict\": stricter rules that could result in more certification "
+ "failures. "
+ "\"optimized\": relaxed rules that allow more concurrency and "
+ "cause less certification failures.",
+ READ_ONLY GLOBAL_VAR(wsrep_certification_rules), CMD_LINE(REQUIRED_ARG),
+ wsrep_certification_rules_names, DEFAULT(WSREP_CERTIFICATION_RULES_STRICT),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(0));
+
static Sys_var_mybool Sys_wsrep_causal_reads(
"wsrep_causal_reads", "(DEPRECATED) Setting this variable is equivalent "
"to setting wsrep_sync_wait READ flag",
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index a7950754666..b61cebf6334 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -51,6 +51,7 @@ ulong wsrep_max_ws_size = 1073741824UL;//max ws (RBR buffer) size
ulong wsrep_max_ws_rows = 65536; // max number of rows in ws
int wsrep_to_isolation = 0; // # of active TO isolation threads
my_bool wsrep_certify_nonPK = 1; // certify, even when no primary key
+ulong wsrep_certification_rules = WSREP_CERTIFICATION_RULES_STRICT;
long wsrep_max_protocol_version = 3; // maximum protocol version to use
ulong wsrep_forced_binlog_format = BINLOG_FORMAT_UNSPEC;
my_bool wsrep_recovery = 0; // recovery
diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h
index b1dc5ba452b..e2800c8c2a8 100644
--- a/sql/wsrep_mysqld.h
+++ b/sql/wsrep_mysqld.h
@@ -20,6 +20,7 @@
typedef struct st_mysql_show_var SHOW_VAR;
#include <sql_priv.h>
#include "../wsrep/wsrep_api.h"
+#include "wsrep_mysqld_c.h"
#define WSREP_UNDEFINED_TRX_ID ULONGLONG_MAX
@@ -58,7 +59,6 @@ enum wsrep_consistency_check_mode {
CONSISTENCY_CHECK_RUNNING,
};
-
// Global wsrep parameters
extern wsrep_t* wsrep;