We have a nightly process that optimizes specific high update rate tables. At the same time, and synchronous to that optimization process, select queries come in very frequently.
There are cases, where a query that should run about 2-5 seconds will get stuck indefinitely. These queries come in just before, and possibly nano or milliseconds before an optimization statement, which imposes a METADATA LOCK on all the pending selects against the table, including possibly this one, or maybe not. We are not sure.
However, once the METADATA LOCK clears, the query will be shown in running mode, but in fact it is not running. There was a bug resolved in 10.5.16 associated with a missed flagging/unflagging of certain queries during some replication based events that sounded so similar, that I thought this issue would be resolved by that update. Unfortunately, this turned out to not be the case.
We are still seeing the selects that appear to be running, but in fact are not happening approximately once a week. I suspect that it's a temporal issue related to the flagging/unflagging of METADATA LOCKS that is causing the issue. That MariaDB unlocks the select from the users perspective, but it remains in fact locked from an internals perspective.
{"report":{"fcp":825.5,"ttfb":140.60000014305115,"pageVisibility":"visible","entityId":113798,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"57b00c94-695b-4ddb-9690-62d050aa3c4d","navigationType":0,"readyForUser":894,"redirectCount":0,"resourceLoadedEnd":1022.7000000476837,"resourceLoadedStart":181.10000014305115,"resourceTiming":[{"duration":145.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":181.10000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":181.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":326.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":144.70000004768372,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":181.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":181.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":326.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":153.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":181.60000014305115,"connectEnd":181.60000014305115,"connectStart":181.60000014305115,"domainLookupEnd":181.60000014305115,"domainLookupStart":181.60000014305115,"fetchStart":181.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":181.60000014305115,"responseEnd":335.2000000476837,"responseStart":335.2000000476837,"secureConnectionStart":181.60000014305115},{"duration":289.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":182,"connectEnd":182,"connectStart":182,"domainLookupEnd":182,"domainLookupStart":182,"fetchStart":182,"redirectEnd":0,"redirectStart":0,"requestStart":182,"responseEnd":471.5,"responseStart":471.5,"secureConnectionStart":182},{"duration":285.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":182,"connectEnd":182,"connectStart":182,"domainLookupEnd":182,"domainLookupStart":182,"fetchStart":182,"redirectEnd":0,"redirectStart":0,"requestStart":182,"responseEnd":467.90000009536743,"responseStart":467.90000009536743,"secureConnectionStart":182},{"duration":290.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":182.20000004768372,"connectEnd":182.20000004768372,"connectStart":182.20000004768372,"domainLookupEnd":182.20000004768372,"domainLookupStart":182.20000004768372,"fetchStart":182.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":182.20000004768372,"responseEnd":472.40000009536743,"responseStart":472.40000009536743,"secureConnectionStart":182.20000004768372},{"duration":290.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":182.30000019073486,"connectEnd":182.30000019073486,"connectStart":182.30000019073486,"domainLookupEnd":182.30000019073486,"domainLookupStart":182.30000019073486,"fetchStart":182.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":182.30000019073486,"responseEnd":473.10000014305115,"responseStart":473.10000014305115,"secureConnectionStart":182.30000019073486},{"duration":291.10000014305115,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":182.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":182.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":473.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":291.2999999523163,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":182.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":182.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":474.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":290.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":182.90000009536743,"connectEnd":182.90000009536743,"connectStart":182.90000009536743,"domainLookupEnd":182.90000009536743,"domainLookupStart":182.90000009536743,"fetchStart":182.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":182.90000009536743,"responseEnd":473.80000019073486,"responseStart":473.80000019073486,"secureConnectionStart":182.90000009536743},{"duration":291.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":183,"connectEnd":183,"connectStart":183,"domainLookupEnd":183,"domainLookupStart":183,"fetchStart":183,"redirectEnd":0,"redirectStart":0,"requestStart":183,"responseEnd":474.40000009536743,"responseStart":474.40000009536743,"secureConnectionStart":183},{"duration":313.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":252,"connectEnd":252,"connectStart":252,"domainLookupEnd":252,"domainLookupStart":252,"fetchStart":252,"redirectEnd":0,"redirectStart":0,"requestStart":252,"responseEnd":565.9000000953674,"responseStart":565.9000000953674,"secureConnectionStart":252},{"duration":766.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":256.2000000476837,"connectEnd":256.2000000476837,"connectStart":256.2000000476837,"domainLookupEnd":256.2000000476837,"domainLookupStart":256.2000000476837,"fetchStart":256.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":256.2000000476837,"responseEnd":1022.7000000476837,"responseStart":1022.7000000476837,"secureConnectionStart":256.2000000476837},{"duration":82.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":484.2000000476837,"connectEnd":484.2000000476837,"connectStart":484.2000000476837,"domainLookupEnd":484.2000000476837,"domainLookupStart":484.2000000476837,"fetchStart":484.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":484.2000000476837,"responseEnd":566.7000000476837,"responseStart":566.7000000476837,"secureConnectionStart":484.2000000476837},{"duration":333.7000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/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","startTime":746,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":746,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1079.7000000476837,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":10,"responseStart":140,"responseEnd":256,"domLoading":144,"domInteractive":1041,"domContentLoadedEventStart":1041,"domContentLoadedEventEnd":1077,"domComplete":1832,"loadEventStart":1832,"loadEventEnd":1833,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1024.6000001430511},{"name":"bigPipe.sidebar-id.end","time":1025.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1025.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":1028},{"name":"activityTabFullyLoaded","time":1080.4000000953674}],"measures":[],"correlationId":"ff4967063079c7","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":67,"dbReadsTimeInMs":8,"dbConnsTimeInMs":14,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}