[MDEV-33378] Slave aborts with Internal MariaDB error code: 1452 and HA_ERR_NO_REFERENCED_ROW on FK constraint Created: 2024-02-03 Updated: 2024-02-05 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Affects Version/s: | 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2, 11.3, 11.4 |
| Fix Version/s: | 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2, 11.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Roel Van de Paar | Assignee: | Andrei Elkin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||
| Description |
|
This looks like a major failure in replication. Please review and adjust prio as needed.
Leads to:
|
| Comments |
| Comment by Roel Van de Paar [ 2024-02-03 ] | ||||||||||||||||||||||||||||||||
|
The master sees no FK issue:
Though, importantly, notice the missing FK from the table definition. | ||||||||||||||||||||||||||||||||
| Comment by Roel Van de Paar [ 2024-02-03 ] | ||||||||||||||||||||||||||||||||
|
MTR Does not readily reproduce the issue. Please use CLI.
| ||||||||||||||||||||||||||||||||
| Comment by Kristian Nielsen [ 2024-02-03 ] | ||||||||||||||||||||||||||||||||
|
I'm guessing this is because the table is created as the default storage engine on the slave (which is probably InnoDB on the CLI but MyISAM in mtr). Foreign key constraints are ignored in MyISAM, but enforced in InnoDB (and the INSERT violates the constraint). It's supported to have different storage engine on the slave from the master (and this can then cause errors like this). | ||||||||||||||||||||||||||||||||
| Comment by Roel Van de Paar [ 2024-02-05 ] | ||||||||||||||||||||||||||||||||
|
Thank you Kristian for the input. I checked further: > Maybe the sql_mode='',enforce_storage_engine=MyISAM is replicated incorrectly? |