A few miscellaneous changes, including a fix for metadata locking and wipe_clean in Sandbox.pm

This commit is contained in:
Baron Schwartz
2012-06-03 17:20:12 -04:00
parent f995a59eb4
commit 6cc17a73c2
5 changed files with 12 additions and 4 deletions

View File

@@ -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));
};

View File

@@ -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));
};

View File

@@ -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';

View File

@@ -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),

View File

@@ -11,4 +11,4 @@ CREATE TABLE `messages` (
PRIMARY KEY (`MID`),
UNIQUE KEY `ID` (`MID`),
KEY `TID` (`TID`)
) TYPE=MyISAM;
) ENGINE=MyISAM;