When I create an event on the master it is replicated to the slave BUT it is set to 'DISABLE ON SLAVE' there and thus not executed on slave. This is documented and fine so far.
But in some cases one wants to have the events also enabled on the slave.
In this case I have to enable the event on the slave as well with:
ALTER EVENT event_name ENABLE;
This has now 2 problems:
1.) Whenever I REPLACE the event on Master I have to think about to re-enable the event on the slave again. This can lead to errors and is not idempotent/reentrant. So I can hardly do this automatized...
2.) In a Master/Master topology, when I run the ALTER EVENT ... ENABLE on the passive Master it will deactivate the event on the active Master again. So I have to work with sql_log_bin = off which is also dangerous. So not idempotent/reentrant as well.
So we have some problems in this situation which are dangerous for production systems...
My suggestion is to add a new functionality: ENDABLE ON SLAVE which does the opposite of DISABLE ON SLAVE: It enables the event on master AND slave.
Thanks, Oli. This makes sense, IIUC the event is populating local tables with data about the local instance. I assume the event sets sql_log_bin=0 or something to not replicate its dbstat tables.
So in this case, indeed it seems a property of the event (and the decision of the event developer) that it is something that wants to be active also on the slaves.
On the other hand, installing a monitoring tool on a server is not something I normally would expect to use MariaDB replication for? It is not clear to me why you mentioned it as risky to install the dbstat separately on each server with sql_log_bin = off. Still, this is always a difficult line to draw when using things like stored procedures, events, etc. in SQL databases, when something is part of the data, and when it is part of the software deployment.
Kristian Nielsen
added a comment - Thanks, Oli. This makes sense, IIUC the event is populating local tables with data about the local instance. I assume the event sets sql_log_bin=0 or something to not replicate its dbstat tables.
So in this case, indeed it seems a property of the event (and the decision of the event developer) that it is something that wants to be active also on the slaves.
On the other hand, installing a monitoring tool on a server is not something I normally would expect to use MariaDB replication for? It is not clear to me why you mentioned it as risky to install the dbstat separately on each server with sql_log_bin = off. Still, this is always a difficult line to draw when using things like stored procedures, events, etc. in SQL databases, when something is part of the data, and when it is part of the software deployment.
I completely agree that DISABLE ON SLAVE was ill-conceived and unintuitive for users. I was curious about why it was implemented this way and also found that bug report, but since it was from 2007, I assumed people were just fine with this behavior.
Now that I know fixing Bug#31643 is preferable, I agree that adding ENABLE ON SLAVE would only complicate things further.
If I understand correctly, Andrei's initial idea was to create something similar to how it's done with triggers using global variables, but that wouldn't meet Oli's development requirements since a SQL command would be preferable.
This led Andrei to propose another solution: a new option for EVENTS that simply specifies how we should replicate this event on slaves—either ENABLED or DISABLED. I liked this idea.
At the end of the day, as Andrei mentioned, both solutions could be implemented (the Dev's and the Ops'). If both are set, we prioritize the Ops' solution, which uses global variables.
This approach sounds good to me. I think it would be worthwhile to modify my PR to implement these ideas. However, I will be able to give this issue more attention after I finish my GSoC project, MDEV-30645.
Thanks Andre for a good resume.
I am all but certain on your old decision assumption. There were no event replication users to ask from either at that time.
Andrei Elkin
added a comment - Thanks Andre for a good resume.
I am all but certain on your old decision assumption. There were no event replication users to ask from either at that time.
This work is going to be improved. Andre agreed to re-arrange the patch. I am not full sure, but I think meanwhile until a new PR request the owner of this MDEV should you, correct?
Andrei Elkin
added a comment - Hi Andrew.
This work is going to be improved. Andre agreed to re-arrange the patch. I am not full sure, but I think meanwhile until a new PR request the owner of this MDEV should you, correct?
People
Andrei Elkin
Oli Sennhauser
Votes:
2Vote for this issue
Watchers:
10Start 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":938.6999998092651,"ttfb":235.40000009536743,"pageVisibility":"visible","entityId":128530,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"3695ff1f-fccb-4d2b-a7b3-03044ba03349","navigationType":0,"readyForUser":1059.8000001907349,"redirectCount":0,"resourceLoadedEnd":1089.9000000953674,"resourceLoadedStart":242.59999990463257,"resourceTiming":[{"duration":187.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":242.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":242.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":430.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":187.5,"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":242.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":242.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":430.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":196.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":243,"connectEnd":243,"connectStart":243,"domainLookupEnd":243,"domainLookupStart":243,"fetchStart":243,"redirectEnd":0,"redirectStart":0,"requestStart":243,"responseEnd":439.69999980926514,"responseStart":439.69999980926514,"secureConnectionStart":243},{"duration":269.2000002861023,"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":243.19999980926514,"connectEnd":243.19999980926514,"connectStart":243.19999980926514,"domainLookupEnd":243.19999980926514,"domainLookupStart":243.19999980926514,"fetchStart":243.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":243.19999980926514,"responseEnd":512.4000000953674,"responseStart":512.4000000953674,"secureConnectionStart":243.19999980926514},{"duration":272.80000019073486,"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":243.59999990463257,"connectEnd":243.59999990463257,"connectStart":243.59999990463257,"domainLookupEnd":243.59999990463257,"domainLookupStart":243.59999990463257,"fetchStart":243.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":243.59999990463257,"responseEnd":516.4000000953674,"responseStart":516.4000000953674,"secureConnectionStart":243.59999990463257},{"duration":273,"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":243.80000019073486,"connectEnd":243.80000019073486,"connectStart":243.80000019073486,"domainLookupEnd":243.80000019073486,"domainLookupStart":243.80000019073486,"fetchStart":243.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":243.80000019073486,"responseEnd":516.8000001907349,"responseStart":516.8000001907349,"secureConnectionStart":243.80000019073486},{"duration":273.19999980926514,"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":244,"connectEnd":244,"connectStart":244,"domainLookupEnd":244,"domainLookupStart":244,"fetchStart":244,"redirectEnd":0,"redirectStart":0,"requestStart":244,"responseEnd":517.1999998092651,"responseStart":517.1999998092651,"secureConnectionStart":244},{"duration":344.80000019073486,"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":244.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":244.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":588.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":273.3999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":244.30000019073486,"connectEnd":244.30000019073486,"connectStart":244.30000019073486,"domainLookupEnd":244.30000019073486,"domainLookupStart":244.30000019073486,"fetchStart":244.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":244.30000019073486,"responseEnd":517.6999998092651,"responseStart":517.6999998092651,"secureConnectionStart":244.30000019073486},{"duration":344.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":244.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":244.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":589,"responseStart":0,"secureConnectionStart":0},{"duration":273.7000002861023,"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":244.59999990463257,"connectEnd":244.59999990463257,"connectStart":244.59999990463257,"domainLookupEnd":244.59999990463257,"domainLookupStart":244.59999990463257,"fetchStart":244.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":244.59999990463257,"responseEnd":518.3000001907349,"responseStart":518.3000001907349,"secureConnectionStart":244.59999990463257},{"duration":442.40000009536743,"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":245.5,"connectEnd":245.5,"connectStart":245.5,"domainLookupEnd":245.5,"domainLookupStart":245.5,"fetchStart":245.5,"redirectEnd":0,"redirectStart":0,"requestStart":245.5,"responseEnd":687.9000000953674,"responseStart":687.9000000953674,"secureConnectionStart":245.5},{"duration":739.9000000953674,"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":245.59999990463257,"connectEnd":245.59999990463257,"connectStart":245.59999990463257,"domainLookupEnd":245.59999990463257,"domainLookupStart":245.59999990463257,"fetchStart":245.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":245.59999990463257,"responseEnd":985.5,"responseStart":985.5,"secureConnectionStart":245.59999990463257},{"duration":87.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":600.9000000953674,"connectEnd":600.9000000953674,"connectStart":600.9000000953674,"domainLookupEnd":600.9000000953674,"domainLookupStart":600.9000000953674,"fetchStart":600.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":600.9000000953674,"responseEnd":688.4000000953674,"responseStart":688.4000000953674,"secureConnectionStart":600.9000000953674},{"duration":205.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/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&whisper-enabled=true","startTime":884,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":884,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1089.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":205.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/50bc9be5bfead1a25e72c1a9338c94f6-CDN/lu2cib/820016/12ta74/e108c7645258ccb43280ed3404e3e949/_/download/contextbatch/css/com.atlassian.jira.plugins.jira-development-integration-plugin:0,-_super,-jira.view.issue,-jira.global,-jira.general,-jira.browse.project,-project.issue.navigator,-atl.general/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":884.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":884.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1089.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":180.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/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&whisper-enabled=true","startTime":885.5,"connectEnd":885.5,"connectStart":885.5,"domainLookupEnd":885.5,"domainLookupStart":885.5,"fetchStart":885.5,"redirectEnd":0,"redirectStart":0,"requestStart":885.5,"responseEnd":1065.5999999046326,"responseStart":1065.5999999046326,"secureConnectionStart":885.5},{"duration":198.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/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&whisper-enabled=true","startTime":886,"connectEnd":886,"connectStart":886,"domainLookupEnd":886,"domainLookupStart":886,"fetchStart":886,"redirectEnd":0,"redirectStart":0,"requestStart":886,"responseEnd":1084.8000001907349,"responseStart":1084.8000001907349,"secureConnectionStart":886},{"duration":200.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/e0bf5781d46ea69fb123572974cf39de-CDN/lu2cib/820016/12ta74/e108c7645258ccb43280ed3404e3e949/_/download/contextbatch/js/com.atlassian.jira.plugins.jira-development-integration-plugin:0,-_super,-jira.view.issue,-jira.global,-jira.general,-jira.browse.project,-project.issue.navigator,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":886.3000001907349,"connectEnd":886.3000001907349,"connectStart":886.3000001907349,"domainLookupEnd":886.3000001907349,"domainLookupStart":886.3000001907349,"fetchStart":886.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":886.3000001907349,"responseEnd":1086.8000001907349,"responseStart":1086.8000001907349,"secureConnectionStart":886.3000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":69,"responseStart":236,"responseEnd":237,"domLoading":240,"domInteractive":1123,"domContentLoadedEventStart":1123,"domContentLoadedEventEnd":1167,"domComplete":1559,"loadEventStart":1559,"loadEventEnd":1559,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1106.0999999046326},{"name":"bigPipe.sidebar-id.end","time":1106.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":1107.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1109.5},{"name":"activityTabFullyLoaded","time":1191.5999999046326}],"measures":[],"correlationId":"4333ec713f9b26","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":96,"dbReadsTimeInMs":10,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Thanks, Oli. This makes sense, IIUC the event is populating local tables with data about the local instance. I assume the event sets sql_log_bin=0 or something to not replicate its dbstat tables.
So in this case, indeed it seems a property of the event (and the decision of the event developer) that it is something that wants to be active also on the slaves.
On the other hand, installing a monitoring tool on a server is not something I normally would expect to use MariaDB replication for? It is not clear to me why you mentioned it as risky to install the dbstat separately on each server with sql_log_bin = off. Still, this is always a difficult line to draw when using things like stored procedures, events, etc. in SQL databases, when something is part of the data, and when it is part of the software deployment.