vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.18k stars 2.06k forks source link

Reverse workflows fail in some MoveTables workflows in FKManaged clusters #16296

Open rohit-nayak-ps opened 1 week ago

rohit-nayak-ps commented 1 week ago

Overview of the Issue

In MoveTables imports for databases with foreign keys, after switching traffic, the reverse workflow breaks in some setups. One such is:

shlomi-noach commented 5 days ago

I'm not sure I follow the explanation:

The user decides then to drop some of the foreign key constraints

On the source or on the target? In my understanding this is on the target.

The related RowEvent has the foreign_key_checks ON because of the global setting.

Didn't the user just change the global setting to OFF? So why would the even have FK checks ON?

I feel like the problem here is that the user creates an inconsistency between target (where they dropped the constraints) and the source (where constraints still exist). Why would we expect revert replication to work in this scenario?