Hello,
Unfortunately I found this issue in our production environment. 1 node down and always do SST again , again and again.
When I check mysqlerror log . I found this error :
2020-03-04 10:57:54 13 [ERROR] Slave SQL: Could not execute Write_rows_v1 event on table v2_accounts.identity_details; Cannot add or update a child row: a foreign key constraint fails (`v2_accounts`.`identity_details`, CONSTRAINT `identity_details_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `identities` (`uid`)), Error_code: 1452; handler error HA_ERR_NO_REFERENCED_ROW; the event's master log FIRST, end_log_pos 512, Internal MariaDB error code: 1452
|
2020-03-04 10:57:54 13 [Warning] WSREP: RBR event 3 Write_rows_v1 apply warning: 151, 14207906
|
2020-03-04 10:57:54 13 [Warning] WSREP: Failed to apply app buffer: seqno: 14207906, status: 1
|
at galera/src/trx_handle.cpp:apply():353
|
Retrying 2th time
|
|
And then check the table `identity_details` make sure have primary key also structure table looks neat.
CREATE TABLE `identity_details` (
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`uid` varchar(255) NOT NULL,
|
`device_type_id` smallint(4) NOT NULL,
|
`device_id` varchar(255) DEFAULT NULL,
|
`status` tinyint(2) NOT NULL DEFAULT 1 COMMENT '0 => disactive, 1 => active, 9 => deleted',
|
`created_at` datetime NOT NULL,
|
`updated_at` datetime DEFAULT NULL,
|
`deleted_at` datetime DEFAULT NULL,
|
PRIMARY KEY (`id`),
|
UNIQUE KEY `uid` (`uid`) USING BTREE,
|
UNIQUE KEY `device_id` (`device_id`) USING BTREE,
|
KEY `identity_details_ibfk_2` (`device_type_id`),
|
CONSTRAINT `identity_details_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `identities` (`uid`),
|
CONSTRAINT `identity_details_ibfk_2` FOREIGN KEY (`device_type_id`) REFERENCES `device_types` (`id`)
|
) ENGINE=InnoDB AUTO_INCREMENT=13727 DEFAULT CHARSET=utf8mb4;
|
Try 1 :
I tried to remove all data in datadir at the fail node but doesn't have impact, still fail and doing SST again , again and again because error log above. this log GRA__.log
?bin?_^?M?10.3.16-MariaDB-1:10.3.16+maria~bionic-log?_^8
|
|
|
b?fr?_^??MUUINSERT INTO
|
identity_details(
|
uid,
|
device_type_id,
|
device_id,
|
status,
|
created_at,
|
updated_at,
|
deleted_at
|
) VALUES (
|
'79229af87a864036b7411e47ce2f0889',
|
3,
|
'111101120826',
|
0,
|
'2020-03-04 13:20:03.180985',
|
'2020-03-04 13:20:03.180985',
|
NULL
|
)?_^?ML?
|
v2_accountsidentity_detail????_^?M???3 79229af87a864036b7411e47ce2f0889
|
111101120826????????
|
|
Try 2 :
I have suspect that foreign key uid to table identities have a problem (bugs mariadb maybe), bcs uid in identities not primary key but only unique key (I think it's fine but make cluster galera down) . this structure table identities
CREATE TABLE `identities` (
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`uid` varchar(255) NOT NULL,
|
`email` varchar(255) DEFAULT NULL,
|
`password_hash` longtext DEFAULT NULL,
|
`password_hash_legacy` longtext DEFAULT NULL,
|
`password_salt_legacy` longtext DEFAULT NULL,
|
`phone` varchar(255) DEFAULT NULL,
|
`first_name` varchar(255) DEFAULT NULL,
|
`last_name` varchar(255) DEFAULT NULL,
|
`birthdate` date DEFAULT NULL,
|
`gender` enum('m','f') DEFAULT NULL,
|
`location` varchar(255) DEFAULT NULL,
|
`status` int(11) NOT NULL,
|
`created_at` datetime NOT NULL,
|
`updated_at` datetime NOT NULL,
|
`deleted_at` datetime DEFAULT NULL,
|
`app_id` int(11) DEFAULT NULL,
|
`device_id` varchar(50) DEFAULT NULL,
|
`image_url` varchar(255) DEFAULT NULL,
|
PRIMARY KEY (`id`) USING BTREE,
|
UNIQUE KEY `idx_uid` (`uid`) USING BTREE,
|
UNIQUE KEY `uq_email_appid` (`email`,`app_id`),
|
UNIQUE KEY `uq_phone_appid` (`phone`,`app_id`),
|
UNIQUE KEY `uq_device_id` (`device_id`) USING BTREE,
|
KEY `created_at` (`created_at`) USING BTREE,
|
FULLTEXT KEY `first_name` (`first_name`,`last_name`)
|
) ENGINE=InnoDB AUTO_INCREMENT=27062787 DEFAULT CHARSET=utf8mb4
|
So I tried to drop foreign key uid in table identity_detail, hopefully error foreign key doesn't appear again. for right now my cluster is fine.
Can you help check for this issue ? because if that error part of galera cluster limitations please tell to us and put in documentation.
Thanks
Satria Dwi Putra
{"report":{"fcp":1023.3000001907349,"ttfb":285.4000005722046,"pageVisibility":"visible","entityId":83799,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"25eaeb8c-9683-4f3d-8064-1be6d64f0bdf","navigationType":0,"readyForUser":1115.5,"redirectCount":0,"resourceLoadedEnd":1677.7000007629395,"resourceLoadedStart":296.70000076293945,"resourceTiming":[{"duration":253.29999923706055,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":296.70000076293945,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":296.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":550,"responseStart":0,"secureConnectionStart":0},{"duration":253.39999961853027,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":296.9000005722046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":296.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":550.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":261.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":297.1000003814697,"connectEnd":297.1000003814697,"connectStart":297.1000003814697,"domainLookupEnd":297.1000003814697,"domainLookupStart":297.1000003814697,"fetchStart":297.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":297.1000003814697,"responseEnd":559,"responseStart":559,"secureConnectionStart":297.1000003814697},{"duration":348.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":297.4000005722046,"connectEnd":297.4000005722046,"connectStart":297.4000005722046,"domainLookupEnd":297.4000005722046,"domainLookupStart":297.4000005722046,"fetchStart":297.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":297.4000005722046,"responseEnd":646.3000001907349,"responseStart":646.3000001907349,"secureConnectionStart":297.4000005722046},{"duration":352.70000076293945,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":297.5,"connectEnd":297.5,"connectStart":297.5,"domainLookupEnd":297.5,"domainLookupStart":297.5,"fetchStart":297.5,"redirectEnd":0,"redirectStart":0,"requestStart":297.5,"responseEnd":650.2000007629395,"responseStart":650.2000007629395,"secureConnectionStart":297.5},{"duration":353.1000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":297.6000003814697,"connectEnd":297.6000003814697,"connectStart":297.6000003814697,"domainLookupEnd":297.6000003814697,"domainLookupStart":297.6000003814697,"fetchStart":297.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":297.6000003814697,"responseEnd":650.7000007629395,"responseStart":650.7000007629395,"secureConnectionStart":297.6000003814697},{"duration":353.0999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":297.9000005722046,"connectEnd":297.9000005722046,"connectStart":297.9000005722046,"domainLookupEnd":297.9000005722046,"domainLookupStart":297.9000005722046,"fetchStart":297.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":297.9000005722046,"responseEnd":651,"responseStart":651,"secureConnectionStart":297.9000005722046},{"duration":406.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":298.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":298.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":704.4000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":353.29999923706055,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":298.20000076293945,"connectEnd":298.20000076293945,"connectStart":298.20000076293945,"domainLookupEnd":298.20000076293945,"domainLookupStart":298.20000076293945,"fetchStart":298.20000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":298.20000076293945,"responseEnd":651.5,"responseStart":651.5,"secureConnectionStart":298.20000076293945},{"duration":406.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/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":298.4000005722046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":298.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":704.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":353.70000076293945,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/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":298.5,"connectEnd":298.5,"connectStart":298.5,"domainLookupEnd":298.5,"domainLookupStart":298.5,"fetchStart":298.5,"redirectEnd":0,"redirectStart":0,"requestStart":298.5,"responseEnd":652.2000007629395,"responseStart":652.2000007629395,"secureConnectionStart":298.5},{"duration":1121.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":304,"connectEnd":304,"connectStart":304,"domainLookupEnd":304,"domainLookupStart":304,"fetchStart":304,"redirectEnd":0,"redirectStart":0,"requestStart":304,"responseEnd":1425.3000001907349,"responseStart":1425.3000001907349,"secureConnectionStart":304},{"duration":1373.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":304.1000003814697,"connectEnd":304.1000003814697,"connectStart":304.1000003814697,"domainLookupEnd":304.1000003814697,"domainLookupStart":304.1000003814697,"fetchStart":304.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":304.1000003814697,"responseEnd":1677.7000007629395,"responseStart":1677.7000007629395,"secureConnectionStart":304.1000003814697},{"duration":726.7999992370605,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":716.2000007629395,"connectEnd":716.2000007629395,"connectStart":716.2000007629395,"domainLookupEnd":716.2000007629395,"domainLookupStart":716.2000007629395,"fetchStart":716.2000007629395,"redirectEnd":0,"redirectStart":0,"requestStart":716.2000007629395,"responseEnd":1443,"responseStart":1443,"secureConnectionStart":716.2000007629395}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":114,"responseStart":286,"responseEnd":302,"domLoading":295,"domInteractive":1696,"domContentLoadedEventStart":1696,"domContentLoadedEventEnd":1740,"domComplete":2496,"loadEventStart":2496,"loadEventEnd":2496,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1679.5},{"name":"bigPipe.sidebar-id.end","time":1680.4000005722046},{"name":"bigPipe.activity-panel-pipe-id.start","time":1680.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":1681.3000001907349},{"name":"activityTabFullyLoaded","time":1752.7000007629395}],"measures":[],"correlationId":"8b0b837248bc5e","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":97,"dbReadsTimeInMs":12,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Firstly, you should try more recent version of MariaDB 10.3 server and Galera library. Lot of bugs has been fixed after 10.3.16. When you said you deleted all the data from datadir did this include GRA files ? If you can repeat this I would need more detailed steps how to repeat and possibly files from datadir or edited tables content.