Type:
New Feature
Priority:
Critical
Resolution:
Fixed
Add a variable (max-tmp-table-disk-space) to limit the total temporary disk space used by internal temporary tables created during query execution.
When the internal in-memory temporary table is oversize and converting to MyISAM/Aria table to store on disk, this option will limit the max space of tmp_dir. If a new disk temporary table will cause tmp_dir over the limitation, then this query will return an error.
As part of this task we should also add a status variable for temporary disk space usage and also add this to information_schema.processlist.
What should be monitored:
Temporary files created by filesort and replication buffers and
sorting in engines as part of alter table, repair table, optimize table.
The first 2 are relative easy to do, the later a bit harder.
On disk internal temporary tables (MyISAM or Aria). These are relatively
easy to handle.
Explicit defined temporary tables (CREATE TEMPORARY TABLE) will
not be part of this work as this should be regarded to be a normal table.
(Any user can create and drop tables any time).
However any on disk temporary table disk space should also be possible to monitor, possible with another status variable.
First implementation:
-Two new variables:
max_tmp_space_usage : Limits the the temporary space allowance per user
max_total_space_file_usage: Limits the temporary space allowance for all users.
The temporary space is counted for:
All sql level temporary files. This includes sorts for filesort, transaction temporary space, analyze etc. It does not include engine internal files used for repair, alter table, index presorting etc.
All internal on disk temporary tables created as part of resolving a SELECT, multi-source update etc.
{"report":{"fcp":1335,"ttfb":516.5,"pageVisibility":"visible","entityId":54089,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":0.5,"journeyId":"675796bb-4fe8-4891-a0cf-89e2829e37cf","navigationType":0,"readyForUser":1426.2000000476837,"redirectCount":0,"resourceLoadedEnd":1474.5999999046326,"resourceLoadedStart":521.7999999523163,"resourceTiming":[{"duration":96.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":521.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":521.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":618.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":103.09999990463257,"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":522,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":522,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":625.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":149.39999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":522.2000000476837,"connectEnd":522.2000000476837,"connectStart":522.2000000476837,"domainLookupEnd":522.2000000476837,"domainLookupStart":522.2000000476837,"fetchStart":522.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":522.2000000476837,"responseEnd":671.5999999046326,"responseStart":671.5999999046326,"secureConnectionStart":522.2000000476837},{"duration":472.2000000476837,"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":522.3999998569489,"connectEnd":522.3999998569489,"connectStart":522.3999998569489,"domainLookupEnd":522.3999998569489,"domainLookupStart":522.3999998569489,"fetchStart":522.3999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":522.3999998569489,"responseEnd":994.5999999046326,"responseStart":994.5999999046326,"secureConnectionStart":522.3999998569489},{"duration":476,"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":522.5999999046326,"connectEnd":522.5999999046326,"connectStart":522.5999999046326,"domainLookupEnd":522.5999999046326,"domainLookupStart":522.5999999046326,"fetchStart":522.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":522.5999999046326,"responseEnd":998.5999999046326,"responseStart":998.5999999046326,"secureConnectionStart":522.5999999046326},{"duration":476.59999990463257,"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":522.7999999523163,"connectEnd":522.7999999523163,"connectStart":522.7999999523163,"domainLookupEnd":522.7999999523163,"domainLookupStart":522.7999999523163,"fetchStart":522.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":522.7999999523163,"responseEnd":999.3999998569489,"responseStart":999.3999998569489,"secureConnectionStart":522.7999999523163},{"duration":476.7999999523163,"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":523,"connectEnd":523,"connectStart":523,"domainLookupEnd":523,"domainLookupStart":523,"fetchStart":523,"redirectEnd":0,"redirectStart":0,"requestStart":523,"responseEnd":999.7999999523163,"responseStart":999.7999999523163,"secureConnectionStart":523},{"duration":477.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":523.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":523.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1000.3999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":476.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":523.3999998569489,"connectEnd":523.3999998569489,"connectStart":523.3999998569489,"domainLookupEnd":523.3999998569489,"domainLookupStart":523.3999998569489,"fetchStart":523.3999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":523.3999998569489,"responseEnd":1000.2000000476837,"responseStart":1000.2000000476837,"secureConnectionStart":523.3999998569489},{"duration":477.2999999523163,"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":523.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":523.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1000.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":477.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":523.7000000476837,"connectEnd":523.7000000476837,"connectStart":523.7000000476837,"domainLookupEnd":523.7000000476837,"domainLookupStart":523.7000000476837,"fetchStart":523.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":523.7000000476837,"responseEnd":1000.7999999523163,"responseStart":1000.7999999523163,"secureConnectionStart":523.7000000476837},{"duration":712.5,"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":529.8999998569489,"connectEnd":529.8999998569489,"connectStart":529.8999998569489,"domainLookupEnd":529.8999998569489,"domainLookupStart":529.8999998569489,"fetchStart":529.8999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":529.8999998569489,"responseEnd":1242.3999998569489,"responseStart":1242.3999998569489,"secureConnectionStart":529.8999998569489},{"duration":850.7000000476837,"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":529.8999998569489,"connectEnd":529.8999998569489,"connectStart":529.8999998569489,"domainLookupEnd":529.8999998569489,"domainLookupStart":529.8999998569489,"fetchStart":529.8999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":529.8999998569489,"responseEnd":1380.5999999046326,"responseStart":1380.5,"secureConnectionStart":529.8999998569489},{"duration":425.90000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":816.0999999046326,"connectEnd":816.0999999046326,"connectStart":816.0999999046326,"domainLookupEnd":816.0999999046326,"domainLookupStart":816.0999999046326,"fetchStart":816.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":816.0999999046326,"responseEnd":1242,"responseStart":1242,"secureConnectionStart":816.0999999046326},{"duration":202.29999995231628,"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":1272.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1272.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1474.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":156.09999990463257,"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":1273.2000000476837,"connectEnd":1273.2000000476837,"connectStart":1273.2000000476837,"domainLookupEnd":1273.2000000476837,"domainLookupStart":1273.2000000476837,"fetchStart":1273.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":1273.2000000476837,"responseEnd":1429.2999999523163,"responseStart":1429.2999999523163,"secureConnectionStart":1273.2000000476837},{"duration":169.60000014305115,"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":1273.5999999046326,"connectEnd":1273.5999999046326,"connectStart":1273.5999999046326,"domainLookupEnd":1273.5999999046326,"domainLookupStart":1273.5999999046326,"fetchStart":1273.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1273.5999999046326,"responseEnd":1443.2000000476837,"responseStart":1443.2000000476837,"secureConnectionStart":1273.5999999046326},{"duration":198.09999990463257,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1329.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1329.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1527.2999999523163,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":325,"responseStart":516,"responseEnd":521,"domLoading":519,"domInteractive":1545,"domContentLoadedEventStart":1545,"domContentLoadedEventEnd":1594,"domComplete":2706,"loadEventStart":2706,"loadEventEnd":2708,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1533.5999999046326},{"name":"bigPipe.sidebar-id.end","time":1534.3999998569489},{"name":"bigPipe.activity-panel-pipe-id.start","time":1534.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":1536.8999998569489},{"name":"activityTabFullyLoaded","time":1610}],"measures":[],"correlationId":"d43fc30caf8d32","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":128,"dbReadsTimeInMs":31,"dbConnsTimeInMs":42,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}