Merge pull request #20 from Shopify/rds_for_pt_kill

enable support for RDS in pt-kill
This commit is contained in:
Frank Cizmich
2015-08-20 15:37:38 -04:00

View File

@@ -6714,7 +6714,13 @@ sub main {
my $proc_sth;
my $kill; # callback to KILL
my $kill_sth;
my $kill_sql = $o->get('kill-query') ? 'KILL QUERY ?' : 'KILL ?';
my $kill_sql;
if ( $o->get('rds') ){
$kill_sql = $o->get('kill-query') ? 'CALL mysql.rds_kill_query(?)' : 'CALL mysql.rds_kill(?)';
}
else{
$kill_sql = $o->get('kill-query') ? 'KILL QUERY ?' : 'KILL ?';
}
my $files;
if ( $files = $o->get('test-matching') ) {
PTDEBUG && _d('Getting processlist from files:', @$files);
@@ -7647,6 +7653,14 @@ Note that this is a digest (or hash) of the query's "fingerprint",
so queries of the same form but with different values will have the same ID.
See pt-query-digest for more information.
=item --rds
Denotes the instance in question is on Amazon RDS. By default pt-kill runs
the MySQL command "kill" for L<"--kill"> and "kill query" L<"--kill-query">.
On RDS these two commands are not available and are replaced by function calls.
This option modifies L<"--kill"> to use "CALL mysql.rds_kill(thread-id)" instead
and L<"--kill-query"> to use "CALL mysql.rds_kill_query(thread-id)"
=item --run-time
type: time