Skip to content

Commit f61cbce

Browse files
author
jfcoz
committed
add checks for wsrep_slave_FK_check and innodb_autoinc_lock_mode when wsrep_slave_threads > 1
1 parent 48be29a commit f61cbce

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

mysqltuner.pl

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
# Simon Greenaway Adam Stein Isart Montane
3232
# Baptiste M. Cole Turner Major Hayden
3333
# Joe Ashcraft Jean-Marie Renouard Christian Loos
34+
# Julien Francoz
3435
#
3536
# Inspired by Matthew Montgomery's tuning-primer.sh script:
3637
# http://forge.mysql.com/projects/view.php?id=44
@@ -5044,9 +5045,24 @@ sub mariadb_galera {
50445045
if (get_wsrep_option('wsrep_slave_threads') > `nproc`*4 or get_wsrep_option('wsrep_slave_threads') < `nproc`*3) {
50455046
badprint "wsrep_slave_threads is not equal to 3 or 4 times number of CPU(s)";
50465047
push @adjvars, "wsrep_slave_threads= Nb of Core CPU * 4";
5047-
} else {
5048+
} else {
50485049
goodprint "wsrep_slave_threads is equal to 3 or 4 times number of CPU(s)";
5049-
}
5050+
}
5051+
5052+
if ($myvar{'wsrep_slave_threads'} > 1) {
5053+
badprint "wsrep parallel slave can cause frequent inconsistency crash.";
5054+
push @adjvars, "Set wsrep_slave_threads to 1 in case of HA_ERR_FOUND_DUPP_KEY crash on slave";
5055+
# check options for parallel slave
5056+
if ($myvar{'wsrep_slave_FK_checks'} eq "OFF") {
5057+
badprint "wsrep_slave_FK_checks is off with parallel slave";
5058+
push @adjvars, "wsrep_slave_FK_checks should be ON when using parallel slave";
5059+
}
5060+
# wsrep_slave_UK_checks seems useless in MySQL source code
5061+
if ($myvar{'innodb_autoinc_lock_mode'} != 2) {
5062+
badprint "innodb_autoinc_lock_mode is incorrect with parallel slave";
5063+
push @adjvars, "innodb_autoinc_lock_mode should be 2 when using parallel slave";
5064+
}
5065+
}
50505066

50515067
if (get_wsrep_option('gcs.limit') != get_wsrep_option('wsrep_slave_threads') *5 ) {
50525068
badprint "gcs.limit should be equal to 5 * wsrep_slave_threads";

0 commit comments

Comments
 (0)