Currently execution time for the replicated query is not limited in any clear way. On primary node we can use max_statement_time, but this value is neither passed to slave nor enforced for SQL thread when it's set locally. So, there is no way to "control" replication delay and just stop with error when it's too big already.
I think option to stop with error after specific timeout (that may be different than local max_statement_time or primary's max_statement_time) would be useful for replication setups.
Slave appliers indeed ignore global.max_statement_time which they must be initialized with (as the user connection threads do). Whether that's designed on purpose (doubts) or is actually buggy remains to be seen.
Should there be no such effect the requested functionally could be provided without any new option.
To add more, init-slave is around to fine tune slave appliers so @@SESSION level setting
like this one could be technically done though that.
Andrei Elkin
added a comment - - edited Slave appliers indeed ignore global.max_statement_time which they must be initialized with (as the user connection threads do). Whether that's designed on purpose (doubts) or is actually buggy remains to be seen.
Should there be no such effect the requested functionally could be provided without any new option.
To add more, init-slave is around to fine tune slave appliers so @@SESSION level setting
like this one could be technically done though that.
What do you mean "slave appliers indeed ignore global.max_statement_time which they must be initialized with (as the user connection threads do)" ? Every THD gets max_statement_time, slave thread too. It's copied from global in plugin_thdvar_init() which is called from THD::init(). What slave threads don't do — they don't set the query timer to expire after max_statement_time seconds. In THD::set_query_timer() slave threads are explicitly excluded. This looks very much like on purpose, one can hardly write slave_thread || unintentionally.
Sergei Golubchik
added a comment - What do you mean "slave appliers indeed ignore global.max_statement_time which they must be initialized with (as the user connection threads do)" ? Every THD gets max_statement_time , slave thread too. It's copied from global in plugin_thdvar_init() which is called from THD::init() . What slave threads don't do — they don't set the query timer to expire after max_statement_time seconds. In THD::set_query_timer() slave threads are explicitly excluded. This looks very much like on purpose, one can hardly write slave_thread || unintentionally.
I don't think it's a good idea. If the slave thread would always be using global.max_statement_time — that's one thing. But if you're adding an option anyway, better to have an option like --slave-max-statement-time and not --slave-uses-global-max-statement-time
Sergei Golubchik
added a comment - I don't think it's a good idea. If the slave thread would always be using global.max_statement_time — that's one thing. But if you're adding an option anyway, better to have an option like --slave-max-statement-time and not --slave-uses-global-max-statement-time
The adopted solution was to add a new variable, Slave_max_statement_time, which can be
used to limit the time that slave is going to wait for a query to be executed.
The slave will no honor max_statement_time.
Michael Widenius
added a comment - The adopted solution was to add a new variable, Slave_max_statement_time, which can be
used to limit the time that slave is going to wait for a query to be executed.
The slave will no honor max_statement_time.
People
Brandon Nesterenko
Valerii Kravchuk
Votes:
0Vote for this issue
Watchers:
7Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":1089.6999998092651,"ttfb":207.09999990463257,"pageVisibility":"visible","entityId":105699,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"57aba9a3-2b6c-469a-a323-7df1a5564378","navigationType":0,"readyForUser":1228.5999999046326,"redirectCount":0,"resourceLoadedEnd":1498.6999998092651,"resourceLoadedStart":212.89999961853027,"resourceTiming":[{"duration":182.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":212.89999961853027,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":212.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":395.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":182.80000019073486,"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":213.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":213.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":396,"responseStart":0,"secureConnectionStart":0},{"duration":199.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":213.2999997138977,"connectEnd":213.2999997138977,"connectStart":213.2999997138977,"domainLookupEnd":213.2999997138977,"domainLookupStart":213.2999997138977,"fetchStart":213.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":213.2999997138977,"responseEnd":412.8999996185303,"responseStart":412.8999996185303,"secureConnectionStart":213.2999997138977},{"duration":364.5,"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":213.5,"connectEnd":213.5,"connectStart":213.5,"domainLookupEnd":213.5,"domainLookupStart":213.5,"fetchStart":213.5,"redirectEnd":0,"redirectStart":0,"requestStart":213.5,"responseEnd":578,"responseStart":578,"secureConnectionStart":213.5},{"duration":369,"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":213.7999997138977,"connectEnd":213.7999997138977,"connectStart":213.7999997138977,"domainLookupEnd":213.7999997138977,"domainLookupStart":213.7999997138977,"fetchStart":213.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":213.7999997138977,"responseEnd":582.7999997138977,"responseStart":582.7999997138977,"secureConnectionStart":213.7999997138977},{"duration":369.2999997138977,"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":214,"connectEnd":214,"connectStart":214,"domainLookupEnd":214,"domainLookupStart":214,"fetchStart":214,"redirectEnd":0,"redirectStart":0,"requestStart":214,"responseEnd":583.2999997138977,"responseStart":583.2999997138977,"secureConnectionStart":214},{"duration":369.69999980926514,"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":214.19999980926514,"connectEnd":214.19999980926514,"connectStart":214.19999980926514,"domainLookupEnd":214.19999980926514,"domainLookupStart":214.19999980926514,"fetchStart":214.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":214.19999980926514,"responseEnd":583.8999996185303,"responseStart":583.8999996185303,"secureConnectionStart":214.19999980926514},{"duration":419,"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":214.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":214.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":633.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":369.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":214.5,"connectEnd":214.5,"connectStart":214.5,"domainLookupEnd":214.5,"domainLookupStart":214.5,"fetchStart":214.5,"redirectEnd":0,"redirectStart":0,"requestStart":214.5,"responseEnd":584.3999996185303,"responseStart":584.3999996185303,"secureConnectionStart":214.5},{"duration":418.80000019073486,"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":214.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":214.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":633.5,"responseStart":0,"secureConnectionStart":0},{"duration":370.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":214.7999997138977,"connectEnd":214.7999997138977,"connectStart":214.7999997138977,"domainLookupEnd":214.7999997138977,"domainLookupStart":214.7999997138977,"fetchStart":214.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":214.7999997138977,"responseEnd":585,"responseStart":585,"secureConnectionStart":214.7999997138977},{"duration":1283,"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":215.69999980926514,"connectEnd":215.69999980926514,"connectStart":215.69999980926514,"domainLookupEnd":215.69999980926514,"domainLookupStart":215.69999980926514,"fetchStart":215.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":215.69999980926514,"responseEnd":1498.6999998092651,"responseStart":1498.6999998092651,"secureConnectionStart":215.69999980926514},{"duration":1282.5,"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":215.69999980926514,"connectEnd":215.69999980926514,"connectStart":215.69999980926514,"domainLookupEnd":215.69999980926514,"domainLookupStart":215.69999980926514,"fetchStart":215.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":215.69999980926514,"responseEnd":1498.1999998092651,"responseStart":1498.1999998092651,"secureConnectionStart":215.69999980926514},{"duration":233.2000002861023,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":669.3999996185303,"connectEnd":669.3999996185303,"connectStart":669.3999996185303,"domainLookupEnd":669.3999996185303,"domainLookupStart":669.3999996185303,"fetchStart":669.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":669.3999996185303,"responseEnd":902.5999999046326,"responseStart":902.5999999046326,"secureConnectionStart":669.3999996185303},{"duration":639.9000000953674,"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":964.0999999046326,"connectEnd":964.0999999046326,"connectStart":964.0999999046326,"domainLookupEnd":964.0999999046326,"domainLookupStart":964.0999999046326,"fetchStart":964.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":964.0999999046326,"responseEnd":1604,"responseStart":1603.8999996185303,"secureConnectionStart":964.0999999046326}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":42,"responseStart":207,"responseEnd":209,"domLoading":210,"domInteractive":1555,"domContentLoadedEventStart":1555,"domContentLoadedEventEnd":1655,"domComplete":2230,"loadEventStart":2230,"loadEventEnd":2231,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1503.8999996185303},{"name":"bigPipe.sidebar-id.end","time":1504.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1504.8999996185303},{"name":"bigPipe.activity-panel-pipe-id.end","time":1506.7999997138977},{"name":"activityTabFullyLoaded","time":1689.3999996185303}],"measures":[],"correlationId":"ea84b67ce7030e","effectiveType":"4g","downlink":9.6,"rtt":0,"serverDuration":108,"dbReadsTimeInMs":9,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Slave appliers indeed ignore global.max_statement_time which they must be initialized with (as the user connection threads do). Whether that's designed on purpose (doubts) or is actually buggy remains to be seen.
Should there be no such effect the requested functionally could be provided without any new option.
To add more, init-slave is around to fine tune slave appliers so @@SESSION level setting
like this one could be technically done though that.