Type:
Task
Priority:
Major
Resolution:
Fixed
Component/s:
None
It can be dangerous to run "set read_only" on a production server because it can block in close_cached_tables. More details about the pain this caused previously are at:
http://mysqlha.blogspot.com/2008/07/what-exactly-does-flush-tables-with.html
Per the code in set_var.cc:
/*
Perform a 'FLUSH TABLES WITH READ LOCK'.
This is a 3 step process:
- [1] lock_global_read_lock()
- [2] close_cached_tables()
- [3] make_global_read_lock_block_commit()
[1] prevents new connections from obtaining tables locked for write.
[2] waits until all existing connections close their tables.
[3] prevents transactions from being committed.
*/
Can there be a variant that doesn't do #2? My workload doesn't use MyISAM and I don't know if #2 is done because of MyISAM. Calling close_cached_tables seems like a heavy way to force LOCK TABLEs to be unlocked. Any long running queries will cause #2 to block.
See also http://lists.mysql.com/commits/142825
relates to
MDEV-309
reimplement FLUSH ... CHECKPOINT
Open
Sergei Golubchik
made changes -
2012-02-02 13:21
Field
Original Value
New Value
Description
It can be dangerous to run "set read_only" on a production server because it can block in close_cached_tables. More details about the pain this caused previously are at:
http://mysqlha.blogspot.com/2008/07/what-exactly-does-flush-tables-with.html
Per the code in set_var.cc:
/*
Perform a 'FLUSH TABLES WITH READ LOCK'.
This is a 3 step process:
- [1] lock_global_read_lock()
- [2] close_cached_tables()
- [3] make_global_read_lock_block_commit()
[1] prevents new connections from obtaining tables locked for write.
[2] waits until all existing connections close their tables.
[3] prevents transactions from being committed.
*/
Can there be a variant that doesn't do #2? My workload doesn't use MyISAM and I don't know if #2 is done because of MyISAM. Calling close_cached_tables seems like a heavy way to force LOCK TABLEs to be unlocked. Any long running queries will cause #2 to block.
It can be dangerous to run "set read_only" on a production server because it can block in close_cached_tables. More details about the pain this caused previously are at:
http://mysqlha.blogspot.com/2008/07/what-exactly-does-flush-tables-with.html
Per the code in set_var.cc:
{code}
/*
Perform a 'FLUSH TABLES WITH READ LOCK'.
This is a 3 step process:
- [1] lock_global_read_lock()
- [2] close_cached_tables()
- [3] make_global_read_lock_block_commit()
[1] prevents new connections from obtaining tables locked for write.
[2] waits until all existing connections close their tables.
[3] prevents transactions from being committed.
*/
{code}
Can there be a variant that doesn't do #2? My workload doesn't use MyISAM and I don't know if #2 is done because of MyISAM. Calling close_cached_tables seems like a heavy way to force LOCK TABLEs to be unlocked. Any long running queries will cause #2 to block.
Sergei Golubchik
made changes -
2012-02-04 22:58
Workflow
jira
[ 10634
]
defaullt
[ 10770
]
Sergei Golubchik
made changes -
2012-03-22 12:17
Description
It can be dangerous to run "set read_only" on a production server because it can block in close_cached_tables. More details about the pain this caused previously are at:
http://mysqlha.blogspot.com/2008/07/what-exactly-does-flush-tables-with.html
Per the code in set_var.cc:
{code}
/*
Perform a 'FLUSH TABLES WITH READ LOCK'.
This is a 3 step process:
- [1] lock_global_read_lock()
- [2] close_cached_tables()
- [3] make_global_read_lock_block_commit()
[1] prevents new connections from obtaining tables locked for write.
[2] waits until all existing connections close their tables.
[3] prevents transactions from being committed.
*/
{code}
Can there be a variant that doesn't do #2? My workload doesn't use MyISAM and I don't know if #2 is done because of MyISAM. Calling close_cached_tables seems like a heavy way to force LOCK TABLEs to be unlocked. Any long running queries will cause #2 to block.
It can be dangerous to run "set read_only" on a production server because it can block in close_cached_tables. More details about the pain this caused previously are at:
http://mysqlha.blogspot.com/2008/07/what-exactly-does-flush-tables-with.html
Per the code in set_var.cc:
{code}
/*
Perform a 'FLUSH TABLES WITH READ LOCK'.
This is a 3 step process:
- [1] lock_global_read_lock()
- [2] close_cached_tables()
- [3] make_global_read_lock_block_commit()
[1] prevents new connections from obtaining tables locked for write.
[2] waits until all existing connections close their tables.
[3] prevents transactions from being committed.
*/
{code}
Can there be a variant that doesn't do #2? My workload doesn't use MyISAM and I don't know if #2 is done because of MyISAM. Calling close_cached_tables seems like a heavy way to force LOCK TABLEs to be unlocked. Any long running queries will cause #2 to block.
See also http://lists.mysql.com/commits/142825
Alexey Botchkov
made changes -
2012-05-08 14:50
Assignee
Michael Widenius
[ monty
]
Alexey Botchkov
[ holyfoot
]
Sergei Golubchik
made changes -
2012-05-16 11:25
Assignee
Sergei Golubchik
[ serg
]
Alexey Botchkov
[ holyfoot
]
Alexey Botchkov
made changes -
2012-05-22 08:06
Resolution
Fixed
[ 1
]
Status
Open
[ 1
]
Closed
[ 6
]
Sergei Golubchik
made changes -
2014-06-13 15:06
Workflow
defaullt
[ 10770
]
MariaDB v2
[ 45004
]
Sergei Golubchik
made changes -
2021-12-06 21:22
Workflow
MariaDB v3
[ 65512
]
MariaDB v4
[ 131902
]
{"report":{"fcp":988.5,"ttfb":358.6000003814697,"pageVisibility":"visible","entityId":10634,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"04a88b89-deb7-4387-a44e-28527004c842","navigationType":0,"readyForUser":1100.8999996185303,"redirectCount":0,"resourceLoadedEnd":1044.6000003814697,"resourceLoadedStart":364.3999996185303,"resourceTiming":[{"duration":105,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":364.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":364.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":469.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":105.10000038146973,"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":364.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":364.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":469.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":160.60000038146973,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":364.8999996185303,"connectEnd":364.8999996185303,"connectStart":364.8999996185303,"domainLookupEnd":364.8999996185303,"domainLookupStart":364.8999996185303,"fetchStart":364.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":364.8999996185303,"responseEnd":525.5,"responseStart":525.5,"secureConnectionStart":364.8999996185303},{"duration":220.29999923706055,"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":365.1000003814697,"connectEnd":365.1000003814697,"connectStart":365.1000003814697,"domainLookupEnd":365.1000003814697,"domainLookupStart":365.1000003814697,"fetchStart":365.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":365.1000003814697,"responseEnd":585.3999996185303,"responseStart":585.3999996185303,"secureConnectionStart":365.1000003814697},{"duration":223.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":365.3999996185303,"connectEnd":365.3999996185303,"connectStart":365.3999996185303,"domainLookupEnd":365.3999996185303,"domainLookupStart":365.3999996185303,"fetchStart":365.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":365.3999996185303,"responseEnd":589.1999998092651,"responseStart":589.1999998092651,"secureConnectionStart":365.3999996185303},{"duration":224.0999994277954,"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":365.6000003814697,"connectEnd":365.6000003814697,"connectStart":365.6000003814697,"domainLookupEnd":365.6000003814697,"domainLookupStart":365.6000003814697,"fetchStart":365.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":365.6000003814697,"responseEnd":589.6999998092651,"responseStart":589.6999998092651,"secureConnectionStart":365.6000003814697},{"duration":224.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":365.80000019073486,"connectEnd":365.80000019073486,"connectStart":365.80000019073486,"domainLookupEnd":365.80000019073486,"domainLookupStart":365.80000019073486,"fetchStart":365.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":365.80000019073486,"responseEnd":590,"responseStart":590,"secureConnectionStart":365.80000019073486},{"duration":302.6000003814697,"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":365.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":365.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":668.5,"responseStart":0,"secureConnectionStart":0},{"duration":224.39999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":366.1000003814697,"connectEnd":366.1000003814697,"connectStart":366.1000003814697,"domainLookupEnd":366.1000003814697,"domainLookupStart":366.1000003814697,"fetchStart":366.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":366.1000003814697,"responseEnd":590.5,"responseStart":590.5,"secureConnectionStart":366.1000003814697},{"duration":302.4000005722046,"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":366.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":366.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":668.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":224.60000038146973,"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":366.3999996185303,"connectEnd":366.3999996185303,"connectStart":366.3999996185303,"domainLookupEnd":366.3999996185303,"domainLookupStart":366.3999996185303,"fetchStart":366.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":366.3999996185303,"responseEnd":591,"responseStart":591,"secureConnectionStart":366.3999996185303},{"duration":658.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":367.30000019073486,"connectEnd":367.30000019073486,"connectStart":367.30000019073486,"domainLookupEnd":367.30000019073486,"domainLookupStart":367.30000019073486,"fetchStart":367.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":367.30000019073486,"responseEnd":1025.8000001907349,"responseStart":1025.8000001907349,"secureConnectionStart":367.30000019073486},{"duration":661.9000005722046,"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":371.8999996185303,"connectEnd":371.8999996185303,"connectStart":371.8999996185303,"domainLookupEnd":371.8999996185303,"domainLookupStart":371.8999996185303,"fetchStart":371.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":371.8999996185303,"responseEnd":1033.8000001907349,"responseStart":1033.8000001907349,"secureConnectionStart":371.8999996185303},{"duration":205.0999994277954,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":696.1000003814697,"connectEnd":696.1000003814697,"connectStart":696.1000003814697,"domainLookupEnd":696.1000003814697,"domainLookupStart":696.1000003814697,"fetchStart":696.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":696.1000003814697,"responseEnd":901.1999998092651,"responseStart":901.1999998092651,"secureConnectionStart":696.1000003814697},{"duration":100.80000019073486,"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":943.8000001907349,"connectEnd":943.8000001907349,"connectStart":943.8000001907349,"domainLookupEnd":943.8000001907349,"domainLookupStart":943.8000001907349,"fetchStart":943.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":943.8000001907349,"responseEnd":1044.6000003814697,"responseStart":1044.6000003814697,"secureConnectionStart":943.8000001907349},{"duration":152.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":981.6999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":981.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1134.1999998092651,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":163,"responseStart":358,"responseEnd":366,"domLoading":362,"domInteractive":1175,"domContentLoadedEventStart":1175,"domContentLoadedEventEnd":1240,"domComplete":1363,"loadEventStart":1363,"loadEventEnd":1363,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1140.1000003814697},{"name":"bigPipe.sidebar-id.end","time":1140.8999996185303},{"name":"bigPipe.activity-panel-pipe-id.start","time":1141.1000003814697},{"name":"bigPipe.activity-panel-pipe-id.end","time":1144.8000001907349},{"name":"activityTabFullyLoaded","time":1262}],"measures":[],"correlationId":"cd0527101023b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":137,"dbReadsTimeInMs":26,"dbConnsTimeInMs":37,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}