Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
10.4.14 , 10.1(EOL) , 10.2(EOL) , 10.3(EOL) , 10.4(EOL) , 10.5
Hi Team,
Select query hanged the server with high memory usage and leads to OOM in MariaDB 10.4.14.
[root@localhost ~]# mysql -uroot -p --socket=/tmp/mysql_sandbox10414.sock
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.4.14-MariaDB MariaDB Server
...
MariaDB [test]> CREATE TABLE `u_flexera_cloud_usage_client` (
...
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
Query OK, 0 rows affected (0.037 sec)
MariaDB [test]> CREATE TABLE `u_flexera_cloud_usage` (
...
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.039 sec)
MariaDB [test]> quit
Bye
[root@localhost ~]#
Query is something like
explain
SELECT u_flexera_cloud_usage_client0.`sys_id`
FROM (u_flexera_cloud_usage_client u_flexera_cloud_usage_client0
LEFT JOIN u_flexera_cloud_usage u_flexera_cloud_usage1 ON u_flexera_cloud_usage_client0.`u_usage` = u_flexera_cloud_usage1.`sys_id` )
WHERE u_flexera_cloud_usage1.`u_feature_name` = 'ToscaCommander' AND u_flexera_cloud_usage1.`u_server` = 'b319fdf2376a7a0ca30fa16043990e72' AND u_flexera_cloud_usage_client0.`u_host_id` IN ('6a426ad6cef5e0830cb64bfcbff4e0b3ोरोबकहसोी') AND u_flexera_cloud_usage1.`u_collected` > '2020-08-21 08:00:25' AND u_flexera_cloud_usage_client0.`sys_id` != '2c6ac48f1b7298d0f518ea0e6e4bcbb3' AND u_flexera_cloud_usage_client0.`sys_id` != '2c6ac48f1b7298d0f518ea0e6e4bcbba' ....
There is a long list of sys_id != and condition.
[root@localhost ~]#
[root@localhost ~]# mysql -uroot -p --socket=/tmp/mysql_sandbox10414.sock test < lq1.sql
Enter password:
ERROR 2013 (HY000) at line 1: Lost connection to MySQL server during query
[root@localhost ~]#
...
..
[root@localhost data]# cat /var/log/messages | grep mysqld
....
Aug 7 05:38:45 localhost kernel: mysqld invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0
Aug 7 05:38:45 localhost kernel: mysqld cpuset=/ mems_allowed=0
Aug 7 05:38:45 localhost kernel: CPU: 0 PID: 18039 Comm: mysqld Kdump: loaded Not tainted 3.10.0-1127.el7.x86_64 #1
Aug 7 05:38:45 localhost kernel: [17906] 0 17906 28355 1 13 87 0 mysqld_safe
Aug 7 05:38:45 localhost kernel: [18004] 0 18004 1133133 431832 1713 400514 0 mysqld
Aug 7 05:38:45 localhost kernel: Out of memory: Kill process 18004 (mysqld) score 890 or sacrifice child
Aug 7 05:38:45 localhost kernel: Killed process 18004 (mysqld), UID 0, total-vm:4532532kB, anon-rss:1727328kB, file-rss:0kB, shmem-rss:0kB
[root@localhost ~]# top | grep mysqld
18103 root 20 0 4399336 1.6g 0 S 46.0 90.6 2:35.61 mysqld
18103 root 20 0 4464872 1.6g 0 S 88.8 89.9 2:38.38 mysqld
18103 root 20 0 4530408 1.6g 0 S 85.7 91.3 2:41.01 mysqld
18103 root 20 0 4530408 1.6g 0 S 19.8 91.9 2:42.33 mysqld
18167 root 20 0 1253308 83844 11188 S 2.6 4.5 0:00.08 mysqld -- OOM happened and server restarted.
17906 root 20 0 113424 892 612 S 0.3 0.0 0:00.02 mysqld_safe
18167 root 20 0 1253308 83844 11188 S 0.3 4.5 0:00.09 mysqld
Required table structures and query is attached with this bug.
causes
MDEV-30605
Wrong result while using index for group-by
Closed
duplicates
MDEV-26059
Query in the range optimizer doesn't react to KILL
Closed
relates to
MDEV-9764
MariaDB does not limit memory used for range optimization
Closed
MDEV-21958
Query having many NOT-IN clauses running forever and causing available free memory to use completely
Closed
mentioned in
Page Failed to load
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Show 10 more links (10 mentioned in)
{"report":{"fcp":964.5,"ttfb":198.90000009536743,"pageVisibility":"visible","entityId":91317,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"73575cba-724b-4026-bdc0-7558c90a6eee","navigationType":0,"readyForUser":1135.5999999046326,"redirectCount":0,"resourceLoadedEnd":1191.0999999046326,"resourceLoadedStart":204.70000004768372,"resourceTiming":[{"duration":232.89999985694885,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":204.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":204.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":437.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":233,"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":205,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":205,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":438,"responseStart":0,"secureConnectionStart":0},{"duration":241.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":205.09999990463257,"connectEnd":205.09999990463257,"connectStart":205.09999990463257,"domainLookupEnd":205.09999990463257,"domainLookupStart":205.09999990463257,"fetchStart":205.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":205.09999990463257,"responseEnd":446.90000009536743,"responseStart":446.90000009536743,"secureConnectionStart":205.09999990463257},{"duration":296.5,"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":205.40000009536743,"connectEnd":205.40000009536743,"connectStart":205.40000009536743,"domainLookupEnd":205.40000009536743,"domainLookupStart":205.40000009536743,"fetchStart":205.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":205.40000009536743,"responseEnd":501.90000009536743,"responseStart":501.90000009536743,"secureConnectionStart":205.40000009536743},{"duration":300.7999999523163,"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":205.5,"connectEnd":205.5,"connectStart":205.5,"domainLookupEnd":205.5,"domainLookupStart":205.5,"fetchStart":205.5,"redirectEnd":0,"redirectStart":0,"requestStart":205.5,"responseEnd":506.2999999523163,"responseStart":506.2999999523163,"secureConnectionStart":205.5},{"duration":301.10000014305115,"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":205.79999995231628,"connectEnd":205.79999995231628,"connectStart":205.79999995231628,"domainLookupEnd":205.79999995231628,"domainLookupStart":205.79999995231628,"fetchStart":205.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":205.79999995231628,"responseEnd":506.90000009536743,"responseStart":506.90000009536743,"secureConnectionStart":205.79999995231628},{"duration":301.2999999523163,"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":206,"connectEnd":206,"connectStart":206,"domainLookupEnd":206,"domainLookupStart":206,"fetchStart":206,"redirectEnd":0,"redirectStart":0,"requestStart":206,"responseEnd":507.2999999523163,"responseStart":507.2999999523163,"secureConnectionStart":206},{"duration":399.2000000476837,"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":206.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":206.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":605.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":301.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":206.40000009536743,"connectEnd":206.40000009536743,"connectStart":206.40000009536743,"domainLookupEnd":206.40000009536743,"domainLookupStart":206.40000009536743,"fetchStart":206.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":206.40000009536743,"responseEnd":507.90000009536743,"responseStart":507.90000009536743,"secureConnectionStart":206.40000009536743},{"duration":399,"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":206.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":206.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":605.5,"responseStart":0,"secureConnectionStart":0},{"duration":301.7999999523163,"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":206.70000004768372,"connectEnd":206.70000004768372,"connectStart":206.70000004768372,"domainLookupEnd":206.70000004768372,"domainLookupStart":206.70000004768372,"fetchStart":206.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":206.70000004768372,"responseEnd":508.5,"responseStart":508.5,"secureConnectionStart":206.70000004768372},{"duration":522.2999999523163,"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":212.70000004768372,"connectEnd":212.70000004768372,"connectStart":212.70000004768372,"domainLookupEnd":212.70000004768372,"domainLookupStart":212.70000004768372,"fetchStart":212.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":212.70000004768372,"responseEnd":735,"responseStart":735,"secureConnectionStart":212.70000004768372},{"duration":852.4000000953674,"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":212.79999995231628,"connectEnd":212.79999995231628,"connectStart":212.79999995231628,"domainLookupEnd":212.79999995231628,"domainLookupStart":212.79999995231628,"fetchStart":212.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":212.79999995231628,"responseEnd":1065.2000000476837,"responseStart":1065.2000000476837,"secureConnectionStart":212.79999995231628},{"duration":119.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":618.5,"connectEnd":618.5,"connectStart":618.5,"domainLookupEnd":618.5,"domainLookupStart":618.5,"fetchStart":618.5,"redirectEnd":0,"redirectStart":0,"requestStart":618.5,"responseEnd":738.0999999046326,"responseStart":738.0999999046326,"secureConnectionStart":618.5},{"duration":293.5,"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":895.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":895.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1189.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":286.80000019073486,"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":897.0999999046326,"connectEnd":897.0999999046326,"connectStart":897.0999999046326,"domainLookupEnd":897.0999999046326,"domainLookupStart":897.0999999046326,"fetchStart":897.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":897.0999999046326,"responseEnd":1183.9000000953674,"responseStart":1183.9000000953674,"secureConnectionStart":897.0999999046326},{"duration":293.59999990463257,"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":897.5,"connectEnd":897.5,"connectStart":897.5,"domainLookupEnd":897.5,"domainLookupStart":897.5,"fetchStart":897.5,"redirectEnd":0,"redirectStart":0,"requestStart":897.5,"responseEnd":1191.0999999046326,"responseStart":1191.0999999046326,"secureConnectionStart":897.5},{"duration":256.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":957.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":957.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1214.4000000953674,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":28,"responseStart":199,"responseEnd":204,"domLoading":202,"domInteractive":1232,"domContentLoadedEventStart":1232,"domContentLoadedEventEnd":1281,"domComplete":2057,"loadEventStart":2057,"loadEventEnd":2059,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1219},{"name":"bigPipe.sidebar-id.end","time":1219.7999999523163},{"name":"bigPipe.activity-panel-pipe-id.start","time":1220},{"name":"bigPipe.activity-panel-pipe-id.end","time":1222.5},{"name":"activityTabFullyLoaded","time":1312.5}],"measures":[],"correlationId":"c81e1bf6ab6623","effectiveType":"4g","downlink":9.4,"rtt":0,"serverDuration":100,"dbReadsTimeInMs":14,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}