Invalid recursion method: t=dsns

Bug #1523685 reported by Fernando Laudares Camargos
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Critical
Frank Cizmich

Bug Description

Whie testing 2.2.16:

~/percona-toolkit-2.2.16$ PTDEBUG=1 bin/pt-online-schema-change --execute --user=msandbox --password=msandbox --socket=/tmp/mysql_sandbox27075.sock --recursion-method="dsn=D=percona,t=dsns" --alter "add column familyname varchar(10) default null" D=fernando,t=t1 2> ~/pt-osc.out
Usage: pt-online-schema-change [OPTIONS] DSN

Errors in command-line arguments:
  * Invalid --recursion-method: Invalid recursion method: t=dsns

pt-online-schema-change alters a table's structure without blocking reads or
writes. Specify the database and table in the DSN. Do not use this tool before
reading its documentation and checking your backups carefully. For more
details, please use the --help option, or try 'perldoc
bin/pt-online-schema-change' for complete documentation.

However PTDEBUG clearly shows:

# Arguments: _[--execute]_ _[--user=msandbox]_ _[--password=msandbox]_ _[--socket=/tmp/mysql_sandbox27075.sock]_ _[--recursion-method=dsn=D=percona,t=dsns]_ _[--alter]_ _[add column familyname varchar(10) default null]_ _[D=fernando,t=t1]_
(...)
# OptionParser:556 5375 Got option recursion-method = dsn=D=percona,t=dsns

Tags: i63032 i63124
Revision history for this message
Fernando Laudares Camargos (fernando-laudares) wrote :

Customer noted (adapted to the example above):

"I did a brief look at the source, the problem lies in:

foreach my $method ( @$methods ) {
die "Invalid recursion method: " . ($method || 'undef') . "\n"
unless $method && $method =~ m/^(?:processlist$|hosts$|none$|cluster|dsn=)/i;
}

the method somehow is "dsn=D=percona", "t=dsns", and the second one does not pass the test. There is one dsn method which is "dsn=D=percona,t=dsns", somehow the comma is interpreted as the separation of two DSN methods."

tags: added: i63032
Revision history for this message
Jericho Rivera (jericho-rivera) wrote :

Confirmed on pt-osc version 2.2.16, not reproducible in version 2.2.15:

[root@master1 ~]# ./pt-online-schema-change --recursion-method=dsn=D=percona,t=dsns --alter "ADD foo1 tinyint(1) default 0 NOT NULL" u=root,p=<pass>,D=test,t=t1 --dry-run; ./pt-online-schema-change --version
Usage: pt-online-schema-change [OPTIONS] DSN

Errors in command-line arguments:
  * Invalid --recursion-method: Invalid recursion method: t=dsns

pt-online-schema-change alters a table's structure without blocking reads or
writes. Specify the database and table in the DSN. Do not use this tool before
reading its documentation and checking your backups carefully. For more
details, please use the --help option, or try 'perldoc
./pt-online-schema-change' for complete documentation.
pt-online-schema-change 2.2.16

[root@master1 ~]# pt-online-schema-change --recursion-method=dsn=D=percona,t=dsns --alter "ADD foo1 tinyint(1) default 0 NOT NULL" u=root,p=<pass>,D=test,t=t1 --dry-run; pt-online-schema-change --version
Operation, tries, wait:
  copy_rows, 10, 0.25
  create_triggers, 10, 1
  drop_triggers, 10, 1
  swap_tables, 10, 1
  update_foreign_keys, 10, 1
Starting a dry run. `test`.`t1` will not be altered. Specify --execute instead of --dry-run to alter the table.
Creating new table...
Created new table test._t1_new OK.
Altering new table...
Altered `test`.`_t1_new` OK.
2015-12-07T19:16:30 Dropping new table...
2015-12-07T19:16:30 Dropped new table OK.
Dry run complete. `test`.`t1` was not altered.
The new table `test`.`_t1_new` does not have a PRIMARY KEY or a unique index which is required for the DELETE trigger.
pt-online-schema-change 2.2.15

Changed in percona-toolkit:
status: New → Confirmed
Jaime Sicam (jssicam)
tags: added: i63124
Changed in percona-toolkit:
status: Confirmed → In Progress
importance: Undecided → Critical
assignee: nobody → Frank Cizmich (frank-cizmich)
milestone: none → 2.2.17
Revision history for this message
Frank Cizmich (frank-cizmich) wrote :

Meanwhile here's a patch, to be applied to pt-online-schema-change

Changed in percona-toolkit:
status: In Progress → Fix Committed
Changed in percona-toolkit:
status: Fix Committed → Fix Released
Revision history for this message
Sveta Smirnova (svetasmirnova) wrote :

lp:1545879 was marked as duplicate of this one.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-270

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.