When using the semi-sync protocol, track each replica's progress. The SHOW REPLICA HOSTS output should be extended with two fields: one representing the GTID state last sent to the replica, and the other representing the GTID state last ACK'd from the replica.
Additionally, treat rpl_semi_sync_master_timeout=0 as a special case where transactions do not await an ACK, but still report progress from the ack_thread on replica reply.
When running SHOW REPLICA HOSTS instead of 4 columns
SHOW REPLICA HOSTS;
Server_id Host Port Master_id
we want to have additional columns
Server_id Host Port Master_id Gtid_State_Sent Gtid_State_Ack
3 127.0.0.1 16002 1 0-1-5,1-2-10 0-1-4,1-2-7
4 127.0.0.1 16003 1 0-1-5,1-2-10 0-1-2,1-2-3
Additional notes:
1. Replicas with semi-sync disabled should have empty values for Gtid_State_Ack.
2. Updating a replica's Gtid_State_Ack should be done by the ack thread after validating that the transaction was sent to the replica
3. The new columns should always be present, regardless of rpl_semi_sync_master_enabled, as the primary can disable semi-sync dynamically, and it could still be useful to display the information.
4. Per design, when rpl_semi_sync_master_timeout=0, than rpl_semi_sync_master_status, if enabled earlier, should stay ON , instead of switching off to async and incrementing the counter updates.
5. Per desing, in order to distinguish replica type between async, semi-sync stalled and semi-sync active replica, suggestion is to add new column Replica_type with replica type values depending on the state of replica.
Attachments
Issue Links
relates to
MDBF-573Create the blog for a semi-sync replication with an example
Closed
MDEV-31556rpl_semi_sync_master_[get,request]_ack should be controllable with `reset master` statement
Open
MDEV-31557rpl_semi_sync_master_net_wait_num is not protected
Open
MDEV-33614Rpl_semi_sync_master_request_ack not showing result after stopping the ACK thread
Open
MDEV-33615Rpl_semi_sync_master_yes_tx doesn't get incremented when one of slave's IO thread is stopped with semi-sync setup
I've put some final touches to the previously started patch, and it is ready for one of your reviews: PR-3288 (note this is a new PR that I've opened).
Brandon Nesterenko
added a comment - Hi knielsen and Elkin !
I've put some final touches to the previously started patch, and it is ready for one of your reviews: PR-3288 (note this is a new PR that I've opened).
Roel Van de Paar
added a comment - - edited https://github.com/MariaDB/server/commit/11d7bd2ed3322279e14068bdf8a913626900f4ac
https://github.com/MariaDB/server/pull/1427 >
https://github.com/MariaDB/server/pull/2374 >
https://github.com/MariaDB/server/pull/3288
https://lists.mariadb.org/hyperkitty/list/developers@lists.mariadb.org/thread/62YVCBGSC23PDTPHSEBU4LH74LZVGJD7/
Pulling from 11.6, as there is some unnecessary overhead in the implementation, and we can instead re-consider a better design (or decide if we even want this feature at all).
Brandon Nesterenko
added a comment - Pulling from 11.6, as there is some unnecessary overhead in the implementation, and we can instead re-consider a better design (or decide if we even want this feature at all).
5 years later, the patchset passed through a myriad of hands, and now we think that, maybe, the feature is not required.
In the mean time, every body with a master/slave setup must keep a large dataset of binlog, most of which are useless.
Because there is no way to know when a binlog has been applied to the client.
So we must keep something like a day or two, and bet that the apply will be done (even if the slave went into maintenance somehow).
If the bet is right, then we only consume lots of storage, for nothing
If the bet is wrong, then replication fails, the slave is no longer usable, and we must recreate it from scratch (which is pain)
Postgres has its own issues, but damn, replication-stuff is so much easier and cheaper there
Jack
added a comment - Amazing
5 years later, the patchset passed through a myriad of hands, and now we think that, maybe, the feature is not required.
In the mean time, every body with a master/slave setup must keep a large dataset of binlog, most of which are useless.
Because there is no way to know when a binlog has been applied to the client.
So we must keep something like a day or two, and bet that the apply will be done (even if the slave went into maintenance somehow).
If the bet is right, then we only consume lots of storage, for nothing
If the bet is wrong, then replication fails, the slave is no longer usable, and we must recreate it from scratch (which is pain)
Postgres has its own issues, but damn, replication-stuff is so much easier and cheaper there
People
Brandon Nesterenko
Anel Husakovic
Votes:
1Vote for this issue
Watchers:
15Start watching this issue
Dates
Created:
Updated:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":685.2999999523163,"ttfb":137.79999995231628,"pageVisibility":"visible","entityId":81203,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"56b55f9b-b15e-4244-a2f3-4124d538f58c","navigationType":0,"readyForUser":762.5,"redirectCount":0,"resourceLoadedEnd":798.2000000476837,"resourceLoadedStart":143.39999985694885,"resourceTiming":[{"duration":27.100000143051147,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":143.39999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":143.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":170.5,"responseStart":0,"secureConnectionStart":0},{"duration":27.199999809265137,"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":143.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":143.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":170.89999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":88.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":143.89999985694885,"connectEnd":143.89999985694885,"connectStart":143.89999985694885,"domainLookupEnd":143.89999985694885,"domainLookupStart":143.89999985694885,"fetchStart":143.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":143.89999985694885,"responseEnd":232.59999990463257,"responseStart":232.59999990463257,"secureConnectionStart":143.89999985694885},{"duration":182.5,"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":143.89999985694885,"connectEnd":143.89999985694885,"connectStart":143.89999985694885,"domainLookupEnd":143.89999985694885,"domainLookupStart":143.89999985694885,"fetchStart":143.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":143.89999985694885,"responseEnd":326.39999985694885,"responseStart":326.39999985694885,"secureConnectionStart":143.89999985694885},{"duration":186.10000014305115,"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":144.09999990463257,"connectEnd":144.09999990463257,"connectStart":144.09999990463257,"domainLookupEnd":144.09999990463257,"domainLookupStart":144.09999990463257,"fetchStart":144.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":144.09999990463257,"responseEnd":330.2000000476837,"responseStart":330.2000000476837,"secureConnectionStart":144.09999990463257},{"duration":186.39999985694885,"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":144.20000004768372,"connectEnd":144.20000004768372,"connectStart":144.20000004768372,"domainLookupEnd":144.20000004768372,"domainLookupStart":144.20000004768372,"fetchStart":144.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":144.20000004768372,"responseEnd":330.59999990463257,"responseStart":330.59999990463257,"secureConnectionStart":144.20000004768372},{"duration":186.59999990463257,"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":144.29999995231628,"connectEnd":144.29999995231628,"connectStart":144.29999995231628,"domainLookupEnd":144.29999995231628,"domainLookupStart":144.29999995231628,"fetchStart":144.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":144.29999995231628,"responseEnd":330.89999985694885,"responseStart":330.89999985694885,"secureConnectionStart":144.29999995231628},{"duration":186.89999985694885,"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":144.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":144.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":331.39999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":186.89999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":144.5,"connectEnd":144.5,"connectStart":144.5,"domainLookupEnd":144.5,"domainLookupStart":144.5,"fetchStart":144.5,"redirectEnd":0,"redirectStart":0,"requestStart":144.5,"responseEnd":331.39999985694885,"responseStart":331.39999985694885,"secureConnectionStart":144.5},{"duration":187.09999990463257,"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":144.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":144.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":331.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":187.59999990463257,"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":144.79999995231628,"connectEnd":144.79999995231628,"connectStart":144.79999995231628,"domainLookupEnd":144.79999995231628,"domainLookupStart":144.79999995231628,"fetchStart":144.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":144.79999995231628,"responseEnd":332.39999985694885,"responseStart":332.39999985694885,"secureConnectionStart":144.79999995231628},{"duration":473.7000000476837,"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":146.09999990463257,"connectEnd":146.09999990463257,"connectStart":146.09999990463257,"domainLookupEnd":146.09999990463257,"domainLookupStart":146.09999990463257,"fetchStart":146.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":146.09999990463257,"responseEnd":619.7999999523163,"responseStart":619.7999999523163,"secureConnectionStart":146.09999990463257},{"duration":482.89999985694885,"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":146.20000004768372,"connectEnd":146.20000004768372,"connectStart":146.20000004768372,"domainLookupEnd":146.20000004768372,"domainLookupStart":146.20000004768372,"fetchStart":146.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":146.20000004768372,"responseEnd":629.0999999046326,"responseStart":629.0999999046326,"secureConnectionStart":146.20000004768372},{"duration":198.79999995231628,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":384.7000000476837,"connectEnd":384.7000000476837,"connectStart":384.7000000476837,"domainLookupEnd":384.7000000476837,"domainLookupStart":384.7000000476837,"fetchStart":384.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":384.7000000476837,"responseEnd":583.5,"responseStart":583.5,"secureConnectionStart":384.7000000476837},{"duration":37.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":592.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":592.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":629.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":191.20000004768372,"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":592.8999998569489,"connectEnd":592.8999998569489,"connectStart":592.8999998569489,"domainLookupEnd":592.8999998569489,"domainLookupStart":592.8999998569489,"fetchStart":592.8999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":592.8999998569489,"responseEnd":784.0999999046326,"responseStart":784.0999999046326,"secureConnectionStart":592.8999998569489},{"duration":205,"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":593.2000000476837,"connectEnd":593.2000000476837,"connectStart":593.2000000476837,"domainLookupEnd":593.2000000476837,"domainLookupStart":593.2000000476837,"fetchStart":593.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":593.2000000476837,"responseEnd":798.2000000476837,"responseStart":798.2000000476837,"secureConnectionStart":593.2000000476837},{"duration":173.29999995231628,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":678.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":678.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":851.8999998569489,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":5,"responseStart":138,"responseEnd":141,"domLoading":141,"domInteractive":836,"domContentLoadedEventStart":836,"domContentLoadedEventEnd":880,"domComplete":1084,"loadEventStart":1084,"loadEventEnd":1085,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":799.5999999046326},{"name":"bigPipe.sidebar-id.end","time":800.3999998569489},{"name":"bigPipe.activity-panel-pipe-id.start","time":800.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":802.0999999046326},{"name":"activityTabFullyLoaded","time":896.0999999046326}],"measures":[],"correlationId":"1e58233f2ab631","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":81,"dbReadsTimeInMs":15,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Hi knielsen and Elkin!
I've put some final touches to the previously started patch, and it is ready for one of your reviews: PR-3288 (note this is a new PR that I've opened).