Type:
Task
Priority:
Major
Resolution:
Won't Do
In an effort to speed up crash recovery, InnoDB introduced buf_pool_t::flush_rbt , which would keep the flush_list sorted by oldest_modification during recovery. MDEV-23399 will remove the buf_pool.flush_rbt to simplify the page flushing code.
Such ordering should be beneficial at all times, but maintaining 2 data collections (doubly linked list and binary search tree) is clearly suboptimal. Replacing the doubly-linked buf_pool.flush_list with a priority queue ORDER BY page.oldest_modification ASC, page.id ASC should include the following benefits:
guarantee linear progress of the page cleaner (advancing the MIN(oldest_modification) )
remove the need of FlushHp (unlike a linked list, a priority queue in something like an array allows the mutex to be released and reacquired in the middle of an iteration)
remove all page lookups from buf_flush_try_neighbors() because the buf_pool.flush_list is already ORDER BY page.oldest_modification ASC, page.id ASC (this will not affect SSD thanks to MDEV-17380 )
remove the need to flush the buffer pool after recovery (recv_sys.debug_free() ), and thus remove one blocker of MDEV-14481
One implementation challenge is that apart from the buf_block_t that are in buf_pool.chunks for ROW_FORMAT=COMPRESSED pages we have some buf_page_t that are allocated with malloc() . The majority of buf_page_t are actually buf_block_t::page . Because of this, the priority queue will probably have to store pointers to buf_page_t .
{"report":{"fcp":844.0999999940395,"ttfb":217.09999999403954,"pageVisibility":"visible","entityId":91845,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"9fbae905-f05f-4204-b5bf-be116a568586","navigationType":0,"readyForUser":912.0999999940395,"redirectCount":0,"resourceLoadedEnd":958.6999999880791,"resourceLoadedStart":222.2999999821186,"resourceTiming":[{"duration":100.80000001192093,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":222.2999999821186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":222.2999999821186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":323.09999999403954,"responseStart":0,"secureConnectionStart":0},{"duration":100.90000000596046,"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":222.59999999403954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":222.59999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":323.5,"responseStart":0,"secureConnectionStart":0},{"duration":112.09999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":222.7999999821186,"connectEnd":222.7999999821186,"connectStart":222.7999999821186,"domainLookupEnd":222.7999999821186,"domainLookupStart":222.7999999821186,"fetchStart":222.7999999821186,"redirectEnd":0,"redirectStart":0,"requestStart":222.7999999821186,"responseEnd":334.89999997615814,"responseStart":334.89999997615814,"secureConnectionStart":222.7999999821186},{"duration":165.2000000178814,"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":222.89999997615814,"connectEnd":222.89999997615814,"connectStart":222.89999997615814,"domainLookupEnd":222.89999997615814,"domainLookupStart":222.89999997615814,"fetchStart":222.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":222.89999997615814,"responseEnd":388.09999999403954,"responseStart":388.09999999403954,"secureConnectionStart":222.89999997615814},{"duration":168.80000001192093,"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":223.19999998807907,"connectEnd":223.19999998807907,"connectStart":223.19999998807907,"domainLookupEnd":223.19999998807907,"domainLookupStart":223.19999998807907,"fetchStart":223.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":223.19999998807907,"responseEnd":392,"responseStart":392,"secureConnectionStart":223.19999998807907},{"duration":169.09999999403954,"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":223.2999999821186,"connectEnd":223.2999999821186,"connectStart":223.2999999821186,"domainLookupEnd":223.2999999821186,"domainLookupStart":223.2999999821186,"fetchStart":223.2999999821186,"redirectEnd":0,"redirectStart":0,"requestStart":223.2999999821186,"responseEnd":392.39999997615814,"responseStart":392.39999997615814,"secureConnectionStart":223.2999999821186},{"duration":169.39999997615814,"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":223.5,"connectEnd":223.5,"connectStart":223.5,"domainLookupEnd":223.5,"domainLookupStart":223.5,"fetchStart":223.5,"redirectEnd":0,"redirectStart":0,"requestStart":223.5,"responseEnd":392.89999997615814,"responseStart":392.89999997615814,"secureConnectionStart":223.5},{"duration":254.5,"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":223.69999998807907,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":223.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":478.19999998807907,"responseStart":0,"secureConnectionStart":0},{"duration":169.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":223.89999997615814,"connectEnd":223.89999997615814,"connectStart":223.89999997615814,"domainLookupEnd":223.89999997615814,"domainLookupStart":223.89999997615814,"fetchStart":223.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":223.89999997615814,"responseEnd":393.39999997615814,"responseStart":393.39999997615814,"secureConnectionStart":223.89999997615814},{"duration":254.2999999821186,"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":224,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":224,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":478.2999999821186,"responseStart":0,"secureConnectionStart":0},{"duration":169.90000000596046,"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":224.2999999821186,"connectEnd":224.2999999821186,"connectStart":224.2999999821186,"domainLookupEnd":224.2999999821186,"domainLookupStart":224.2999999821186,"fetchStart":224.2999999821186,"redirectEnd":0,"redirectStart":0,"requestStart":224.2999999821186,"responseEnd":394.19999998807907,"responseStart":394.19999998807907,"secureConnectionStart":224.2999999821186},{"duration":352,"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":225.09999999403954,"connectEnd":225.09999999403954,"connectStart":225.09999999403954,"domainLookupEnd":225.09999999403954,"domainLookupStart":225.09999999403954,"fetchStart":225.09999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":225.09999999403954,"responseEnd":577.0999999940395,"responseStart":577.0999999940395,"secureConnectionStart":225.09999999403954},{"duration":717,"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":229.39999997615814,"connectEnd":229.39999997615814,"connectStart":229.39999997615814,"domainLookupEnd":229.39999997615814,"domainLookupStart":229.39999997615814,"fetchStart":229.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":229.39999997615814,"responseEnd":946.3999999761581,"responseStart":946.3999999761581,"secureConnectionStart":229.39999997615814},{"duration":87.09999999403954,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":490.2999999821186,"connectEnd":490.2999999821186,"connectStart":490.2999999821186,"domainLookupEnd":490.2999999821186,"domainLookupStart":490.2999999821186,"fetchStart":490.2999999821186,"redirectEnd":0,"redirectStart":0,"requestStart":490.2999999821186,"responseEnd":577.3999999761581,"responseStart":577.3999999761581,"secureConnectionStart":490.2999999821186},{"duration":210.90000000596046,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bv2/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":747.5999999940395,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":747.5999999940395,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":958.5,"responseStart":0,"secureConnectionStart":0},{"duration":210.59999999403954,"initiatorType":"link","name":"https://jira.mariadb.org/s/50bc9be5bfead1a25e72c1a9338c94f6-CDN/lu2bv2/820016/12ta74/e108c7645258ccb43280ed3404e3e949/_/download/contextbatch/css/com.atlassian.jira.plugins.jira-development-integration-plugin:0,-_super,-jira.view.issue,-jira.global,-jira.general,-jira.browse.project,-project.issue.navigator,-atl.general/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":748.0999999940395,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":748.0999999940395,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":958.6999999880791,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":32,"responseStart":217,"responseEnd":222,"domLoading":220,"domInteractive":966,"domContentLoadedEventStart":966,"domContentLoadedEventEnd":1008,"domComplete":2593,"loadEventStart":2593,"loadEventEnd":2595,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":948},{"name":"bigPipe.sidebar-id.end","time":948.6999999880791},{"name":"bigPipe.activity-panel-pipe-id.start","time":948.8999999761581},{"name":"bigPipe.activity-panel-pipe-id.end","time":951.2999999821186},{"name":"activityTabFullyLoaded","time":1014.8999999761581}],"measures":[],"correlationId":"1684d05811fc25","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":105,"dbReadsTimeInMs":13,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}