# Pt-online-schema-change --execute Hangs forever

**URL:** <https://forums.percona.com/t/pt-online-schema-change-execute-hangs-forever/30542>\
**Category:** Percona Toolkit\
**Tags:** mysql, percona\
**Created:** [May 24, 2024, 10:30am UTC](https://forums.percona.com/t/pt-online-schema-change-execute-hangs-forever/30542 "2024-05-24T10:30:34Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Federico\_Bau](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/federico_bau/32/16575_2.png) [@Federico\_Bau](https://forums.percona.com/u/Federico_Bau)\
**Post date:** [May 25, 2024, 5:32am UTC](https://forums.percona.com/t/pt-online-schema-change-execute-hangs-forever/30542/3 "2024-05-25T05:32:00Z")

</div>

#### TLDR;

Adding `--recursion-method=NONE` to the command made the trick. And I think is 99% due to my local setup (which is wsl in Windows, with lot of other fun stuff…)  
So the full command that works for me is

```auto
pt-online-schema-change --host localhost --user root --ask-pass --alter "ADD ALTER entries__expire (expire)" D=mydatabase,t=entries --execute --print --recursion-method=NONE

```

I won’t close yet the answer because maybe you want to reply already but is solved and tool works fantasticly, I can add this index and drop it (rollback) seamingly

#### Long Explanation

Hi @Ivan_Groenewold , first of all thank you for your answer. I was asking if i was doing something obviously wrong. I was already checking with `show processlist`.  
Checking it better though I found out few interesting thing when I went down the rabbit hole.

1. Running `pt-online-schema-change` command which hangs
2. In a separate terminal `watch -n1 "mysql -uroot -padmin -e 'SHOW PROCESSLIST;'"`

I couldn’t see much but sometimes I could, for just few seconds `SELECT @@SERVER_ID`  
I Goolge it with the tool name and I came across this other answer [Pt-online-schema-change not working as expected - #6 by matthewb](https://forums.percona.com/t/pt-online-schema-change-not-working-as-expected/13444/6)  
Where @matthewb talks about adding `PTDEBUG=1` to the command,

```auto
PTDEBUG=1 pt-online-schema-change --host localhost --user root --ask-pass --alter "ADD ALTER entries__expire (expire)" D=mydatabase,t=entries --execute --print -

```

Then I could see that, It stopped at `# MasterSlave:4350 12721 SELECT @@SERVER_ID`  
(cropped) output

```auto
# Cxn:3988 12721 DBI::db=HASH(0x556404217a70) Setting dbh
# Cxn:3993 12721 DBI::db=HASH(0x556404217a70) SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id
# Cxn:3995 12721 DBI::db=HASH(0x556404217a70) hostname: localhost 0
# Cxn:3981 12721 DBI::db=HASH(0x556404217a70) Connected dbh to localhost h=localhost
# Percona::XtraDB::Cluster:8279 12721 localhost SHOW VARIABLES LIKE 'wsrep_on'
# Percona::XtraDB::Cluster:8281 12721 $VAR1 = undef;
#
# VersionParser:2033 12721 VersionParser got a dbh, trying to get the version
# VersionParser:2081 12721 InnoDB support: DEFAULT
# VersionParser:2093 12721 InnoDB version: 5.7.42
# pt_online_schema_change:8841 12721 innodb_stats_persistent is ON, enabling --analyze-before-swap
# MasterSlave:4304 12721 Recursion methods: processlist hosts
# MasterSlave:4350 12721 SELECT @@SERVER_ID

```

So I Google (something again, not sure how I found it) and I found this answer here where it should use `--recursion-method=NONE `

> [@Pt-online-schema-change --execute fails to connect after MySQL 8 upgrade, but --dry-run still works](https://forums.percona.com/t/pt-online-schema-change-execute-fails-to-connect-after-mysql-8-upgrade-but-dry-run-still-works/27897/6):
>
> Hi, I found around for this : pt-online-schema-change is PERL script and you can edit it see line 2340, after “my $tries = 2;” something is wrong with $cxn\_string - it include strange IP address. I don’t know where this is getting IP, because it is not nslookup of RDS URL (also not of RDS replica) first I add “print “\nConnect string before : $cxn\_string\n”;” after “my $tries = 2;” (line 2341) after getting this value, I tool IP address and replace it with my primary RDS hostname example : “$…

Nothing I add all of this infomation since it could be useful to someone in the future 😉

---

_[View the full topic](https://forums.percona.com/t/pt-online-schema-change-execute-hangs-forever/30542)._
