LP #1460783: pt-online-schema-change - using dsn only picks up last IP address given

Description

**Reported in Launchpad by Dave Gregg last update 02-06-2015 18:40:24

We have a Master and 2 Slaves

Master = 192.168.192.138
Slave 1 = 192.168.192.137
Slave 2 = 192.168.192.136

When issuing the following....

pt-online-schema-change h=192.168.192.138,h=192.168.192.137,h=192.168.192.136,D=menagerie,t=MyGuests --check-interval=5 --max-lag=10 --alter "modify email varchar(256);" --execute

it appears to only pick up the last IP address in the string - i.e. -> "h=192.168.192.136" (which is a slave) and only modifies the
schema on that system. Debug shows an empty DSN string ??

Is this only suppose to connect to the MASTER — ? and thus find the Slaves from that

I see in the documentation - it specifies to have multiple IP addresses in the "table" - if you want to monitor the hosts for REPLICATION LAG time. So are we suppose to only utilize the MASTER IP Address on the command line?

i.e. - like this ?
pt-online-schema-change h=192.168.192.138,D=menagerie,t=MyGuests --check-interval=5 --max-lag=10 --alter "modify email varchar(256);" --execute

Environment

None

Smart Checklist

Activity

Show:

lpjirasync January 24, 2018 at 8:41 PM

**Comment from Launchpad by: Frank Cizmich on: 02-06-2015 18:33:23

Hello Dave,

Yes, you are only supposed to specify the Master IP. The tool will perform the changes there.
It will also , by default, automatically detect all slaves to check for lag, and pause if it detects lag.

Almost all of this behaviour can be altered with the options, like you did in your example.

--check-interval=5 will make it pause for 5 seconds (instead of the default 1) if it detects lag.
--max-lag=10 will only pause the tool if lag is greater than 10, (instead of the default 1)

If you only want to check for lag in one slave and ignore others, you can specify it with --check-slave-lag <dsn>

Finally there is the --recursion-method , which simply specifies which method to use to detect slaves. This option is not required as it has default values which usually work well.
It is here where you probably saw the special DSN method to specify which slaves to monitor.
You usually do not have to worry about this unless you are having trouble detecting slaves or only want to monitor a subset of slaves.

Regards

Not a Bug

Details

Assignee

Reporter

Priority

Smart Checklist

Created January 24, 2018 at 8:40 PM
Updated February 3, 2018 at 11:51 PM
Resolved January 24, 2018 at 8:41 PM