Type:
Task
Priority:
Major
Resolution:
Fixed
Implement BACKUP LOCK [database.] table_name and BACKUP UNLOCK
These commands are needed for external backup tools, like mariabackup, to ensure that all files for a table are from the same generation (ie, was created by the same CREATE, RENAME or ALTER TABLE statement).
The typical usage of this by a backup tools is to do the following when copying a table:
BACKUP LOCK [database.] table_name
Open all files related to a table (for example, test.frm, test.MYI and test.MYD)
BACKUP UNLOCK
Copy data
Close files
The idea is that the BACKUP LOCK should be hold as short time as possible.
The time to take an uncontested lock is very short; While testing on a laptop from a perl program, I was able to do more than 50,000 LOCK + UNLOCK per second.
Other things:
Internally BACKUP LOCK is implemented by taking a MDLSHARED_HIGH_PRIO on the table object, which protects the table from any DDL operations.
One should use different connections for BACKUP STAGE ... and BACKUP LOCK commands as one should be able to do BACKUP LOCK commands while waiting to get the new BACKUP STAGE lock.
{"report":{"fcp":1097.1999998092651,"ttfb":427.5,"pageVisibility":"visible","entityId":69986,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"cfe72f88-dbd2-446c-81d1-382803d91b52","navigationType":0,"readyForUser":1162.2999992370605,"redirectCount":0,"resourceLoadedEnd":1248,"resourceLoadedStart":432.8999996185303,"resourceTiming":[{"duration":154.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":432.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":432.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":587.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":155,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":433.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":433.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":588.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":208.60000038146973,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":433.29999923706055,"connectEnd":433.29999923706055,"connectStart":433.29999923706055,"domainLookupEnd":433.29999923706055,"domainLookupStart":433.29999923706055,"fetchStart":433.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":433.29999923706055,"responseEnd":641.8999996185303,"responseStart":641.8999996185303,"secureConnectionStart":433.29999923706055},{"duration":298.4000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":433.5999994277954,"connectEnd":433.5999994277954,"connectStart":433.5999994277954,"domainLookupEnd":433.5999994277954,"domainLookupStart":433.5999994277954,"fetchStart":433.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":433.5999994277954,"responseEnd":732,"responseStart":732,"secureConnectionStart":433.5999994277954},{"duration":302.19999980926514,"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":433.69999980926514,"connectEnd":433.69999980926514,"connectStart":433.69999980926514,"domainLookupEnd":433.69999980926514,"domainLookupStart":433.69999980926514,"fetchStart":433.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":433.69999980926514,"responseEnd":735.8999996185303,"responseStart":735.8999996185303,"secureConnectionStart":433.69999980926514},{"duration":302.3999996185303,"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":433.8999996185303,"connectEnd":433.8999996185303,"connectStart":433.8999996185303,"domainLookupEnd":433.8999996185303,"domainLookupStart":433.8999996185303,"fetchStart":433.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":433.8999996185303,"responseEnd":736.2999992370605,"responseStart":736.2999992370605,"secureConnectionStart":433.8999996185303},{"duration":302.5,"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":434.19999980926514,"connectEnd":434.19999980926514,"connectStart":434.19999980926514,"domainLookupEnd":434.19999980926514,"domainLookupStart":434.19999980926514,"fetchStart":434.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":434.19999980926514,"responseEnd":736.6999998092651,"responseStart":736.6999998092651,"secureConnectionStart":434.19999980926514},{"duration":350.30000019073486,"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":434.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":434.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":784.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":302.5999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":434.5,"connectEnd":434.5,"connectStart":434.5,"domainLookupEnd":434.5,"domainLookupStart":434.5,"fetchStart":434.5,"redirectEnd":0,"redirectStart":0,"requestStart":434.5,"responseEnd":737.0999994277954,"responseStart":737.0999994277954,"secureConnectionStart":434.5},{"duration":350.19999980926514,"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":434.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":434.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":784.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":302.69999980926514,"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":434.8999996185303,"connectEnd":434.8999996185303,"connectStart":434.8999996185303,"domainLookupEnd":434.8999996185303,"domainLookupStart":434.8999996185303,"fetchStart":434.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":434.8999996185303,"responseEnd":737.5999994277954,"responseStart":737.5999994277954,"secureConnectionStart":434.8999996185303},{"duration":662,"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":435.79999923706055,"connectEnd":435.79999923706055,"connectStart":435.79999923706055,"domainLookupEnd":435.79999923706055,"domainLookupStart":435.79999923706055,"fetchStart":435.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":435.79999923706055,"responseEnd":1097.7999992370605,"responseStart":1097.7999992370605,"secureConnectionStart":435.79999923706055},{"duration":812.2000007629395,"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":435.79999923706055,"connectEnd":435.79999923706055,"connectStart":435.79999923706055,"domainLookupEnd":435.79999923706055,"domainLookupStart":435.79999923706055,"fetchStart":435.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":435.79999923706055,"responseEnd":1248,"responseStart":1248,"secureConnectionStart":435.79999923706055},{"duration":301.9000005722046,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":796.2999992370605,"connectEnd":796.2999992370605,"connectStart":796.2999992370605,"domainLookupEnd":796.2999992370605,"domainLookupStart":796.2999992370605,"fetchStart":796.2999992370605,"redirectEnd":0,"redirectStart":0,"requestStart":796.2999992370605,"responseEnd":1098.1999998092651,"responseStart":1098.1999998092651,"secureConnectionStart":796.2999992370605},{"duration":165,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1090.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1090.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1255.5,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":269,"responseStart":427,"responseEnd":428,"domLoading":430,"domInteractive":1274,"domContentLoadedEventStart":1274,"domContentLoadedEventEnd":1319,"domComplete":2106,"loadEventStart":2106,"loadEventEnd":2107,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1258.1999998092651},{"name":"bigPipe.sidebar-id.end","time":1259.1999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1259.3999996185303},{"name":"bigPipe.activity-panel-pipe-id.end","time":1261.7999992370605},{"name":"activityTabFullyLoaded","time":1327.8999996185303}],"measures":[],"correlationId":"7decf9fe665eb","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":101,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}