Type:
Bug
Priority:
Major
Resolution:
Unresolved
Affects Version/s:
10.2(EOL) , 10.3(EOL) , 10.4(EOL) , 10.5 , 10.6 , 10.7(EOL) , 10.8(EOL)
The fix for MDEV-24909 is in the main branches now, however same problem still affects various JSON-related queries/functions.
For example,
--source include/have_sequence.inc
--connect (con1,localhost,root,,)
set max_statement_time= 5;
select concat( '{' ,group_concat(concat( '"seq' ,seq, '":' ,seq)), '}' ) into @json from seq_1_to_50000;
--let $conid= `select connection_id()`
send
SELECT JSON_CONTAINS(@json, @json);
--connection default
sleep 2;
show processlist;
sleep 5;
show processlist;
sleep 5;
show processlist;
--connection con1
--reap
Shows this
10.6 fae0ccad non-debug
show processlist;
Id User Host db Command Time State Info Progress
4 root localhost test Query 0 starting show processlist 0.000
5 root localhost test Query 2 Executing SELECT JSON_CONTAINS(@json, @json) 0.000
show processlist;
Id User Host db Command Time State Info Progress
4 root localhost test Query 0 starting show processlist 0.000
5 root localhost test Killed 7 Executing SELECT JSON_CONTAINS(@json, @json) 0.000
show processlist;
Id User Host db Command Time State Info Progress
4 root localhost test Query 0 starting show processlist 0.000
5 root localhost test Killed 12 Executing SELECT JSON_CONTAINS(@json, @json) 0.000
Same with explicit KILL instead of max_statement_time .
It doesn't hang, the server keeps processing the query at 100% CPU and eventually responds, but it takes the same time as it does if the query is executed without interruption (on my machine, it's ~1.5 min on a non-debug 10.6 build and ~3.5 min on debug).
It's scalable, depending on the size of the JSON documents involved. Increase the number of rows selected from the sequence table if it's too fast on your machine. Watch for group_concat_max_len, you may need to set it to a non-default value if the number of rows is increased.
Set fix version to 10.6 because MDEV-24909 was fixed in 10.6.
relates to
MDEV-24909
JSON functions don't respect KILL QUERY / max_statement_time limit
Closed
{"report":{"fcp":2032.1999998092651,"ttfb":694.0999994277954,"pageVisibility":"visible","entityId":110274,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"de4daec1-fff4-4e6d-af66-4de99627d1fb","navigationType":0,"readyForUser":2127.2999992370605,"redirectCount":0,"resourceLoadedEnd":2376.5999994277954,"resourceLoadedStart":706.5,"resourceTiming":[{"duration":779.5999994277954,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":706.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":706.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1486.0999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":779.5,"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":706.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":706.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1486.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":788.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":707.0999994277954,"connectEnd":707.0999994277954,"connectStart":707.0999994277954,"domainLookupEnd":707.0999994277954,"domainLookupStart":707.0999994277954,"fetchStart":707.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":707.0999994277954,"responseEnd":1495.7999992370605,"responseStart":1495.7999992370605,"secureConnectionStart":707.0999994277954},{"duration":891.4000005722046,"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":707.7999992370605,"connectEnd":707.7999992370605,"connectStart":707.7999992370605,"domainLookupEnd":707.7999992370605,"domainLookupStart":707.7999992370605,"fetchStart":707.7999992370605,"redirectEnd":0,"redirectStart":0,"requestStart":707.7999992370605,"responseEnd":1599.1999998092651,"responseStart":1599.1999998092651,"secureConnectionStart":707.7999992370605},{"duration":895.8000001907349,"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":708.0999994277954,"connectEnd":708.0999994277954,"connectStart":708.0999994277954,"domainLookupEnd":708.0999994277954,"domainLookupStart":708.0999994277954,"fetchStart":708.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":708.0999994277954,"responseEnd":1603.8999996185303,"responseStart":1603.8999996185303,"secureConnectionStart":708.0999994277954},{"duration":896.1999998092651,"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":708.1999998092651,"connectEnd":708.1999998092651,"connectStart":708.1999998092651,"domainLookupEnd":708.1999998092651,"domainLookupStart":708.1999998092651,"fetchStart":708.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":708.1999998092651,"responseEnd":1604.3999996185303,"responseStart":1604.3999996185303,"secureConnectionStart":708.1999998092651},{"duration":895.8000001907349,"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":709.0999994277954,"connectEnd":709.0999994277954,"connectStart":709.0999994277954,"domainLookupEnd":709.0999994277954,"domainLookupStart":709.0999994277954,"fetchStart":709.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":709.0999994277954,"responseEnd":1604.8999996185303,"responseStart":1604.8999996185303,"secureConnectionStart":709.0999994277954},{"duration":943,"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":709.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":709.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1652.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":895.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":709.5,"connectEnd":709.5,"connectStart":709.5,"domainLookupEnd":709.5,"domainLookupStart":709.5,"fetchStart":709.5,"redirectEnd":0,"redirectStart":0,"requestStart":709.5,"responseEnd":1605.3999996185303,"responseStart":1605.3999996185303,"secureConnectionStart":709.5},{"duration":943,"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":709.5999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":709.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1652.5999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":896.2000007629395,"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":709.7999992370605,"connectEnd":709.7999992370605,"connectStart":709.7999992370605,"domainLookupEnd":709.7999992370605,"domainLookupStart":709.7999992370605,"fetchStart":709.7999992370605,"redirectEnd":0,"redirectStart":0,"requestStart":709.7999992370605,"responseEnd":1606,"responseStart":1606,"secureConnectionStart":709.7999992370605},{"duration":1616,"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":712.8999996185303,"connectEnd":712.8999996185303,"connectStart":712.8999996185303,"domainLookupEnd":712.8999996185303,"domainLookupStart":712.8999996185303,"fetchStart":712.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":712.8999996185303,"responseEnd":2328.8999996185303,"responseStart":2328.7999992370605,"secureConnectionStart":712.8999996185303},{"duration":1663.5999994277954,"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":713,"connectEnd":713,"connectStart":713,"domainLookupEnd":713,"domainLookupStart":713,"fetchStart":713,"redirectEnd":0,"redirectStart":0,"requestStart":713,"responseEnd":2376.5999994277954,"responseStart":2376.5999994277954,"secureConnectionStart":713},{"duration":683.3000001907349,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1667.7999992370605,"connectEnd":1667.7999992370605,"connectStart":1667.7999992370605,"domainLookupEnd":1667.7999992370605,"domainLookupStart":1667.7999992370605,"fetchStart":1667.7999992370605,"redirectEnd":0,"redirectStart":0,"requestStart":1667.7999992370605,"responseEnd":2351.0999994277954,"responseStart":2351.0999994277954,"secureConnectionStart":1667.7999992370605},{"duration":387.9000005722046,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":2024.5999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":2024.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2412.5,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":521,"responseStart":694,"responseEnd":714,"domLoading":699,"domInteractive":2431,"domContentLoadedEventStart":2431,"domContentLoadedEventEnd":2474,"domComplete":3753,"loadEventStart":3753,"loadEventEnd":3755,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2379},{"name":"bigPipe.sidebar-id.end","time":2379.7999992370605},{"name":"bigPipe.activity-panel-pipe-id.start","time":2380},{"name":"bigPipe.activity-panel-pipe-id.end","time":2382.5999994277954},{"name":"activityTabFullyLoaded","time":2483.0999994277954}],"measures":[],"correlationId":"18bc174b523f12","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":104,"dbReadsTimeInMs":16,"dbConnsTimeInMs":27,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}