Pt-osc change --host value from localhost to IP

Hi, This is pt-osc options which I used.
pt-online-schema-change --alter “XXX” D=XX,t=XX
–no-drop-old-table
–no-drop-new-table
–chunk-size=1000
–max-lag=10
–recursion-method=processlist
–defaults-file=XXX
–socket=XXX
–host=localhost
–port=20306
–user=user
–password=XXX
–progress=time,30
–max-load=“Threads_running=20”
–critical-load=“Threads_running=50”
–tries create_triggers:1:0.5
–chunk-index=PRIMARY
–charset=utf8mb4
–set-vars=“lock_wait_timeout=1,innodb_lock_wait_timeout=1,transaction_isolation=‘repeatable-read’,binlog_format=‘row’”
–statistics
–print
–execute

When I use pt-osc with recursion-method=processlist, the host changed from localhost to XXX
(This issue not occur with recursion-method=none)

With PTDEBUG=1, I found thant

MasterSlave:4408 71730 Recursing from A=utf8mb4,D=XXX,F=XXX,S=XXX,h=localhost,p=…,t=XX,u=user to A=utf8mb4,F=XXX,S=XXX,h=10.X.X.X ,p=…,u=user

Can I know why this problem occur and solution for this?

fyi) percona toolkit version is 3.5.7-1
When I create user ‘user’@‘10.X.X.X’ and use recursion-method=processlist,
the error message is

“Error while waiting for replica lag: Use of uninitialized value in string eq at /usr/bin/pt-online-schema-change line 4357.
(in cleanup) Use of uninitialized value in string eq at /usr/bin/pt-online-schema-change line 4357.”

There is no problem. pt-osc connects to localhost:20306 and runs 'SHOW PROCESSLIST" looking for binlog connections (ie: replicas). Whatever IP:PORT is in the processlist, that is what pt-osc will use. If this does not work for you, look at the documentation for using --recursion-method=dsn

If only ‘user’@‘localhost’ exist in MySQL, pt-osc can’t connect to MySQL server because it’s host changed from localhost to ip(e.g, 10.x.x.x)
(Cannot connect to error occurs)

Did you mean this behavior is not problem?

pt-osc discovered you have a replica at IP 10.x.x.x, pt-osc is trying to establish a direct connection to that host to monitor replication. The user ‘user’ needs to exist on the replica with an IP matching that of the server where you are running pt-osc.