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.
- relates to
-
MDEV-15199
Triangular FKs - Cascade delete causes broken referential integrity
-
-
Closed
{"report":{"fcp":732.8999999761581,"ttfb":201,"pageVisibility":"visible","entityId":63320,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"5bc37f28-dd05-4115-9d12-8dce0e3d480c","navigationType":0,"readyForUser":826.8999999761581,"redirectCount":0,"resourceLoadedEnd":790.2000000476837,"resourceLoadedStart":207.5,"resourceTiming":[{"duration":7.899999976158142,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":207.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":207.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":215.39999997615814,"responseStart":0,"secureConnectionStart":0},{"duration":8.199999928474426,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":207.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":207.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":215.89999997615814,"responseStart":0,"secureConnectionStart":0},{"duration":62.800000071525574,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":207.89999997615814,"connectEnd":207.89999997615814,"connectStart":207.89999997615814,"domainLookupEnd":207.89999997615814,"domainLookupStart":207.89999997615814,"fetchStart":207.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":207.89999997615814,"responseEnd":270.7000000476837,"responseStart":270.7000000476837,"secureConnectionStart":207.89999997615814},{"duration":113.10000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":208,"connectEnd":208,"connectStart":208,"domainLookupEnd":208,"domainLookupStart":208,"fetchStart":208,"redirectEnd":0,"redirectStart":0,"requestStart":208,"responseEnd":321.10000002384186,"responseStart":321.10000002384186,"secureConnectionStart":208},{"duration":116.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":208.20000004768372,"connectEnd":208.20000004768372,"connectStart":208.20000004768372,"domainLookupEnd":208.20000004768372,"domainLookupStart":208.20000004768372,"fetchStart":208.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":208.20000004768372,"responseEnd":324.5,"responseStart":324.5,"secureConnectionStart":208.20000004768372},{"duration":116.39999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":208.5,"connectEnd":208.5,"connectStart":208.5,"domainLookupEnd":208.5,"domainLookupStart":208.5,"fetchStart":208.5,"redirectEnd":0,"redirectStart":0,"requestStart":208.5,"responseEnd":324.89999997615814,"responseStart":324.89999997615814,"secureConnectionStart":208.5},{"duration":116.60000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":208.60000002384186,"connectEnd":208.60000002384186,"connectStart":208.60000002384186,"domainLookupEnd":208.60000002384186,"domainLookupStart":208.60000002384186,"fetchStart":208.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":208.60000002384186,"responseEnd":325.2000000476837,"responseStart":325.2000000476837,"secureConnectionStart":208.60000002384186},{"duration":197.60000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":208.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":208.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":406.39999997615814,"responseStart":0,"secureConnectionStart":0},{"duration":116.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":209,"connectEnd":209,"connectStart":209,"domainLookupEnd":209,"domainLookupStart":209,"fetchStart":209,"redirectEnd":0,"redirectStart":0,"requestStart":209,"responseEnd":325.7000000476837,"responseStart":325.7000000476837,"secureConnectionStart":209},{"duration":197.39999997615814,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":209.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":209.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":406.5,"responseStart":0,"secureConnectionStart":0},{"duration":117,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":209.20000004768372,"connectEnd":209.20000004768372,"connectStart":209.20000004768372,"domainLookupEnd":209.20000004768372,"domainLookupStart":209.20000004768372,"fetchStart":209.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":209.20000004768372,"responseEnd":326.2000000476837,"responseStart":326.2000000476837,"secureConnectionStart":209.20000004768372},{"duration":202.19999992847443,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":210.20000004768372,"connectEnd":210.20000004768372,"connectStart":210.20000004768372,"domainLookupEnd":210.20000004768372,"domainLookupStart":210.20000004768372,"fetchStart":210.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":210.20000004768372,"responseEnd":412.39999997615814,"responseStart":412.39999997615814,"secureConnectionStart":210.20000004768372},{"duration":203.19999992847443,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":210.20000004768372,"connectEnd":210.20000004768372,"connectStart":210.20000004768372,"domainLookupEnd":210.20000004768372,"domainLookupStart":210.20000004768372,"fetchStart":210.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":210.20000004768372,"responseEnd":413.39999997615814,"responseStart":413.39999997615814,"secureConnectionStart":210.20000004768372},{"duration":18.699999928474426,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":431.7000000476837,"connectEnd":431.7000000476837,"connectStart":431.7000000476837,"domainLookupEnd":431.7000000476837,"domainLookupStart":431.7000000476837,"fetchStart":431.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":431.7000000476837,"responseEnd":450.39999997615814,"responseStart":450.39999997615814,"secureConnectionStart":431.7000000476837},{"duration":206.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":453.60000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":453.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":660.1000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":213.10000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":454.39999997615814,"connectEnd":454.39999997615814,"connectStart":454.39999997615814,"domainLookupEnd":454.39999997615814,"domainLookupStart":454.39999997615814,"fetchStart":454.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":454.39999997615814,"responseEnd":667.5,"responseStart":667.5,"secureConnectionStart":454.39999997615814},{"duration":142.09999990463257,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":727.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":727.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":869.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":75.10000002384186,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":734.5,"connectEnd":734.5,"connectStart":734.5,"domainLookupEnd":734.5,"domainLookupStart":734.5,"fetchStart":734.5,"redirectEnd":0,"redirectStart":0,"requestStart":734.5,"responseEnd":809.6000000238419,"responseStart":809.6000000238419,"secureConnectionStart":734.5},{"duration":335.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/f51ef5507eea4c158f257c66c93b2a3f-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":454.7000000476837,"connectEnd":454.7000000476837,"connectStart":454.7000000476837,"domainLookupEnd":454.7000000476837,"domainLookupStart":454.7000000476837,"fetchStart":454.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":454.7000000476837,"responseEnd":790.2000000476837,"responseStart":790.2000000476837,"secureConnectionStart":454.7000000476837}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":7,"responseStart":201,"responseEnd":205,"domLoading":204,"domInteractive":919,"domContentLoadedEventStart":919,"domContentLoadedEventEnd":978,"domComplete":1180,"loadEventStart":1180,"loadEventEnd":1181,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":874.5},{"name":"bigPipe.sidebar-id.end","time":875.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":875.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":880.7999999523163},{"name":"activityTabFullyLoaded","time":994.6000000238419}],"measures":[],"correlationId":"2777f721ebedfe","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":124,"dbReadsTimeInMs":16,"dbConnsTimeInMs":27,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
I just had this happen again with server version 10.2.12. The most recent DDL was within the past 12 hours, and it was:
It's possible that it's triggered by a bug in my application that uses the Go MySQL driver since there was a memory inconsistency bug last time this happened, and today there was another bug with the buffers used when reading rows from SELECT queries.
| matchmaking_match_id | user_id | team | accepted |
| 146803 | 146613110 | 1 | 1 |
| 146803 | 155148690 | 2 | 1 |
| 146803 | 180757106 | 1 | 1 |
| 146803 | 244313752 | 2 | 0 |
| 146803 | 273445176 | 2 | 0 |
| 146803 | 279060114 | 2 | 1 |
| 146803 | 279463940 | 1 | 1 |
| 146803 | 327802118 | 1 | 1 |
| 146803 | 405506430 | 2 | 0 |