# Auto increment bug experienced using PT Online Schema Change on RDS

**URL:** <https://forums.percona.com/t/auto-increment-bug-experienced-using-pt-online-schema-change-on-rds/29000>\
**Category:** MySQL & MariaDB\
**Tags:** percona, mysql\
**Created:** [March 6, 2024, 4:13pm UTC](https://forums.percona.com/t/auto-increment-bug-experienced-using-pt-online-schema-change-on-rds/29000 "2024-03-06T16:13:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![seth.ammons](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/seth.ammons/32/15525_2.png) [@seth.ammons](https://forums.percona.com/u/seth.ammons)\
**Post date:** [March 6, 2024, 4:13pm UTC](https://forums.percona.com/t/auto-increment-bug-experienced-using-pt-online-schema-change-on-rds/29000/1 "2024-03-06T16:13:18Z")

</div>

Heyo Percona and MySQL experts. I’m hoping someone has some ideas on how I can either reproduce an issue or how it may have happened.

We ran Percona Toolkit’s [Online Schema Change](https://github.com/percona/percona-toolkit/blob/master/bin/pt-online-schema-change) (version 3.5.4) against our MySQL RDS instance (version 8.0.28). Shortly after running what looked like a successful collation change on a couple columns, we noticed that somehow the auto increment was off, causing lookup joins to return invalid data. Somehow the auto increment value reset to something a few thousand lower! Roughly two or three day’s worth of inserts.

I thought maybe it was MySQL 8 caching on information\_schema. It turns out someone had a similar problem a while back: [https://bugs.mysql.com/bug.php?id=91038](https://bugs.mysql.com/bug.php?id=91038) . However, we are unable to reproduce this issue. We took a snapshot, inserted a bunch or records, saw that the information\_schema’s cached value of the auto-increment was too low, ran the migration again, but this time, the new auto-increment value was correct and preserved. Beyond that, the value of information\_schema\_stats\_expiry is a day, so that doesn’t exactly line up.

Another interesting point. Unless django was eating the errors, we should have seen issues with trying to insert a record and the auto increment value already being in use and we did not see those errors in our application logs.

Anyone have suggestions, thoughts, explanations, or anything else that I can use as a lifeline to understand what happened? We can require information\_schema\_stats\_expiry = 0 on migrations, but since we can’t reproduce, we can’t say that this is the fix.

Not sure where to go from here; would love any help. Thanks and cheers!

---

<div class="post-metadata">

**Author:** ![svetasmirnova](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/svetasmirnova/32/21_2.png) [@svetasmirnova](https://forums.percona.com/u/svetasmirnova)\
**Post date:** [April 7, 2024, 10:29am UTC](https://forums.percona.com/t/auto-increment-bug-experienced-using-pt-online-schema-change-on-rds/29000/2 "2024-04-07T10:29:15Z")

</div>

Could you please share full pt-online-schema-change command you used and its output?
