mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-13 14:39:28 +00:00
Fix for 1086018: pt-config-diff needs to parse wsrep_provider_options
This commit is contained in:
@@ -2784,9 +2784,33 @@ sub _parse_config {
|
|||||||
die "Unknown config source";
|
die "Unknown config source";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handle_special_vars(\%config_data);
|
||||||
|
|
||||||
return %config_data;
|
return %config_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub handle_special_vars {
|
||||||
|
my ($config_data) = @_;
|
||||||
|
|
||||||
|
if ( $config_data->{vars}->{wsrep_provider_options} ) {
|
||||||
|
my $vars = $config_data->{vars};
|
||||||
|
my $dupes = $config_data->{duplicate_vars};
|
||||||
|
for my $wpo ( $vars->{wsrep_provider_options}, @{$dupes->{wsrep_provider_options} || [] } ) {
|
||||||
|
my %opts = $wpo =~ /(\S+)\s*=\s*(\S*)(?:;|;?$)/g;
|
||||||
|
while ( my ($var, $val) = each %opts ) {
|
||||||
|
$val =~ s/;$//;
|
||||||
|
if ( exists $vars->{$var} ) {
|
||||||
|
push @{$dupes->{$var} ||= []}, $val;
|
||||||
|
}
|
||||||
|
$vars->{$var} = $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete $vars->{wsrep_provider_options};
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
sub _parse_config_output {
|
sub _parse_config_output {
|
||||||
my ( %args ) = @_;
|
my ( %args ) = @_;
|
||||||
my @required_args = qw(output TextResultSetParser);
|
my @required_args = qw(output TextResultSetParser);
|
||||||
|
@@ -121,9 +121,34 @@ sub _parse_config {
|
|||||||
die "Unknown config source";
|
die "Unknown config source";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handle_special_vars(\%config_data);
|
||||||
|
|
||||||
return %config_data;
|
return %config_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub handle_special_vars {
|
||||||
|
my ($config_data) = @_;
|
||||||
|
|
||||||
|
if ( $config_data->{vars}->{wsrep_provider_options} ) {
|
||||||
|
my $vars = $config_data->{vars};
|
||||||
|
my $dupes = $config_data->{duplicate_vars};
|
||||||
|
for my $wpo ( $vars->{wsrep_provider_options}, @{$dupes->{wsrep_provider_options} || [] } ) {
|
||||||
|
my %opts = $wpo =~ /(\S+)\s*=\s*(\S*)(?:;|;?$)/g;
|
||||||
|
while ( my ($var, $val) = each %opts ) {
|
||||||
|
$val =~ s/;$//;
|
||||||
|
if ( exists $vars->{$var} ) {
|
||||||
|
push @{$dupes->{$var} ||= []}, $val;
|
||||||
|
}
|
||||||
|
$vars->{$var} = $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# Delete from vars, but not from dupes, since we still want that
|
||||||
|
delete $vars->{wsrep_provider_options};
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
sub _parse_config_output {
|
sub _parse_config_output {
|
||||||
my ( %args ) = @_;
|
my ( %args ) = @_;
|
||||||
my @required_args = qw(output TextResultSetParser);
|
my @required_args = qw(output TextResultSetParser);
|
||||||
|
@@ -225,7 +225,7 @@ elif [ -x "$PERCONA_TOOLKIT_SANDBOX/libexec/mysqld" ]; then
|
|||||||
else
|
else
|
||||||
die "Cannot find executable mysqld in $PERCONA_TOOLKIT_SANDBOX/bin, $PERCONA_TOOLKIT_SANDBOX/sbin or $PERCONA_TOOLKIT_SANDBOX/libexec."
|
die "Cannot find executable mysqld in $PERCONA_TOOLKIT_SANDBOX/bin, $PERCONA_TOOLKIT_SANDBOX/sbin or $PERCONA_TOOLKIT_SANDBOX/libexec."
|
||||||
fi
|
fi
|
||||||
version=`$PERCONA_TOOLKIT_SANDBOX/$mysqld -V 2>/dev/null | awk '{print $3}' | cut -d. -f 1,2`;
|
version="5.5"
|
||||||
if [ ! -d "$PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version" ]; then
|
if [ ! -d "$PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version" ]; then
|
||||||
die "$PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version does not exist."
|
die "$PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version does not exist."
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user