mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-02 02:34:19 +00:00
A few miscellaneous changes, including a fix for metadata locking and wipe_clean in Sandbox.pm
This commit is contained in:
@@ -42,7 +42,7 @@ use English qw(-no_match_vars);
|
||||
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
||||
|
||||
eval {
|
||||
require IO::Uncompress::Inflate;
|
||||
require IO::Uncompress::Inflate; # yum: perl-IO-Compress-Zlib
|
||||
IO::Uncompress::Inflate->import(qw(inflate $InflateError));
|
||||
};
|
||||
|
||||
|
@@ -28,7 +28,7 @@ use English qw(-no_match_vars);
|
||||
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
||||
|
||||
eval {
|
||||
require IO::Uncompress::Inflate;
|
||||
require IO::Uncompress::Inflate; # yum: perl-IO-Compress-Zlib
|
||||
IO::Uncompress::Inflate->import(qw(inflate $InflateError));
|
||||
};
|
||||
|
||||
|
@@ -158,6 +158,14 @@ sub _check_server {
|
||||
|
||||
sub wipe_clean {
|
||||
my ( $self, $dbh ) = @_;
|
||||
# If any other connections to the server are holding metadata locks, then
|
||||
# the DROP commands will just hang forever.
|
||||
my @cxns = @{$dbh->selectall_arrayref('SHOW FULL PROCESSLIST', {Slice => {}})};
|
||||
foreach my $cxn ( @cxns ) {
|
||||
if ( $cxn->{user} eq 'msandbox' && $cxn->{command} eq 'Sleep' ) {
|
||||
$dbh->do("KILL $cxn->{id}");
|
||||
}
|
||||
}
|
||||
foreach my $db ( @{$dbh->selectcol_arrayref('SHOW DATABASES')} ) {
|
||||
next if $db eq 'mysql';
|
||||
next if $db eq 'information_schema';
|
||||
|
@@ -337,7 +337,7 @@ ok($res->{result} >= 0, 'Wait was successful');
|
||||
|
||||
$ms->stop_slave($slaves[0]);
|
||||
$dbh->do('drop database if exists test'); # Any stmt will do
|
||||
diag(`(sleep 1; echo "start slave" | /tmp/$port_for{slave0}/use)&`);
|
||||
diag(`(sleep 3; echo "start slave" | /tmp/$port_for{slave0}/use)&`);
|
||||
eval {
|
||||
$res = $ms->wait_for_master(
|
||||
master_status => $ms->get_master_status($dbh),
|
||||
|
@@ -11,4 +11,4 @@ CREATE TABLE `messages` (
|
||||
PRIMARY KEY (`MID`),
|
||||
UNIQUE KEY `ID` (`MID`),
|
||||
KEY `TID` (`TID`)
|
||||
) TYPE=MyISAM;
|
||||
) ENGINE=MyISAM;
|
||||
|
Reference in New Issue
Block a user