Hi,
I am having an issue with MariaDB semi-sync replication.
Setting up replication between master and slaves works as expected but when the master begins writing to a new binlog file replication stalls on waiting for an ack from the semi-sync slave.
I have the fallback to async set very high because I basically don't want the server to ever commit writes to the master that aren't committed to the slave.
I have discussed this somewhat on the mailing list and have created this gist which reliably reproduces the issue: https://gist.github.com/josephglanville/c9a69b02de319ee06aef1a8d787bcce3
It's possible this is a configuration issue rather than a bug, config for master and slave is generated in the scripts in the gist so if that is the case hopefully it's an easy fix.
Joseph.
{"report":{"fcp":982.7999997138977,"ttfb":219.5,"pageVisibility":"visible","entityId":57645,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"3990d081-67df-42ef-b896-bc15a6783a50","navigationType":0,"readyForUser":1074.6999998092651,"redirectCount":0,"resourceLoadedEnd":649,"resourceLoadedStart":241.09999990463257,"resourceTiming":[{"duration":71.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":241.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":241.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":312.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":71.7999997138977,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":241.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":241.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":313.19999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":179.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":241.69999980926514,"connectEnd":241.69999980926514,"connectStart":241.69999980926514,"domainLookupEnd":241.69999980926514,"domainLookupStart":241.69999980926514,"fetchStart":241.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":314.69999980926514,"responseEnd":421.2999997138977,"responseStart":376.69999980926514,"secureConnectionStart":241.69999980926514},{"duration":245,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":242.19999980926514,"connectEnd":318.69999980926514,"connectStart":318.69999980926514,"domainLookupEnd":318.69999980926514,"domainLookupStart":318.69999980926514,"fetchStart":242.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":318.90000009536743,"responseEnd":487.19999980926514,"responseStart":334.69999980926514,"secureConnectionStart":318.69999980926514},{"duration":124.7999997138977,"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":242.40000009536743,"connectEnd":242.40000009536743,"connectStart":242.40000009536743,"domainLookupEnd":242.40000009536743,"domainLookupStart":242.40000009536743,"fetchStart":242.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":333,"responseEnd":367.19999980926514,"responseStart":361.69999980926514,"secureConnectionStart":242.40000009536743},{"duration":125.19999980926514,"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":242.5,"connectEnd":242.5,"connectStart":242.5,"domainLookupEnd":242.5,"domainLookupStart":242.5,"fetchStart":242.5,"redirectEnd":0,"redirectStart":0,"requestStart":332.7999997138977,"responseEnd":367.69999980926514,"responseStart":363.2999997138977,"secureConnectionStart":242.5},{"duration":123.90000009536743,"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":242.69999980926514,"connectEnd":242.69999980926514,"connectStart":242.69999980926514,"domainLookupEnd":242.69999980926514,"domainLookupStart":242.69999980926514,"fetchStart":242.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":333.09999990463257,"responseEnd":366.59999990463257,"responseStart":359.90000009536743,"secureConnectionStart":242.69999980926514},{"duration":89.2999997138977,"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":242.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":242.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":332.19999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":129.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":243,"connectEnd":243,"connectStart":243,"domainLookupEnd":243,"domainLookupStart":243,"fetchStart":243,"redirectEnd":0,"redirectStart":0,"requestStart":350.5,"responseEnd":372.69999980926514,"responseStart":367.7999997138977,"secureConnectionStart":243},{"duration":89.59999990463257,"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":243.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":243.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":332.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":131.2000002861023,"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":243.2999997138977,"connectEnd":243.2999997138977,"connectStart":243.2999997138977,"domainLookupEnd":243.2999997138977,"domainLookupStart":243.2999997138977,"fetchStart":243.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":350.90000009536743,"responseEnd":374.5,"responseStart":368.59999990463257,"secureConnectionStart":243.2999997138977},{"duration":387,"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":255.40000009536743,"connectEnd":255.40000009536743,"connectStart":255.40000009536743,"domainLookupEnd":255.40000009536743,"domainLookupStart":255.40000009536743,"fetchStart":255.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":622.1999998092651,"responseEnd":642.4000000953674,"responseStart":641.7999997138977,"secureConnectionStart":255.40000009536743},{"duration":393.30000019073486,"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":255.69999980926514,"connectEnd":255.69999980926514,"connectStart":255.69999980926514,"domainLookupEnd":255.69999980926514,"domainLookupStart":255.69999980926514,"fetchStart":255.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":635.6999998092651,"responseEnd":649,"responseStart":648.4000000953674,"secureConnectionStart":255.69999980926514},{"duration":257.69999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":624.5999999046326,"connectEnd":624.5999999046326,"connectStart":624.5999999046326,"domainLookupEnd":624.5999999046326,"domainLookupStart":624.5999999046326,"fetchStart":624.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":844.7999997138977,"responseEnd":882.2999997138977,"responseStart":881.5999999046326,"secureConnectionStart":624.5999999046326}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":68,"responseStart":219,"responseEnd":255,"domLoading":224,"domInteractive":1145,"domContentLoadedEventStart":1145,"domContentLoadedEventEnd":1199,"domComplete":2300,"loadEventStart":2300,"loadEventEnd":2301,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1111.0999999046326},{"name":"bigPipe.sidebar-id.end","time":1112},{"name":"bigPipe.activity-panel-pipe-id.start","time":1112.1999998092651},{"name":"bigPipe.activity-panel-pipe-id.end","time":1113.5},{"name":"activityTabFullyLoaded","time":1214.4000000953674}],"measures":[],"correlationId":"7990b783537bf3","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":90,"dbReadsTimeInMs":11,"dbConnsTimeInMs":21,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Switching to AFTER_COMMIT works around the problem but doesn't accomplish loss-less replication.
Discussion on the mailing list indicates this is likely a race updating MYSQL_BIN_LOG::log_file_name as the after_sync callback is called with the new file name but the last offset of the previous binlog file.