pt-online-schema-change exited with error "...uninitialized value $mode..."

Hi

I used pt-online-schema-change to alter a table to ROW_FORMAT=COMPRESSED. Ultimately, it ran successfully, but it did exit with an error. Perhaps this was because it could not connect to the slave server. (Note: the alter table was replcated to the slave without any problems.)

I will probably use pt-online-schema-change in the future so I would like to eliminate this potential bug or, if the fault is mine, get some confirmation so I can RTFM again and do it correctly. :wink:

Here’s what I ran:

ryant@wgcptdb3:~$ time pt-online-schema-change --recursion-method processlist --alter-foreign-keys-method auto --execute --alter “ROW_FORMAT=COMPRESSED” D=wfs,t=gateway_audit_trail,h=localhost,u=xxx,p=xxx
Cannot connect to D=wfs,h=SLAVEIP,p=…,u=xxx
No slaves found. See --recursion-method if host YYYYY has slaves.
Not checking slave lag because no slaves were found and --check-slave-lag was not specified.
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
Child tables:
wfs.auth_audit_trail (approx. 428865 rows)
wfs.product_audit_trail (approx. 1268930 rows)
Will automatically choose the method to update foreign keys.
Altering wfs.gateway_audit_trail
Creating new table…
Created new table wfs._gateway_audit_trail_new OK.
Altering new table…
Altered wfs._gateway_audit_trail_new OK.
2015-07-22T22:53:16 Creating triggers…
2015-07-22T22:53:17 Created triggers OK.
2015-07-22T22:53:17 Copying approximately 9862776 rows…
Copying wfs.gateway_audit_trail: 0% 01:35:09 remain
Copying wfs.gateway_audit_trail: 0% 01:42:34 remain
Copying wfs.gateway_audit_trail: 1% 01:48:35 remain
Copying wfs.gateway_audit_trail: 1% 01:51:39 remain
Copying wfs.gateway_audit_trail: 2% 01:57:06 remain
Copying wfs.gateway_audit_trail: 2% 01:58:26 remain



Copying wfs.gateway_audit_trail: 99% 00:37 remain
Copying wfs.gateway_audit_trail: 99% 00:06 remain
2015-07-23T04:11:35 Copied rows OK.
2015-07-23T04:11:35 Max rows for the rebuild_constraints method: 1316
Determining the method to update foreign keys…
2015-07-23T04:11:35 wfs.auth_audit_trail: too many rows: 428945; must use drop_swap
2015-07-23T04:11:35 Drop-swapping tables…
2015-07-23T04:12:09 Dropped and swapped tables OK.
Not dropping old table because --no-drop-old-table was specified.
2015-07-23T04:12:09 Dropping triggers…
2015-07-23T04:12:09 Dropped triggers OK.
Successfully altered wfs.gateway_audit_trail.

Exiting on SIGPIPE.

(in cleanup) Use of uninitialized value $mode in numeric eq (==) at /usr/bin/pt-online-schema-change line 7845.

real 318m57.881s
user 0m57.836s
sys 0m6.304s

Versions:

ryant@wgcptdb3:~$ pt-online-schema-change --version
pt-online-schema-change 2.2.14

ryant@wgcptdb3:~$ mysqladmin version
mysqladmin Ver 8.42 Distrib 5.5.34, for debian-linux-gnu on x86_64
Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Server version 5.5.34-0ubuntu0.12.04.1-log
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/run/mysqld/mysqld.sock
Uptime: 637 days 3 hours 54 min 4 sec

Thanks,
Ryan

Can you please run pt-table-online-schema-change tool with PTDEBUG option as below:

$ PTDEBUG > pt-osc.log 2>&1

And provide the related output from pt-osc.log. PTDEBUG will run the tool and will capture lots of debugging output and it will help to identify what causing the problem. My initial suspect it was problem with --recursion-method what is the reason to use --recursion-method ? Is your slaves running on non-default port i.e. other than port 3306 ?