pt-online-schema-change can't use options port

Description

 

pt-online-schema-change --alter "ADD COLUMN \`c_name\` VARCHAR(50) COMMENT '用户名'" --print --charset=utf8 --chunk-time 0.5 --critical-load Threads_connected:200,Threads_running:200 --max-load Threads_connected:250,Threads_running:250 --recurse=1 --check-interval 1 --no-check-replication-filters --alter-foreign-keys-method=rebuild_constraints --execute --statistics --max-lag=1 --no-version-check --recursion-method=processlist --progress percentage,1 --user="yearning_admin" --password="****" --host=172.16.0.11 --port=3366 D=sre_test,t=candles

 

The DEBUG message is

 

 

Then I change the options like this

 

 

It's OK,and the DEBUG message is

  1. # OptionParser:921 4211 Description: 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.

  2. # Usage: pt-online-schema-change [OPTIONS] DSN

  3. # DSNParser:2246 4211 DSN string made from options: A=utf8,u=yearning_admin,p=****,h=172.16.0.11

  4. # DSNParser:2186 4211 Parsing A=utf8,u=yearning_admin,p=****,h=172.16.0.11

  5. # DSNParser:2205 4211 Finding value for S

  6. # DSNParser:2215 4211 Copying value for S from defaults

  7. # DSNParser:2205 4211 Finding value for F

  8. # DSNParser:2215 4211 Copying value for F from defaults

  9. # DSNParser:2205 4211 Finding value for A

  10. # DSNParser:2205 4211 Finding value for P

  11. # DSNParser:2215 4211 Copying value for P from defaults

  12. # DSNParser:2205 4211 Finding value for u

  13. # DSNParser:2205 4211 Finding value for p

  14. # DSNParser:2205 4211 Finding value for h

  15. # DSNParser:2205 4211 Finding value for D

  16. # DSNParser:2215 4211 Copying value for D from defaults

  17. # DSNParser:2205 4211 Finding value for t

  18. # DSNParser:2215 4211 Copying value for t from defaults

  19. # DSNParser:2299 4211 DBI:mysql:sre_test;host=172.16.0.11;port=3366;charset=utf8;mysql_read_default_group=client

  20. # DSNParser:2348 4211 DBI:mysql:sre_test;host=172.16.0.11;port=3366;charset=utf8;mysql_read_default_group=client yearning_admin ***** mysql_enable_utf8=>1, ShowErrorStatement=>1, AutoCommit=>1, RaiseError=>1, PrintError=>0

  21. # DSNParser:2377 4211 DBI::db=HASH(0x17c4858) /!40101 SET NAMES "utf8"/ # DSNParser:2382 4211 Enabling charset for STDOUT

  22. # DSNParser:2529 4211 DBI::db=HASH(0x17c4858) SET SESSION innodb_lock_wait_timeout=1

  23. # DSNParser:2529 4211 DBI::db=HASH(0x17c4858) SET SESSION lock_wait_timeout=60

  24. # DSNParser:2529 4211 DBI::db=HASH(0x17c4858) SET SESSION wait_timeout=10000

  25. # DSNParser:2397 4211 DBI::db=HASH(0x17c4858) SELECT @@SQL_MODE

Environment

None

Attachments

2

Activity

Show:

Donovan Hubbard 
May 19, 2023 at 3:56 PM

This bug still exists in version 3.5.1

binger 
November 23, 2020 at 1:50 PM

Ok.Thinks.Wish all the best wishes for you.

Lalit Choudhary 
November 23, 2020 at 1:29 PM

For now, as a workaround use port as follows in your pt-online-schema-changes command,
--host=172.16.0.11 D=sre_test,t=candles,P=3366
Will fix this bug in the Percona toolkit,  and you can use the fixed version pt-osc  binary in the toolkit you are using (like Yearning)

Till the time we are fixing this use the workaround method to mentioned mysql port. 

binger 
November 23, 2020 at 1:01 PM

For safety,I have change mysql port. And some toolkit,like [Yearning|https://github.com/cookieY/Yearning   ,used pt-osc. Can you repair this issue? Think you.|https://github.com/cookieY/Yearning],using]

Lalit Choudhary 
November 23, 2020 at 11:30 AM

Hi

Thank you for the report.

Verified as described.

Issue reproducible with --port option when using non-default port, with 3306 port it works fine.

 

Test:

--port=3306  (Working when using default mysql port)

 

 

 

changed mysqld port to 3306:

No issue for mysql connectivity with mysql client.

PTDEBUG:

 

 

Done

Details

Assignee

Reporter

Priority

Affects versions

Fix versions

Created November 23, 2020 at 4:20 AM
Updated March 27, 2025 at 7:03 PM
Resolved March 15, 2024 at 11:09 PM