Good morning,
If this belongs in the polyglot section, I apologize, but my issue is specific to MySQL 8. We’ve recently upgraded from MySQL 5.7 to MySQL 8 (Running in RDS Aurora 3.05.1). On 5.7, pt-ost worked as expected. We need to use it now on 8 to alter a very large online table. When I do a --dry-run, it connects to the DB and everything looks fine (sensitive data redacted):
[jbuscemi@ip-172-17-20-32 ~]$ pt-online-schema-change --alter "ADD INDEX idx_uuid (uuid)" D=reviews,t=test_reviews,P=3306,h=k8s-qa-****.rds.amazonaws.com -u ***** -p ******* --dry-run --print
Operation, tries, wait:
analyze_table, 10, 1
copy_rows, 10, 0.25
create_triggers, 10, 1
drop_triggers, 10, 1
swap_tables, 10, 1
update_foreign_keys, 10, 1
Starting a dry run. `reviews`.`test_reviews` will not be altered. Specify --execute instead of --dry-run to alter the table.
.
.
.
DROP TABLE IF EXISTS `reviews`.`_test_reviews_new`;
2024-01-19T18:53:48 Dropped new table OK.
Dry run complete. `reviews`.`test_reviews` was not altered.
But when I switch to --execute, pt-ost fails to connect, hangs, times out, and throws this error (sensitive data redacted):
Can't call method "selectrow_array" on an undefined value at /usr/bin/pt-online-schema-change line 4372.
When I check iftop, I see no connection to the DB and a stack trace shows it hanging:
[root@ip-172-17-20-32 ~]# strace -p 2352
strace: Process 2352 attached
connect(5, {sa_family=AF_INET, sin_port=htons(3306), sin_addr=inet_addr("10.*.*.*")}, 16
If I run the same pt-ost command with --dry-run, iftop shows the expected connection and the stack trace shows activity.
I am running the Percona Toolkit in a fully-updated Amazon Linux 2 instance that I spun up yesterday to remove any variables besides pt, mysql, and the OS. The EPEL, mysql80-community-release-el7-5.noarch.rpm and percona-release-latest.noarch.rpm repositories are installed and the Percona Toolkit and mysql client were installed via yum:
5.10.205-195.804.amzn2.x86_64
[root@ip-172-17-20-32 yum.repos.d]# mysql --version
mysql Ver 8.0.36 for Linux on x86_64 (MySQL Community Server - GPL)
[root@ip-172-17-20-32 yum.repos.d]# pt-online-schema-change --version
pt-online-schema-change 3.5.7
[root@ip-172-17-20-32 yum.repos.d]# openssl version
OpenSSL 1.0.2k-fips 26 Jan 2017
Would anyone know why --execute fails to connect but --dry-run works and how I can fix the problem? Thank you.