I spoke with Sergei at Percona about this issue. I have two MariaDB 5.5.30 (on CentOS 5) servers set up as master-slave (although that should matter, as this is not a replication issue).
Here is my setup. On the slave, I have a federated table linking back to the master. Also on the slave, I have a batch reporting process that inserts records into a local (slave) table which matches the table definition of the table on the master. When the process is complete, I do a bulk insert like this:
insert into <federated_table> select * from <local_table>;
The records are then loaded into the server table, which then flow back to the slave (as well as other slaves) through normal replication.
The problem is that one time in about 20 (about 5% of the time), I receive the following error on the slave:
Got error 10000 'Error on remote system: 2006: MySQL server has gone away' from FEDERATED
Of course, the master is running fine and never hangs or "goes away". When this error occurs, I have my slave reporting code immediately retry the insert query, and it usually works without failure the second time. The two servers are right next to each other and operate on an internal network (10.0.0.x) with just one HP gigabit switch between them. They are both VMWare VMs running in VMWare ESXi 5.
The master server is a development server, so it is not under any load or contention.
I'd like to try to find out some more detailed error logging on the slave when this happens with Federated tables or what could be causing this issue.
Many thanks.
{"report":{"fcp":1194.8999999761581,"ttfb":660,"pageVisibility":"visible","entityId":23947,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"32457c48-5d59-487f-9572-e5ff23cdd6d1","navigationType":0,"readyForUser":1265.1000000238419,"redirectCount":0,"resourceLoadedEnd":943.8000000715256,"resourceLoadedStart":669.7000000476837,"resourceTiming":[{"duration":4.299999952316284,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":669.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":669.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":674,"responseStart":0,"secureConnectionStart":0},{"duration":8.200000047683716,"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":669.8999999761581,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":669.8999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":678.1000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":83.30000007152557,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":670,"connectEnd":670,"connectStart":670,"domainLookupEnd":670,"domainLookupStart":670,"fetchStart":670,"redirectEnd":0,"redirectStart":0,"requestStart":680,"responseEnd":753.3000000715256,"responseStart":694.7000000476837,"secureConnectionStart":670},{"duration":230.60000002384186,"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":670.1000000238419,"connectEnd":670.1000000238419,"connectStart":670.1000000238419,"domainLookupEnd":670.1000000238419,"domainLookupStart":670.1000000238419,"fetchStart":670.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":680.8000000715256,"responseEnd":900.7000000476837,"responseStart":698.8999999761581,"secureConnectionStart":670.1000000238419},{"duration":8.299999952316284,"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":670.2000000476837,"connectEnd":670.2000000476837,"connectStart":670.2000000476837,"domainLookupEnd":670.2000000476837,"domainLookupStart":670.2000000476837,"fetchStart":670.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":670.2000000476837,"responseEnd":678.5,"responseStart":678.5,"secureConnectionStart":670.2000000476837},{"duration":31.799999952316284,"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":670.3000000715256,"connectEnd":670.3000000715256,"connectStart":670.3000000715256,"domainLookupEnd":670.3000000715256,"domainLookupStart":670.3000000715256,"fetchStart":670.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":681.8999999761581,"responseEnd":702.1000000238419,"responseStart":700.2000000476837,"secureConnectionStart":670.3000000715256},{"duration":32.300000071525574,"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":670.3999999761581,"connectEnd":670.3999999761581,"connectStart":670.3999999761581,"domainLookupEnd":670.3999999761581,"domainLookupStart":670.3999999761581,"fetchStart":670.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":682.3000000715256,"responseEnd":702.7000000476837,"responseStart":701.2000000476837,"secureConnectionStart":670.3999999761581},{"duration":11.399999976158142,"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":670.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":670.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":681.8999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":34.299999952316284,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":670.6000000238419,"connectEnd":670.6000000238419,"connectStart":670.6000000238419,"domainLookupEnd":670.6000000238419,"domainLookupStart":670.6000000238419,"fetchStart":670.6000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":685.1000000238419,"responseEnd":704.8999999761581,"responseStart":703.8000000715256,"secureConnectionStart":670.6000000238419},{"duration":12.399999976158142,"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":670.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":670.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":683.1000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":37.799999952316284,"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":670.8000000715256,"connectEnd":670.8000000715256,"connectStart":670.8000000715256,"domainLookupEnd":670.8000000715256,"domainLookupStart":670.8000000715256,"fetchStart":670.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":688.6000000238419,"responseEnd":708.6000000238419,"responseStart":707.2000000476837,"secureConnectionStart":670.8000000715256},{"duration":269.60000002384186,"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":673.8999999761581,"connectEnd":673.8999999761581,"connectStart":673.8999999761581,"domainLookupEnd":673.8999999761581,"domainLookupStart":673.8999999761581,"fetchStart":673.8999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":730.3000000715256,"responseEnd":943.5,"responseStart":940.3000000715256,"secureConnectionStart":673.8999999761581},{"duration":264.40000009536743,"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":679.3999999761581,"connectEnd":679.3999999761581,"connectStart":679.3999999761581,"domainLookupEnd":679.3999999761581,"domainLookupStart":679.3999999761581,"fetchStart":679.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":743.7000000476837,"responseEnd":943.8000000715256,"responseStart":941.2000000476837,"secureConnectionStart":679.3999999761581},{"duration":66.20000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":897,"connectEnd":897,"connectStart":897,"domainLookupEnd":897,"domainLookupStart":897,"fetchStart":897,"redirectEnd":0,"redirectStart":0,"requestStart":916.8000000715256,"responseEnd":963.2000000476837,"responseStart":960.8000000715256,"secureConnectionStart":897},{"duration":80.90000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1116.3999999761581,"connectEnd":1116.3999999761581,"connectStart":1116.3999999761581,"domainLookupEnd":1116.3999999761581,"domainLookupStart":1116.3999999761581,"fetchStart":1116.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":1116.3999999761581,"responseEnd":1197.3000000715256,"responseStart":1197.3000000715256,"secureConnectionStart":1116.3999999761581},{"duration":39.89999997615814,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1188.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1188.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1228.1000000238419,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":20,"domainLookupEnd":26,"connectStart":26,"connectEnd":45,"secureConnectionStart":34,"requestStart":46,"responseStart":660,"responseEnd":679,"domLoading":664,"domInteractive":1332,"domContentLoadedEventStart":1332,"domContentLoadedEventEnd":1389,"domComplete":1569,"loadEventStart":1569,"loadEventEnd":1569,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1300.2000000476837},{"name":"bigPipe.sidebar-id.end","time":1301},{"name":"bigPipe.activity-panel-pipe-id.start","time":1301.1000000238419},{"name":"bigPipe.activity-panel-pipe-id.end","time":1304.3999999761581},{"name":"activityTabFullyLoaded","time":1404.7000000476837}],"measures":[],"correlationId":"bdedd2018d19a4","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":549,"dbReadsTimeInMs":438,"dbConnsTimeInMs":447,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Just to be clear, there are four tables:
Master: results
Slave: results (the slave's replicated version of "results" on the master)
Slave: results_local (a slave local table used for reporting output)
Slave results_fed (federated table linking to table "results" on the master)
The reporting process populates "results_local" on the slave. The problematic insert statement on the slave is:
insert into results_fed select * from results_local;
Hope this clears things up.