# Truncate statement runs on slave replica for a table that is ignored for replication

**URL:** <https://forums.percona.com/t/truncate-statement-runs-on-slave-replica-for-a-table-that-is-ignored-for-replication/37556>\
**Category:** MySQL & MariaDB\
**Tags:** mysql\
**Created:** [April 9, 2025, 4:23pm UTC](https://forums.percona.com/t/truncate-statement-runs-on-slave-replica-for-a-table-that-is-ignored-for-replication/37556 "2025-04-09T16:23:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh\_fullbay](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@josh\_fullbay](https://forums.percona.com/u/josh_fullbay)\
**Post date:** [April 9, 2025, 4:23pm UTC](https://forums.percona.com/t/truncate-statement-runs-on-slave-replica-for-a-table-that-is-ignored-for-replication/37556/1 "2025-04-09T16:23:52Z")

</div>

We recently had an issue with our replication failing due to a truncate statement replicating to the slave RDS instance, despite the database the truncate statement is in is ignored in replication using replicate-ignore-db. I have looked for an answer as to why and what we could to to prevent this but I haven’t been able to find anything. Any help/advice would be greatly appreciated.

We currently use AWS RDS using MySQL version 8.0.35.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [April 9, 2025, 5:41pm UTC](https://forums.percona.com/t/truncate-statement-runs-on-slave-replica-for-a-table-that-is-ignored-for-replication/37556/2 "2025-04-09T17:41:26Z")

</div>

How was the DDL formatted? `TRUNCATE TABLE db.tableX;` or `use db; TRUNCATE TABLE tableX;`

---

<div class="post-metadata">

**Author:** ![josh\_fullbay](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@josh\_fullbay](https://forums.percona.com/u/josh_fullbay)\
**Post date:** [April 9, 2025, 5:53pm UTC](https://forums.percona.com/t/truncate-statement-runs-on-slave-replica-for-a-table-that-is-ignored-for-replication/37556/3 "2025-04-09T17:53:18Z")

</div>

```auto
TRUNCATE TABLE db.tableX;

```

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [April 9, 2025, 8:52pm UTC](https://forums.percona.com/t/truncate-statement-runs-on-slave-replica-for-a-table-that-is-ignored-for-replication/37556/4 "2025-04-09T20:52:16Z")

</div>

And on the RDS replica, when you do SHOW REPLICA STATUS\G, you can see `db` listed on ignore?

---

<div class="post-metadata">

**Author:** ![josh\_fullbay](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@josh\_fullbay](https://forums.percona.com/u/josh_fullbay)\
**Post date:** [April 9, 2025, 9:14pm UTC](https://forums.percona.com/t/truncate-statement-runs-on-slave-replica-for-a-table-that-is-ignored-for-replication/37556/5 "2025-04-09T21:14:23Z")

</div>

Yes, it is definitely there.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [April 9, 2025, 11:47pm UTC](https://forums.percona.com/t/truncate-statement-runs-on-slave-replica-for-a-table-that-is-ignored-for-replication/37556/6 "2025-04-09T23:47:05Z")

</div>

Have you reproduced this with another table? Can you create a dummy table in the same DB and reproduce?
