Does row-based replication with “binlog_row_image=minimal” cause issues when ALTER TABLE reorders columns?

dba.stackexchange https://dba.stackexchange.com/questions/286607

  •  17-03-2021
  •  | 
  •  

Just trying to get my head around the caveats of using binlow_row_image=minimal with row-based replication in MySQL 8.0.23... To avoid silent data drift, the requirements seem to be that:

  1. All tables need a primary key in both databases, which is identical for each pair of tables.
  2. All tables need to have the same number and type of columns, in the correct order, in both databases.

Given the above, if an ALTER TABLE for example deleted a column, could you ever have a race condition where replication of pending binlog events which insert rows into that table would break? Would this only happen if you used something like slave_parallel_workers, or would even that be safe?

I'm trying to figure out if this is worth using or if it's more performance tweak when you don't require hard data consistency.

有帮助吗?

解决方案

Parallel replication allows concurrent transactions out of order, but does not allow concurrent non-transactional updates. Certain SQL statements — including DDL statements — cannot be rolled back, so they cause a "barrier" such that they wait until all parallel workers catch up, and workers are blocked from executing changes after the non-transactional change.

This means there's no race condition. DDL effectively forces a kind of "synchronization".

许可以下: CC-BY-SA归因
不隶属于 dba.stackexchange
scroll top