Sprint:
10.1.17-1, 10.1.18, 10.1.30
table_open_cache is supposed to be adjusted (decreased) automatically if system limit on open files does not allow the desired value. It works all right until we also provide open-files-limit option. The option itself does not really do much (as explained here, for example: https://bugs.mysql.com/bug.php?id=34870 ), but it somehow affects the adjustment; so, table_open_cache can end up with a higher value than the system allows, which leads to obvious problems.
MySQL 5.6 and 5.7 are not affected.
10.1 and 10.2 are affected the most, because default value for table_open_cache there is 2000 , and it remains such in the described scenario.
10.0 is also affected, but since the default value there is 400 , it is less of a problem.
Example:
Server started with all defaults, no extra options - OK
+-----------------------+-------------------+--------------------+
| @@version | @@max_connections | @@table_open_cache |
+-----------------------+-------------------+--------------------+
| 10.1.15-MariaDB-debug | 151 | 431 |
+-----------------------+-------------------+--------------------+
Server started with all defaults and --open-files-limit=1024 - Problem
+-----------------------+-------------------+--------------------+
| @@version | @@max_connections | @@table_open_cache |
+-----------------------+-------------------+--------------------+
| 10.1.15-MariaDB-debug | 151 | 2000 |
+-----------------------+-------------------+--------------------+
MySQL servers started with all defaults and --open-files-limit=1024 - OK
+--------------+-------------------+--------------------+
| @@version | @@max_connections | @@table_open_cache |
+--------------+-------------------+--------------------+
| 5.6.31-debug | 151 | 431 |
+--------------+-------------------+--------------------+
+--------------+-------------------+--------------------+
| @@version | @@max_connections | @@table_open_cache |
+--------------+-------------------+--------------------+
| 5.7.13-debug | 151 | 431 |
+--------------+-------------------+--------------------+
Consequences of the problem are very easily reproducible on 10.1 with MTR, because MTR quite conveniently a) sets system limit to 1024 for any platform, and b) has open-files-limit=1024 in the default config template.
MTR test case
--let $cnt= 2000
while ($cnt)
{
eval CREATE TABLE t_$cnt (i INT ) ENGINE=MyISAM;
eval INSERT INTO t_$cnt VALUES (1);
--dec $cnt
}
....
INSERT INTO t_1518 VALUES (1);
CREATE TABLE t_1517 (i INT) ENGINE=MyISAM;
INSERT INTO t_1517 VALUES (1);
CREATE TABLE t_1516 (i INT) ENGINE=MyISAM;
bug.t1 [ fail ]
Test ended at 2016-06-25 21:15:21
CURRENT_TEST: bug.t1
mysqltest: At line 8: query 'CREATE TABLE t_$cnt (i INT) ENGINE=MyISAM' failed: 1005: Can't create table `test`.`t_1516` (errno: 24 "Too many open files")
duplicates
MDEV-15609
engines/funcs.crash_manytables_number crashes with error 24 (too many open files)
Closed
{"report":{"fcp":864.2999997138977,"ttfb":181,"pageVisibility":"visible","entityId":57230,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"652f68ce-cd48-4307-9313-5ba68cf1b6ae","navigationType":0,"readyForUser":962.5999999046326,"redirectCount":0,"resourceLoadedEnd":778.9000000953674,"resourceLoadedStart":185.59999990463257,"resourceTiming":[{"duration":142.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":185.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":185.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":328.5,"responseStart":0,"secureConnectionStart":0},{"duration":143,"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":185.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":185.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":328.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":151.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":186.09999990463257,"connectEnd":186.09999990463257,"connectStart":186.09999990463257,"domainLookupEnd":186.09999990463257,"domainLookupStart":186.09999990463257,"fetchStart":186.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":186.09999990463257,"responseEnd":337.90000009536743,"responseStart":337.90000009536743,"secureConnectionStart":186.09999990463257},{"duration":237.90000009536743,"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":186.2999997138977,"connectEnd":186.2999997138977,"connectStart":186.2999997138977,"domainLookupEnd":186.2999997138977,"domainLookupStart":186.2999997138977,"fetchStart":186.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":186.2999997138977,"responseEnd":424.19999980926514,"responseStart":424.19999980926514,"secureConnectionStart":186.2999997138977},{"duration":241.59999990463257,"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":186.5,"connectEnd":186.5,"connectStart":186.5,"domainLookupEnd":186.5,"domainLookupStart":186.5,"fetchStart":186.5,"redirectEnd":0,"redirectStart":0,"requestStart":186.5,"responseEnd":428.09999990463257,"responseStart":428.09999990463257,"secureConnectionStart":186.5},{"duration":242,"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":186.59999990463257,"connectEnd":186.59999990463257,"connectStart":186.59999990463257,"domainLookupEnd":186.59999990463257,"domainLookupStart":186.59999990463257,"fetchStart":186.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":186.59999990463257,"responseEnd":428.59999990463257,"responseStart":428.59999990463257,"secureConnectionStart":186.59999990463257},{"duration":237.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":191.09999990463257,"connectEnd":191.09999990463257,"connectStart":191.09999990463257,"domainLookupEnd":191.09999990463257,"domainLookupStart":191.09999990463257,"fetchStart":191.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":191.09999990463257,"responseEnd":429,"responseStart":429,"secureConnectionStart":191.09999990463257},{"duration":294.09999990463257,"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":191.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":191.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":485.5,"responseStart":0,"secureConnectionStart":0},{"duration":237.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":191.5,"connectEnd":191.5,"connectStart":191.5,"domainLookupEnd":191.5,"domainLookupStart":191.5,"fetchStart":191.5,"redirectEnd":0,"redirectStart":0,"requestStart":191.5,"responseEnd":429.40000009536743,"responseStart":429.40000009536743,"secureConnectionStart":191.5},{"duration":293.80000019073486,"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":191.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":191.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":485.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":238.09999990463257,"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":192,"connectEnd":192,"connectStart":192,"domainLookupEnd":192,"domainLookupStart":192,"fetchStart":192,"redirectEnd":0,"redirectStart":0,"requestStart":192,"responseEnd":430.09999990463257,"responseStart":430.09999990463257,"secureConnectionStart":192},{"duration":349.90000009536743,"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":194.69999980926514,"connectEnd":194.69999980926514,"connectStart":194.69999980926514,"domainLookupEnd":194.69999980926514,"domainLookupStart":194.69999980926514,"fetchStart":194.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":194.69999980926514,"responseEnd":544.5999999046326,"responseStart":544.5999999046326,"secureConnectionStart":194.69999980926514},{"duration":384.40000009536743,"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":197.7999997138977,"connectEnd":197.7999997138977,"connectStart":197.7999997138977,"domainLookupEnd":197.7999997138977,"domainLookupStart":197.7999997138977,"fetchStart":197.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":197.7999997138977,"responseEnd":582.1999998092651,"responseStart":582.1999998092651,"secureConnectionStart":197.7999997138977},{"duration":49,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":497.5,"connectEnd":497.5,"connectStart":497.5,"domainLookupEnd":497.5,"domainLookupStart":497.5,"fetchStart":497.5,"redirectEnd":0,"redirectStart":0,"requestStart":497.5,"responseEnd":546.5,"responseStart":546.5,"secureConnectionStart":497.5},{"duration":219.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/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&whisper-enabled=true","startTime":559.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":559.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":778.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":515,"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":560.5999999046326,"connectEnd":560.5999999046326,"connectStart":560.5999999046326,"domainLookupEnd":560.5999999046326,"domainLookupStart":560.5999999046326,"fetchStart":560.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":560.5999999046326,"responseEnd":1075.5999999046326,"responseStart":1075.5999999046326,"secureConnectionStart":560.5999999046326},{"duration":521.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/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.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":561,"connectEnd":561,"connectStart":561,"domainLookupEnd":561,"domainLookupStart":561,"fetchStart":561,"redirectEnd":0,"redirectStart":0,"requestStart":561,"responseEnd":1082.6999998092651,"responseStart":1082.6999998092651,"secureConnectionStart":561}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":26,"responseStart":181,"responseEnd":198,"domLoading":185,"domInteractive":1049,"domContentLoadedEventStart":1049,"domContentLoadedEventEnd":1117,"domComplete":2312,"loadEventStart":2312,"loadEventEnd":2314,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1025.5999999046326},{"name":"bigPipe.sidebar-id.end","time":1026.2999997138977},{"name":"bigPipe.activity-panel-pipe-id.start","time":1026.4000000953674},{"name":"bigPipe.activity-panel-pipe-id.end","time":1030.5},{"name":"activityTabFullyLoaded","time":1126.1999998092651}],"measures":[],"correlationId":"5519fe37491c30","effectiveType":"4g","downlink":9.1,"rtt":0,"serverDuration":88,"dbReadsTimeInMs":10,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}