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":674,"ttfb":204.79999995231628,"pageVisibility":"visible","entityId":69986,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"dedacb48-9a82-4709-a240-c17016c2bd47","navigationType":0,"readyForUser":752.1000001430511,"redirectCount":0,"resourceLoadedEnd":728.4000000953674,"resourceLoadedStart":210.20000004768372,"resourceTiming":[{"duration":24.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":210.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":210.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":234.70000004768372,"responseStart":0,"secureConnectionStart":0},{"duration":25.100000143051147,"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":210.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":210.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":235.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":77.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":210.5,"connectEnd":210.5,"connectStart":210.5,"domainLookupEnd":210.5,"domainLookupStart":210.5,"fetchStart":210.5,"redirectEnd":0,"redirectStart":0,"requestStart":210.5,"responseEnd":287.90000009536743,"responseStart":287.90000009536743,"secureConnectionStart":210.5},{"duration":169.59999990463257,"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":210.60000014305115,"connectEnd":210.60000014305115,"connectStart":210.60000014305115,"domainLookupEnd":210.60000014305115,"domainLookupStart":210.60000014305115,"fetchStart":210.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":210.60000014305115,"responseEnd":380.2000000476837,"responseStart":380.2000000476837,"secureConnectionStart":210.60000014305115},{"duration":166.19999980926514,"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":210.60000014305115,"connectEnd":210.60000014305115,"connectStart":210.60000014305115,"domainLookupEnd":210.60000014305115,"domainLookupStart":210.60000014305115,"fetchStart":210.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":210.60000014305115,"responseEnd":376.7999999523163,"responseStart":376.7999999523163,"secureConnectionStart":210.60000014305115},{"duration":170.20000004768372,"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":210.79999995231628,"connectEnd":210.79999995231628,"connectStart":210.79999995231628,"domainLookupEnd":210.79999995231628,"domainLookupStart":210.79999995231628,"fetchStart":210.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":210.79999995231628,"responseEnd":381,"responseStart":381,"secureConnectionStart":210.79999995231628},{"duration":170.80000019073486,"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":210.79999995231628,"connectEnd":210.79999995231628,"connectStart":210.79999995231628,"domainLookupEnd":210.79999995231628,"domainLookupStart":210.79999995231628,"fetchStart":210.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":210.79999995231628,"responseEnd":381.60000014305115,"responseStart":381.5,"secureConnectionStart":210.79999995231628},{"duration":171,"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":211,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":211,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":382,"responseStart":0,"secureConnectionStart":0},{"duration":170.89999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":211.10000014305115,"connectEnd":211.10000014305115,"connectStart":211.10000014305115,"domainLookupEnd":211.10000014305115,"domainLookupStart":211.10000014305115,"fetchStart":211.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":211.10000014305115,"responseEnd":382,"responseStart":382,"secureConnectionStart":211.10000014305115},{"duration":171.30000019073486,"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":211.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":211.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":382.60000014305115,"responseStart":0,"secureConnectionStart":0},{"duration":171.5,"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":211.29999995231628,"connectEnd":211.29999995231628,"connectStart":211.29999995231628,"domainLookupEnd":211.29999995231628,"domainLookupStart":211.29999995231628,"fetchStart":211.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":211.29999995231628,"responseEnd":382.7999999523163,"responseStart":382.7999999523163,"secureConnectionStart":211.29999995231628},{"duration":488.5,"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":212.10000014305115,"connectEnd":212.10000014305115,"connectStart":212.10000014305115,"domainLookupEnd":212.10000014305115,"domainLookupStart":212.10000014305115,"fetchStart":212.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":212.10000014305115,"responseEnd":700.6000001430511,"responseStart":700.6000001430511,"secureConnectionStart":212.10000014305115},{"duration":516.2000000476837,"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":212.20000004768372,"connectEnd":212.20000004768372,"connectStart":212.20000004768372,"domainLookupEnd":212.20000004768372,"domainLookupStart":212.20000004768372,"fetchStart":212.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":212.20000004768372,"responseEnd":728.4000000953674,"responseStart":728.4000000953674,"secureConnectionStart":212.20000004768372},{"duration":265.2000000476837,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":435.90000009536743,"connectEnd":435.90000009536743,"connectStart":435.90000009536743,"domainLookupEnd":435.90000009536743,"domainLookupStart":435.90000009536743,"fetchStart":435.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":435.90000009536743,"responseEnd":701.1000001430511,"responseStart":701.1000001430511,"secureConnectionStart":435.90000009536743},{"duration":62,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":667.6000001430511,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":667.6000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":729.6000001430511,"responseStart":0,"secureConnectionStart":0},{"duration":94.20000004768372,"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":783.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":783.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":878,"responseStart":0,"secureConnectionStart":0},{"duration":94.10000014305115,"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":784.5,"connectEnd":784.5,"connectStart":784.5,"domainLookupEnd":784.5,"domainLookupStart":784.5,"fetchStart":784.5,"redirectEnd":0,"redirectStart":0,"requestStart":784.5,"responseEnd":878.6000001430511,"responseStart":878.6000001430511,"secureConnectionStart":784.5}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":80,"responseStart":205,"responseEnd":208,"domLoading":208,"domInteractive":849,"domContentLoadedEventStart":849,"domContentLoadedEventEnd":884,"domComplete":1606,"loadEventStart":1606,"loadEventEnd":1608,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":822.2999999523163},{"name":"bigPipe.sidebar-id.end","time":823},{"name":"bigPipe.activity-panel-pipe-id.start","time":823.1000001430511},{"name":"bigPipe.activity-panel-pipe-id.end","time":825.4000000953674},{"name":"activityTabFullyLoaded","time":890.2000000476837}],"measures":[],"correlationId":"cb2495fda08e78","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":78,"dbReadsTimeInMs":11,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}