Skip to content

Commit e44c29b

Browse files
committed
MErge beetween all staff related to Galera Cluster
2 parents f04b32c + 39f02cd commit e44c29b

File tree

1 file changed

+32
-8
lines changed

1 file changed

+32
-8
lines changed

mysqltuner.pl

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env perl
2-
# mysqltuner.pl - Version 1.7.0
2+
# mysqltuner.pl - Version 1.7.1
33
# High Performance MySQL Tuning Script
44
# Copyright (C) 2006-2016 Major Hayden - major@mhtx.net
55
#
@@ -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
@@ -54,7 +55,7 @@ package main;
5455
#use Env;
5556

5657
# Set up a few variables for use in the script
57-
my $tunerversion = "1.7.0";
58+
my $tunerversion = "1.7.1";
5859
my ( @adjvars, @generalrec );
5960

6061
# Set defaults
@@ -5064,24 +5065,47 @@ sub mariadb_galera {
50645065
{
50655066
badprint "gcs.limit should be equal to 5 * wsrep_slave_threads";
50665067
push @adjvars, "gcs.limit= wsrep_slave_threads * 5";
5068+
} else {
5069+
goodprint "wsrep_slave_threads is equal to 3 or 4 times number of CPU(s)";
50675070
}
5068-
else {
5069-
goodprint "gcs.limit is equal to 5 * wsrep_slave_threads";
5071+
5072+
if (get_wsrep_option('wsrep_slave_threads') > 1) {
5073+
badprint "wsrep parallel slave can cause frequent inconsistency crash.";
5074+
push @adjvars, "Set wsrep_slave_threads to 1 in case of HA_ERR_FOUND_DUPP_KEY crash on slave";
5075+
# check options for parallel slave
5076+
if (get_wsrep_option('wsrep_slave_FK_checks') eq "OFF") {
5077+
badprint "wsrep_slave_FK_checks is off with parallel slave";
5078+
push @adjvars, "wsrep_slave_FK_checks should be ON when using parallel slave";
5079+
}
5080+
# wsrep_slave_UK_checks seems useless in MySQL source code
5081+
if ($myvar{'innodb_autoinc_lock_mode'} != 2) {
5082+
badprint "innodb_autoinc_lock_mode is incorrect with parallel slave";
5083+
push @adjvars, "innodb_autoinc_lock_mode should be 2 when using parallel slave";
5084+
}
5085+
}
5086+
5087+
if (get_wsrep_option('gcs.fc_limit') != $myvar{'wsrep_slave_threads'} * 5 ) {
5088+
badprint "gcs.fc_limit should be equal to 5 * wsrep_slave_threads";
5089+
push @adjvars, "gcs.fc_limit= wsrep_slave_threads * 5";
5090+
} else {
5091+
goodprint "gcs.fc_limit is equal to 5 * wsrep_slave_threads";
50705092
}
5071-
if ( get_wsrep_option('gcs.fc_factor') == 0.8 ) {
5093+
5094+
if (get_wsrep_option('gcs.fc_factor') != 0.8 ) {
50725095
badprint "gcs.fc_factor should be equal to 0.8";
50735096
push @adjvars, "gcs.fc_factor=0.8";
50745097
}
50755098
else {
5076-
goodprint "gcs.limit is equal to 5 * wsrep_slave_threads";
5099+
goodprint "gcs.fc_factor is equal to 0.8";
50775100
}
5078-
if ( get_wsrep_option('wsrep_flow_control_paused') > 0.02 ) {
5101+
if ( get_wsrep_option('wsrep_flow_control_paused') > 0.02 ) {
50795102
badprint "Fraction of time node pause flow control > 0.02";
50805103
}
50815104
else {
50825105
goodprint
50835106
"Flow control fraction seems to be OK (wsrep_flow_control_paused<=0.02)";
50845107
}
5108+
50855109
if ( scalar(@primaryKeysNbTables) > 0 ) {
50865110
badprint "Following table(s) don't have primary key:";
50875111
foreach my $badtable (@primaryKeysNbTables) {
@@ -6034,7 +6058,7 @@ sub which {
60346058
60356059
=head1 NAME
60366060
6037-
MySQLTuner 1.7.0 - MySQL High Performance Tuning Script
6061+
MySQLTuner 1.7.1 - MySQL High Performance Tuning Script
60386062
60396063
=head1 IMPORTANT USAGE GUIDELINES
60406064

0 commit comments

Comments
 (0)