# A MySQL upgrade went wrong: replica IDs diverged and one table pointed to wrong rows

Original title: A safe MySQL upgrade that wasn't so safe

> Hacker News story 49492488 · language: en · submitted 2026-08-29
> Web version: https://zeli.app/story/49492488
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 50 · by [el1s7](<https://news.ycombinator.com/user?id=el1s7>) · 💬 19
[original](<https://blog.elis.cc/articles/a-safe-mysql-upgrade-that-wasnt-so-safe/>) · [HN discussion](<https://news.ycombinator.com/item?id=49492488>)

## Summary

A developer upgraded a MySQL database replica and switched over, only to discover an hour later that one table's auto-increment IDs didn't match the source. Five related tables correctly referenced the new IDs, but a sixth used IDs from the old database, pointing to entirely different rows. The root cause: the source used MIXED binary logging. For most tables, the UPDATE statement was replicated in STATEMENT mode, but for the table with an AUTO_INCREMENT column, MySQL switched to ROW mode, copying the source's ID values directly to the replica, where they were wrong.

## Key quote

> The scary thing about this kind of issue is that it’s unexpected and easy to miss, but it can quickly turn into a disaster in production, and you’re left wondering how did things end up like that.

## HN discussion (19 comments)

### [Insimwytim](<https://news.ycombinator.com/item?id=49493888>)

> That's kinda fun (not in a fun way).
>
> Since the update is done semi-automatically by the means of AWS RDS, does AWS takes any responsibility for that? Unless this use case is warned against in migration notes, I would think they ought to.

### [190n](<https://news.ycombinator.com/item?id=49494713>)

> I don't understand why this issue only appeared after the upgrade, not immediately after the migration to add the column?

### [krautburglar](<https://news.ycombinator.com/item?id=49494105>)

> Mixing binlog formats across replicas sounds like user error to me.

---

## Cite

- Page: https://zeli.app/story/49492488
- Date: 2026-08-29
- Source: blog.elis.cc (https://blog.elis.cc/articles/a-safe-mysql-upgrade-that-wasnt-so-safe/)
- Hacker News: https://news.ycombinator.com/item?id=49492488

## Other languages

- zh: https://zeli.app/zh/story/49492488 · markdown: https://zeli.app/zh/story/49492488.md
- ja: https://zeli.app/ja/story/49492488 · markdown: https://zeli.app/ja/story/49492488.md
- ko: https://zeli.app/ko/story/49492488 · markdown: https://zeli.app/ko/story/49492488.md
- de: https://zeli.app/de/story/49492488 · markdown: https://zeli.app/de/story/49492488.md
- es: https://zeli.app/es/story/49492488 · markdown: https://zeli.app/es/story/49492488.md
- ru: https://zeli.app/ru/story/49492488 · markdown: https://zeli.app/ru/story/49492488.md
