PT-204 Added RocksDB to the list of ignored engines

This commit is contained in:
Carlos Salguero
2017-11-16 16:11:52 -03:00
parent 98d8844363
commit b4ac841421
4 changed files with 99 additions and 0 deletions

View File

@@ -12004,6 +12004,12 @@ The tool warns when it detects this setup to remind you that it only works
when used as described above. These warnings do not affect the exit status when used as described above. These warnings do not affect the exit status
of the tool; they're only reminders to help avoid false-positive results. of the tool; they're only reminders to help avoid false-positive results.
=item RocksDB support
Due to the limitations in the RocksDB engine like not suporting binlog_format=STATEMENT
or they way RocksDB handles Gap locks, pt-table-cheksum will skip tables using RocksDB engine.
More Information: (L<https://www.percona.com/doc/percona-server/LATEST/myrocks/limitations.html>)
=back =back
=head1 OUTPUT =head1 OUTPUT

View File

@@ -174,6 +174,13 @@ make_sandbox() {
/tmp/$port/use -e "start slave" /tmp/$port/use -e "start slave"
fi fi
if [ -x "$PERCONA_TOOLKIT_SANDBOX/bin/ps-admin" ]; then
# try to enable RocksDB. Only available on Percona Server 5.7.19+
if [ "$version" ">" "5.6" ]; then
$PERCONA_TOOLKIT_SANDBOX/bin/ps-admin --enable-rocksdb -u root -pmsandbox -h 127.1 -P $port
fi
fi
return 0 return 0
} }

View File

@@ -0,0 +1,71 @@
#!/usr/bin/env perl
BEGIN {
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
};
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More;
use PerconaTest;
use Sandbox;
use SqlModes;
require "$trunk/bin/pt-table-checksum";
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $dbh = $sb->get_dbh_for('master');
if ( !$dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}
else {
plan tests => 4;
}
$sb->load_file('master', 't/pt-table-checksum/samples/pt-204.sql');
# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic
# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the tool will die.
# And --max-load "" prevents waiting for status variables.
my $master_dsn = $sb->dsn_for('master');
my @args = ($master_dsn, "--set-vars", "innodb_lock_wait_timeout=50",
"--no-check-binlog-format");
my $output;
my $exit_status;
# Test #1
$output = output(
sub { $exit_status = pt_table_checksum::main(@args) },
stderr => 1,
);
is(
$exit_status,
0,
"PT-204 use single backtick in comments",
);
unlike(
$output,
qr/test\.t1/,
"PT-204 table t1 was skipped (RocksDB)",
);
like(
$output,
qr/test\.t2/,
"PT-204 table t2 was checksumed (InnoDB)",
);
# #############################################################################
# Done.
# #############################################################################
$sb->wipe_clean($dbh);
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
exit;

View File

@@ -0,0 +1,15 @@
DROP DATABASE IF EXISTS test;
CREATE DATABASE test;
USE test;
CREATE TABLE t1 (
id INT AUTO_INCREMENT PRIMARY KEY,
f2 VARCHAR(30),
f3 TIMESTAMP
) Engine=RocksDB;
CREATE TABLE t2 (
id INT AUTO_INCREMENT PRIMARY KEY,
f2 VARCHAR(30),
f3 TIMESTAMP
) Engine=InnoDB;