When wanting to do a selective restore of a backup taken with mariabackup DISCARD TABLESPACE / IMPORT TABLESPACE is used after preparing the backup with mariabackup --prepare --export
When having a SEQUENCE backed by an InnoDB table the related .ibd tablespace file can't be discarded though:
MariaDB [test]> alter table test_sequence discard tablespace;
|
ERROR 1031 (HY000): Storage engine SEQUENCE of the table `test`.`test_sequence` doesn't have this option
|
So there does not seem to be a way to restore such a sequence from a physical backup like mariabackup.
IMHO the SEQUENCE engine here should not just outright refuse such ALTER attempts, but pass them through to the underlying engine actually used for sequence storage.
{"report":{"fcp":1520.2999997138977,"ttfb":400.59999990463257,"pageVisibility":"visible","entityId":125540,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"18931eb6-e409-46c4-8324-e3cd60f5c876","navigationType":0,"readyForUser":1604,"redirectCount":0,"resourceLoadedEnd":1271.7999997138977,"resourceLoadedStart":409.09999990463257,"resourceTiming":[{"duration":39.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":409.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":409.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":448.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":40.89999961853027,"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":409.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":409.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":450.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":462.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":409.5,"connectEnd":409.5,"connectStart":409.5,"domainLookupEnd":409.5,"domainLookupStart":409.5,"fetchStart":409.5,"redirectEnd":0,"redirectStart":0,"requestStart":457.09999990463257,"responseEnd":871.9000000953674,"responseStart":479.90000009536743,"secureConnectionStart":409.5},{"duration":819.7000002861023,"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":409.69999980926514,"connectEnd":409.69999980926514,"connectStart":409.69999980926514,"domainLookupEnd":409.69999980926514,"domainLookupStart":409.69999980926514,"fetchStart":409.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":457.2999997138977,"responseEnd":1229.4000000953674,"responseStart":492.90000009536743,"secureConnectionStart":409.69999980926514},{"duration":97.89999961853027,"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":409.90000009536743,"connectEnd":409.90000009536743,"connectStart":409.90000009536743,"domainLookupEnd":409.90000009536743,"domainLookupStart":409.90000009536743,"fetchStart":409.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":458.59999990463257,"responseEnd":507.7999997138977,"responseStart":490.2999997138977,"secureConnectionStart":409.90000009536743},{"duration":93.19999980926514,"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":410.09999990463257,"connectEnd":410.09999990463257,"connectStart":410.09999990463257,"domainLookupEnd":410.09999990463257,"domainLookupStart":410.09999990463257,"fetchStart":410.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":458.90000009536743,"responseEnd":503.2999997138977,"responseStart":486.69999980926514,"secureConnectionStart":410.09999990463257},{"duration":96.90000009536743,"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":410.19999980926514,"connectEnd":410.19999980926514,"connectStart":410.19999980926514,"domainLookupEnd":410.19999980926514,"domainLookupStart":410.19999980926514,"fetchStart":410.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":459.09999990463257,"responseEnd":507.09999990463257,"responseStart":487.90000009536743,"secureConnectionStart":410.19999980926514},{"duration":41.19999980926514,"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":410.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":410.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":451.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":99.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":410.59999990463257,"connectEnd":410.59999990463257,"connectStart":410.59999990463257,"domainLookupEnd":410.59999990463257,"domainLookupStart":410.59999990463257,"fetchStart":410.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":459.09999990463257,"responseEnd":509.90000009536743,"responseStart":493.5,"secureConnectionStart":410.59999990463257},{"duration":43.90000009536743,"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":410.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":410.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":454.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":106.19999980926514,"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":411,"connectEnd":411,"connectStart":411,"domainLookupEnd":411,"domainLookupStart":411,"fetchStart":411,"redirectEnd":0,"redirectStart":0,"requestStart":460,"responseEnd":517.1999998092651,"responseStart":497.19999980926514,"secureConnectionStart":411},{"duration":847,"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":416.59999990463257,"connectEnd":416.59999990463257,"connectStart":416.59999990463257,"domainLookupEnd":416.59999990463257,"domainLookupStart":416.59999990463257,"fetchStart":416.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":519.7999997138977,"responseEnd":1263.5999999046326,"responseStart":1261,"secureConnectionStart":416.59999990463257},{"duration":854.3999996185303,"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":417.40000009536743,"connectEnd":417.40000009536743,"connectStart":417.40000009536743,"domainLookupEnd":417.40000009536743,"domainLookupStart":417.40000009536743,"fetchStart":417.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":591.9000000953674,"responseEnd":1271.7999997138977,"responseStart":1264.5999999046326,"secureConnectionStart":417.40000009536743},{"duration":230.30000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1020.1999998092651,"connectEnd":1020.1999998092651,"connectStart":1020.1999998092651,"domainLookupEnd":1020.1999998092651,"domainLookupStart":1020.1999998092651,"fetchStart":1020.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1198.2999997138977,"responseEnd":1250.5,"responseStart":1249.2999997138977,"secureConnectionStart":1020.1999998092651},{"duration":165.7000002861023,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1468.1999998092651,"connectEnd":1468.1999998092651,"connectStart":1468.1999998092651,"domainLookupEnd":1468.1999998092651,"domainLookupStart":1468.1999998092651,"fetchStart":1468.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1598.5,"responseEnd":1633.9000000953674,"responseStart":1632.9000000953674,"secureConnectionStart":1468.1999998092651},{"duration":170.69999980926514,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1513.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1513.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1684.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":116.5,"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":1687.2999997138977,"connectEnd":1687.2999997138977,"connectStart":1687.2999997138977,"domainLookupEnd":1687.2999997138977,"domainLookupStart":1687.2999997138977,"fetchStart":1687.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":1687.2999997138977,"responseEnd":1803.7999997138977,"responseStart":1803.7999997138977,"secureConnectionStart":1687.2999997138977}],"fetchStart":0,"domainLookupStart":194,"domainLookupEnd":205,"connectStart":205,"connectEnd":223,"secureConnectionStart":213,"requestStart":225,"responseStart":401,"responseEnd":417,"domLoading":405,"domInteractive":1733,"domContentLoadedEventStart":1733,"domContentLoadedEventEnd":1800,"domComplete":1846,"loadEventStart":1846,"loadEventEnd":1847,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1691},{"name":"bigPipe.sidebar-id.end","time":1691.7999997138977},{"name":"bigPipe.activity-panel-pipe-id.start","time":1692},{"name":"bigPipe.activity-panel-pipe-id.end","time":1696},{"name":"activityTabFullyLoaded","time":1818.4000000953674}],"measures":[],"correlationId":"e75a6e67ddf1de","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":112,"dbReadsTimeInMs":14,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
During the execution of the following, ha_innobase::discard_or_import_tablespace() is never invoked. ha_innobase::create() is.
--source include/have_innodb.inc
The error code is being returned by the base member function handler::ha_discard_or_import_tablespace() and reported here:
10.4 a34b989f0c0ae8a968ac5b881a41a9143c9dcdeb
#0 my_error (nr=1031, MyFlags=0) at /mariadb/10.4/mysys/my_error.c:109
#1 0x0000561f8938740f in ha_sequence::print_error (this=<optimized out>, error=<optimized out>, errflag=<optimized out>) at /mariadb/10.4/sql/ha_sequence.cc:368
#2 0x0000561f891623c8 in mysql_discard_or_import_tablespace (thd=thd@entry=0x7f5548018d68, table_list=table_list@entry=0x7f55480241d8, discard=true) at /mariadb/10.4/sql/sql_table.cc:6213
#3 0x0000561f891d4ecf in Sql_cmd_discard_import_tablespace::execute (this=0x7f55480248d0, thd=0x7f5548018d68) at /mariadb/10.4/sql/sql_alter.cc:568
#4 0x0000561f890ccc37 in mysql_execute_command (thd=thd@entry=0x7f5548018d68) at /mariadb/10.4/sql/sql_parse.cc:6218
#5 0x0000561f890cdad9 in mysql_parse (thd=thd@entry=0x7f5548018d68, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f55580ae390, is_com_multi=is_com_multi@entry=false,
is_next_command=is_next_command@entry=false) at /mariadb/10.4/sql/sql_parse.cc:8012
#6 0x0000561f890cf506 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f5548018d68, packet=packet@entry=0x7f554800d3f9 "alter table s discard tablespace",
packet_length=packet_length@entry=32, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /mariadb/10.4/sql/sql_parse.cc:1857