Even though fix for MDEV-11335 works for partitioned MyISAM tables in simple cases like this:
MariaDB [test]> show create table tt\G
|
*************************** 1. row ***************************
|
Table: tt
|
Create Table: CREATE TABLE `tt` (
|
`a` int(11) DEFAULT NULL,
|
`b` int(11) DEFAULT '1',
|
KEY `b` (`b`)
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PACK_KEYS=1 DELAY_KEY_WRITE=1
|
/*!50100 PARTITION BY HASH (b)
|
PARTITIONS 30 */
|
1 row in set (0.00 sec)
|
|
MariaDB [test]> alter online table tt delay_key_write=0;
|
Query OK, 0 rows affected (0.01 sec)
|
Records: 0 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> alter online table tt delay_key_write=1;
|
Query OK, 0 rows affected (0.00 sec)
|
Records: 0 Duplicates: 0 Warnings: 0
|
rows are still copied for a bit more complex tables (the difference noted so far is the presence of datetime columns with current_timestamp [ON UPDATE CURRENT_TIMESTAMP] default values, like these:
MariaDB [test]> create table ttt(id_1 int auto_increment, id_2 int, id_3 int, d1 date, dt1 datetime default current_timestamp, dt2 datetime default current_timestamp on update current_timestamp, primary key (id_2, id_3), key(id_1)) engine=myisam partition by hash(id_2) partitions 3 (partition p01 engine=myisam, partition p02 engine=myisam, partition p03 engine=myisam);
|
Query OK, 0 rows affected (0.04 sec)
|
|
MariaDB [test]> insert into ttt values(0, 1, 1, NULL, now(), now());
|
Query OK, 1 row affected (0.00 sec)
|
|
MariaDB [test]> select * from ttt;
|
+------+------+------+------+---------------------+---------------------+
|
| id_1 | id_2 | id_3 | d1 | dt1 | dt2 |
|
+------+------+------+------+---------------------+---------------------+
|
| 1 | 1 | 1 | NULL | 2017-06-15 10:35:10 | 2017-06-15 10:35:10 |
|
+------+------+------+------+---------------------+---------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [test]> alter online table tt delay_key_write=1;
|
Query OK, 0 rows affected (0.00 sec)
|
Records: 0 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> alter online table tt delay_key_write=0;
|
Query OK, 0 rows affected (0.01 sec)
|
Records: 0 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> alter online table ttt delay_key_write=1;
|
ERROR 1845 (0A000): LOCK=NONE is not supported for this operation. Try LOCK=SHARED.
|
MariaDB [test]> alter online table ttt delay_key_write=1, lock=shared;
|
Query OK, 1 row affected (0.04 sec)
|
Records: 1 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> show create table ttt\G
|
*************************** 1. row ***************************
|
Table: ttt
|
Create Table: CREATE TABLE `ttt` (
|
`id_1` int(11) NOT NULL AUTO_INCREMENT,
|
`id_2` int(11) NOT NULL,
|
`id_3` int(11) NOT NULL,
|
`d1` date DEFAULT NULL,
|
`dt1` datetime DEFAULT CURRENT_TIMESTAMP,
|
`dt2` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
PRIMARY KEY (`id_2`,`id_3`),
|
KEY `id_1` (`id_1`)
|
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1
|
/*!50100 PARTITION BY HASH (id_2)
|
(PARTITION p01 ENGINE = MyISAM,
|
PARTITION p02 ENGINE = MyISAM,
|
PARTITION p03 ENGINE = MyISAM) */
|
1 row in set (0.00 sec)
|
I think we should either fix this case also, or document it clearly as a known limitation.
{"report":{"fcp":1605.0999994277954,"ttfb":222.5999994277954,"pageVisibility":"visible","entityId":61800,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":0.5,"journeyId":"9e2bd9c0-7f22-49e8-bf89-96f0776a97e8","navigationType":0,"readyForUser":1705,"redirectCount":0,"resourceLoadedEnd":2110.199999809265,"resourceLoadedStart":233.5999994277954,"resourceTiming":[{"duration":493.1000003814697,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":233.5999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":233.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":726.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":493.1000003814697,"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":233.89999961853027,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":233.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":727,"responseStart":0,"secureConnectionStart":0},{"duration":522.1000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":234.0999994277954,"connectEnd":234.0999994277954,"connectStart":234.0999994277954,"domainLookupEnd":234.0999994277954,"domainLookupStart":234.0999994277954,"fetchStart":234.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":234.0999994277954,"responseEnd":756.1999998092651,"responseStart":756.1999998092651,"secureConnectionStart":234.0999994277954},{"duration":652.6999998092651,"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":234.30000019073486,"connectEnd":234.30000019073486,"connectStart":234.30000019073486,"domainLookupEnd":234.30000019073486,"domainLookupStart":234.30000019073486,"fetchStart":234.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":234.30000019073486,"responseEnd":887,"responseStart":887,"secureConnectionStart":234.30000019073486},{"duration":660.3000001907349,"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":234.5,"connectEnd":234.5,"connectStart":234.5,"domainLookupEnd":234.5,"domainLookupStart":234.5,"fetchStart":234.5,"redirectEnd":0,"redirectStart":0,"requestStart":234.5,"responseEnd":894.8000001907349,"responseStart":894.8000001907349,"secureConnectionStart":234.5},{"duration":661.1000003814697,"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":234.5999994277954,"connectEnd":234.5999994277954,"connectStart":234.5999994277954,"domainLookupEnd":234.5999994277954,"domainLookupStart":234.5999994277954,"fetchStart":234.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":234.5999994277954,"responseEnd":895.6999998092651,"responseStart":895.6999998092651,"secureConnectionStart":234.5999994277954},{"duration":661.7999992370605,"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":234.80000019073486,"connectEnd":234.80000019073486,"connectStart":234.80000019073486,"domainLookupEnd":234.80000019073486,"domainLookupStart":234.80000019073486,"fetchStart":234.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":234.80000019073486,"responseEnd":896.5999994277954,"responseStart":896.5999994277954,"secureConnectionStart":234.80000019073486},{"duration":870.1999998092651,"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":235,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":235,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1105.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":662.2000007629395,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":235.0999994277954,"connectEnd":235.0999994277954,"connectStart":235.0999994277954,"domainLookupEnd":235.0999994277954,"domainLookupStart":235.0999994277954,"fetchStart":235.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":235.0999994277954,"responseEnd":897.3000001907349,"responseStart":897.3000001907349,"secureConnectionStart":235.0999994277954},{"duration":870.0999994277954,"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":235.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":235.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1105.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":663.1000003814697,"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":235.39999961853027,"connectEnd":235.39999961853027,"connectStart":235.39999961853027,"domainLookupEnd":235.39999961853027,"domainLookupStart":235.39999961853027,"fetchStart":235.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":235.39999961853027,"responseEnd":898.5,"responseStart":898.5,"secureConnectionStart":235.39999961853027},{"duration":1424.2000007629395,"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":236.0999994277954,"connectEnd":236.0999994277954,"connectStart":236.0999994277954,"domainLookupEnd":236.0999994277954,"domainLookupStart":236.0999994277954,"fetchStart":236.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":236.0999994277954,"responseEnd":1660.3000001907349,"responseStart":1660.3000001907349,"secureConnectionStart":236.0999994277954},{"duration":1869.6999998092651,"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":240.5,"connectEnd":240.5,"connectStart":240.5,"domainLookupEnd":240.5,"domainLookupStart":240.5,"fetchStart":240.5,"redirectEnd":0,"redirectStart":0,"requestStart":240.5,"responseEnd":2110.199999809265,"responseStart":2110.199999809265,"secureConnectionStart":240.5},{"duration":534,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1127.3000001907349,"connectEnd":1127.3000001907349,"connectStart":1127.3000001907349,"domainLookupEnd":1127.3000001907349,"domainLookupStart":1127.3000001907349,"fetchStart":1127.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1127.3000001907349,"responseEnd":1661.3000001907349,"responseStart":1661.3000001907349,"secureConnectionStart":1127.3000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":55,"responseStart":222,"responseEnd":232,"domLoading":231,"domInteractive":2136,"domContentLoadedEventStart":2136,"domContentLoadedEventEnd":2224,"domComplete":2679,"loadEventStart":2679,"loadEventEnd":2679,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2112.300000190735},{"name":"bigPipe.sidebar-id.end","time":2113.199999809265},{"name":"bigPipe.activity-panel-pipe-id.start","time":2113.300000190735},{"name":"bigPipe.activity-panel-pipe-id.end","time":2114.5},{"name":"activityTabFullyLoaded","time":2237.699999809265}],"measures":[],"correlationId":"3a51e14f113c7a","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":98,"dbReadsTimeInMs":11,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
This has nothing to do with delay_key_write.
The true reason is partitioned MyISAM table with AUTO_INCREMENT — such a table could not be altered online.
I'll try to fix it.