Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Incomplete
-
10.2.8
-
Server version: 10.2.8-MariaDB-10.2.8+maria~stretch-log mariadb.org binary distribution
OS: Debian Stretch
Description
This is the same issue I reported in MDEV-13246, opening a new issue as the old one was closed as fixed and I'm still experiencing the issue with the latest stable release.
MariaDB [esportal]> show create table matchmaking_match; |
+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| Table | Create Table | |
+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| matchmaking_match | CREATE TABLE `matchmaking_match` ( |
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
`region_id` tinyint(1) unsigned NOT NULL, |
`inserted` int(10) unsigned NOT NULL, |
PRIMARY KEY (`id`) |
) ENGINE=InnoDB AUTO_INCREMENT=47381 DEFAULT CHARSET=utf8 | |
+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
1 row in set (0.00 sec) |
|
MariaDB [esportal]> show create table matchmaking_match_users; |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| Table | Create Table | |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| matchmaking_match_users | CREATE TABLE `matchmaking_match_users` ( |
`matchmaking_match_id` bigint(20) unsigned NOT NULL, |
`user_id` int(10) unsigned NOT NULL, |
`team` tinyint(1) unsigned NOT NULL, |
`accepted` tinyint(1) unsigned NOT NULL DEFAULT 0, |
PRIMARY KEY (`matchmaking_match_id`,`user_id`), |
UNIQUE KEY `mmu_user_id` (`user_id`), |
CONSTRAINT `matchmaking_match_users_ibfk_1` FOREIGN KEY (`matchmaking_match_id`) REFERENCES `matchmaking_match` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, |
CONSTRAINT `matchmaking_match_users_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 | |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
1 row in set (0.00 sec) |
|
MariaDB [esportal]> select * from matchmaking_match_users where matchmaking_match_id not in (select id from matchmaking_match); |
+----------------------+-----------+------+----------+ |
| matchmaking_match_id | user_id | team | accepted |
|
+----------------------+-----------+------+----------+ |
| 45220 | 11179195 | 2 | 1 |
|
| 45220 | 16004445 | 1 | 1 |
|
| 45220 | 17375835 | 2 | 1 |
|
| 45220 | 19416596 | 2 | 1 |
|
| 45220 | 36791488 | 1 | 0 |
|
| 45220 | 42131544 | 1 | 1 |
|
| 45220 | 299652215 | 1 | 0 |
|
+----------------------+-----------+------+----------+ |
7 rows in set (0.00 sec) |
|
MariaDB [esportal]> delete from matchmaking_match_users where matchmaking_match_id not in (select id from matchmaking_match); |
Query OK, 7 rows affected (0.00 sec) |
|
MariaDB [esportal]>
|
To answer questions which were asked in the previous issue:
- I have never disabled foreign key checks.
- The most recent DDL was weeks before.
- I don't know how to reproduce it.
I didn't have binlogs enabled when it happened.(EDIT: I did have binlogs enabled)- I'm not using a cluster, it's a single machine database.
I have attached my.cnf.
Attachments
Issue Links
- relates to
-
MDEV-15199 Triangular FKs - Cascade delete causes broken referential integrity
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
This is the same issue I reported in {code:sql} MariaDB [esportal]> show create table matchmaking_match; +-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | matchmaking_match | CREATE TABLE `matchmaking_match` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `region_id` tinyint(1) unsigned NOT NULL, `inserted` int(10) unsigned NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=47381 DEFAULT CHARSET=utf8 | +-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) MariaDB [esportal]> show create table matchmaking_match_users; +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | matchmaking_match_users | CREATE TABLE `matchmaking_match_users` ( `matchmaking_match_id` bigint(20) unsigned NOT NULL, `user_id` int(10) unsigned NOT NULL, `team` tinyint(1) unsigned NOT NULL, `accepted` tinyint(1) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`matchmaking_match_id`,`user_id`), UNIQUE KEY `mmu_user_id` (`user_id`), CONSTRAINT `matchmaking_match_users_ibfk_1` FOREIGN KEY (`matchmaking_match_id`) REFERENCES `matchmaking_match` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `matchmaking_match_users_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 | +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) MariaDB [esportal]> select * from matchmaking_match_users where matchmaking_match_id not in (select id from matchmaking_match); +----------------------+-----------+------+----------+ | matchmaking_match_id | user_id | team | accepted | +----------------------+-----------+------+----------+ | 45220 | 11179195 | 2 | 1 | | 45220 | 16004445 | 1 | 1 | | 45220 | 17375835 | 2 | 1 | | 45220 | 19416596 | 2 | 1 | | 45220 | 36791488 | 1 | 0 | | 45220 | 42131544 | 1 | 1 | | 45220 | 299652215 | 1 | 0 | +----------------------+-----------+------+----------+ 7 rows in set (0.00 sec) MariaDB [esportal]> delete from matchmaking_match_users where matchmaking_match_id not in (select id from matchmaking_match); Query OK, 7 rows affected (0.00 sec) MariaDB [esportal]> {code} To answer questions which were asked in the previous issue: * I have never disabled foreign key checks. * The most recent DDL was weeks before. * I don't know how to reproduce it. * I didn't have binlogs enabled when it happened. * I'm not using a cluster, it's a single machine database. I have attached my.cnf. |
This is the same issue I reported in {code:sql} MariaDB [esportal]> show create table matchmaking_match; +-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | matchmaking_match | CREATE TABLE `matchmaking_match` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `region_id` tinyint(1) unsigned NOT NULL, `inserted` int(10) unsigned NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=47381 DEFAULT CHARSET=utf8 | +-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) MariaDB [esportal]> show create table matchmaking_match_users; +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | matchmaking_match_users | CREATE TABLE `matchmaking_match_users` ( `matchmaking_match_id` bigint(20) unsigned NOT NULL, `user_id` int(10) unsigned NOT NULL, `team` tinyint(1) unsigned NOT NULL, `accepted` tinyint(1) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`matchmaking_match_id`,`user_id`), UNIQUE KEY `mmu_user_id` (`user_id`), CONSTRAINT `matchmaking_match_users_ibfk_1` FOREIGN KEY (`matchmaking_match_id`) REFERENCES `matchmaking_match` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `matchmaking_match_users_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 | +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) MariaDB [esportal]> select * from matchmaking_match_users where matchmaking_match_id not in (select id from matchmaking_match); +----------------------+-----------+------+----------+ | matchmaking_match_id | user_id | team | accepted | +----------------------+-----------+------+----------+ | 45220 | 11179195 | 2 | 1 | | 45220 | 16004445 | 1 | 1 | | 45220 | 17375835 | 2 | 1 | | 45220 | 19416596 | 2 | 1 | | 45220 | 36791488 | 1 | 0 | | 45220 | 42131544 | 1 | 1 | | 45220 | 299652215 | 1 | 0 | +----------------------+-----------+------+----------+ 7 rows in set (0.00 sec) MariaDB [esportal]> delete from matchmaking_match_users where matchmaking_match_id not in (select id from matchmaking_match); Query OK, 7 rows affected (0.00 sec) MariaDB [esportal]> {code} To answer questions which were asked in the previous issue: * I have never disabled foreign key checks. * The most recent DDL was weeks before. * I don't know how to reproduce it. * -I didn't have binlogs enabled when it happened.- (*EDIT:* I did have binlogs enabled) * I'm not using a cluster, it's a single machine database. I have attached my.cnf. |
Labels | need_feedback |
Labels | need_feedback |
Labels | need_feedback |
Fix Version/s | N/A [ 14700 ] | |
Resolution | Cannot Reproduce [ 5 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Resolution | Cannot Reproduce [ 5 ] | |
Status | Closed [ 6 ] | Stalled [ 10000 ] |
Labels | need_feedback |
Fix Version/s | N/A [ 14700 ] |
Status | Stalled [ 10000 ] | Open [ 1 ] |
Link |
This issue relates to |
Labels | need_feedback |
Labels | need_feedback |
Labels | need_feedback |
Fix Version/s | N/A [ 14700 ] | |
Resolution | Incomplete [ 4 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 82758 ] | MariaDB v4 [ 152882 ] |
Actually it looks like I did have binlogs enabled this time. Although I'm not familiar with the tooling around binlogs, I'll try to figure out how to create a minimal case to reproduce.