The code reads like this
bool paused;
|
do
|
{
|
latch.wr_lock(SRW_LOCK_CALL);
|
paused= m_FTS_paused || (also_sys && m_SYS_paused);
|
latch.wr_unlock();
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
}
|
while (paused);
|
it sleeps. without checking paused, even if paused is false.
It looks wrong, although perhaps it was intended for some purpose, e.g throttle purge activity.
Even if it was intended, then it still needs to be taken out of the function loop, and added to where the throttling needs to actually be, with appropritate comment.
Otherwise it adds 10 ms latency to all of its callers, and to the callers of its callers, which happens more than once during the purge
e.g in wait_FTS/clone_oldest_view/trx_purge and in wait_FTS/close_and_reopen/trx_attach_undo_recs/trx_purge code paths
Other thing : taking a write lock latch.wr_lock just to check the variable, and not change anything is this correct? Looks strange at least.
- relates to
-
MDEV-34515
Contention between secondary index UPDATE and purge due to large innodb_purge_batch_size
-
-
Closed
{"report":{"fcp":1245.3999999761581,"ttfb":484,"pageVisibility":"visible","entityId":129824,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"c9c1c109-f093-40fc-97a8-d5494965cdfc","navigationType":0,"readyForUser":1317.8999999761581,"redirectCount":0,"resourceLoadedEnd":2042.5999999940395,"resourceLoadedStart":512.8999999761581,"resourceTiming":[{"duration":228.2000000178814,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":512.8999999761581,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":512.8999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":741.0999999940395,"responseStart":0,"secureConnectionStart":0},{"duration":228.40000000596046,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":513.0999999940395,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":513.0999999940395,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":741.5,"responseStart":0,"secureConnectionStart":0},{"duration":281.80000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":513.2999999821186,"connectEnd":513.2999999821186,"connectStart":513.2999999821186,"domainLookupEnd":513.2999999821186,"domainLookupStart":513.2999999821186,"fetchStart":513.2999999821186,"redirectEnd":0,"redirectStart":0,"requestStart":513.2999999821186,"responseEnd":795.0999999940395,"responseStart":795.0999999940395,"secureConnectionStart":513.2999999821186},{"duration":364.09999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":513.5,"connectEnd":513.5,"connectStart":513.5,"domainLookupEnd":513.5,"domainLookupStart":513.5,"fetchStart":513.5,"redirectEnd":0,"redirectStart":0,"requestStart":513.5,"responseEnd":877.5999999940395,"responseStart":877.5999999940395,"secureConnectionStart":513.5},{"duration":367.40000000596046,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":513.7999999821186,"connectEnd":513.7999999821186,"connectStart":513.7999999821186,"domainLookupEnd":513.7999999821186,"domainLookupStart":513.7999999821186,"fetchStart":513.7999999821186,"redirectEnd":0,"redirectStart":0,"requestStart":513.7999999821186,"responseEnd":881.1999999880791,"responseStart":881.1999999880791,"secureConnectionStart":513.7999999821186},{"duration":367.59999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":514,"connectEnd":514,"connectStart":514,"domainLookupEnd":514,"domainLookupStart":514,"fetchStart":514,"redirectEnd":0,"redirectStart":0,"requestStart":514,"responseEnd":881.5999999940395,"responseStart":881.5999999940395,"secureConnectionStart":514},{"duration":367.90000000596046,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":514.1999999880791,"connectEnd":514.1999999880791,"connectStart":514.1999999880791,"domainLookupEnd":514.1999999880791,"domainLookupStart":514.1999999880791,"fetchStart":514.1999999880791,"redirectEnd":0,"redirectStart":0,"requestStart":514.1999999880791,"responseEnd":882.0999999940395,"responseStart":882.0999999940395,"secureConnectionStart":514.1999999880791},{"duration":422.90000000596046,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":514.3999999761581,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":514.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":937.2999999821186,"responseStart":0,"secureConnectionStart":0},{"duration":367.90000000596046,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":514.5999999940395,"connectEnd":514.5999999940395,"connectStart":514.5999999940395,"domainLookupEnd":514.5999999940395,"domainLookupStart":514.5999999940395,"fetchStart":514.5999999940395,"redirectEnd":0,"redirectStart":0,"requestStart":514.5999999940395,"responseEnd":882.5,"responseStart":882.5,"secureConnectionStart":514.5999999940395},{"duration":422.7000000178814,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/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":514.7999999821186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":514.7999999821186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":937.5,"responseStart":0,"secureConnectionStart":0},{"duration":368.2000000178814,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/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":514.8999999761581,"connectEnd":514.8999999761581,"connectStart":514.8999999761581,"domainLookupEnd":514.8999999761581,"domainLookupStart":514.8999999761581,"fetchStart":514.8999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":514.8999999761581,"responseEnd":883.0999999940395,"responseStart":883.0999999940395,"secureConnectionStart":514.8999999761581},{"duration":1525.9000000059605,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":515.8999999761581,"connectEnd":515.8999999761581,"connectStart":515.8999999761581,"domainLookupEnd":515.8999999761581,"domainLookupStart":515.8999999761581,"fetchStart":515.8999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":515.8999999761581,"responseEnd":2041.7999999821186,"responseStart":2041.7999999821186,"secureConnectionStart":515.8999999761581},{"duration":1526.5999999940395,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":516,"connectEnd":516,"connectStart":516,"domainLookupEnd":516,"domainLookupStart":516,"fetchStart":516,"redirectEnd":0,"redirectStart":0,"requestStart":516,"responseEnd":2042.5999999940395,"responseStart":2042.5999999940395,"secureConnectionStart":516},{"duration":1000.4000000059605,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":948.7999999821186,"connectEnd":948.7999999821186,"connectStart":948.7999999821186,"domainLookupEnd":948.7999999821186,"domainLookupStart":948.7999999821186,"fetchStart":948.7999999821186,"redirectEnd":0,"redirectStart":0,"requestStart":948.7999999821186,"responseEnd":1949.199999988079,"responseStart":1949.199999988079,"secureConnectionStart":948.7999999821186},{"duration":820.4000000059605,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1238.5999999940395,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1238.5999999940395,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2059,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":341,"responseStart":484,"responseEnd":491,"domLoading":511,"domInteractive":2064,"domContentLoadedEventStart":2064,"domContentLoadedEventEnd":2103,"domComplete":3431,"loadEventStart":3432,"loadEventEnd":3433,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2047.5999999940395},{"name":"bigPipe.sidebar-id.end","time":2048.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":2048.5999999940395},{"name":"bigPipe.activity-panel-pipe-id.end","time":2051},{"name":"activityTabFullyLoaded","time":2108.7999999821186}],"measures":[],"correlationId":"6472390656e644","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":87,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}