Not the answer you need?
Register and ask your own question!

pt-archiver errors with unique key violation

jessepjessep EntrantCurrent User Role Beginner
I have a large table, that I need to do some schema changes to, and figured the easiest way would be to create a new table, migrate the data over, and then rename. I can stop the flow of data into it in the meantime (MySQL event) so no issue there.

Source and target table schema differ as follows:
-Added a primary key to target (BIGINT auto_increment, and a datetime column that is included in my partitioning function).
-Dropped some columns that were in the source table but are not required (moved from BIGINT to INT a while ago, and need to remove the redundant columns).
-Added one tinyint column to new table with a default value of 1

When running the following command, it errors after a few thousand rows, complaining of a UNIQUE key violation, however the key data specified only exists once in the source table.

I've tried manually specifying the columns to copy, which didn't do any good.

Also tried --replace and --ignore, both give me a subset of my rows.

Both source and target tables are partitioned by TO_DAYS()

# /root/percona-toolkit-2.1.8/bin/pt-archiver --no-check-columns --no-check-charset --limit=1000 --no-delete --progress=1000 --statistics --source h=localhost,D=mydb,t=summary_hourly --dest h=localhost,D=mydb,t=summary_hourly_new --where="1=1"

Is something about what i'm trying to do not supported by pt-archiver?

Thanks,
Jesse
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.