Type:
Task
Priority:
Major
Resolution:
Fixed
Sprint:
10.2.2-1, 10.2.2-2, 10.2.2-3
There is feature that is there in Percona tree 5.5+ and also in MySQL/Enterprise
but not in MariaDB is priorization
By default, connection that is in transaction gets a priority boost (which translated to
in transaction= low prio, outside of transaction => high prio). The first statement after "begin" does not need to be high prio (this transaction does not actually use any resources)
We need to have a variable that will allow to specify per-connection or global scheduling behavior (auto = based on transaction status, high - always high prio, low- always low prio)
This way, it would be easy to return back to FIFO scheduling if someone prefers that (i.e set global threadpool_priority=high). Or for a connection to be "nice" (setting priority = low regardless of transaction status), if it does not unimportant work . This variable is akin to Percona's threadpool_high_prio_mode=[transactions|statements|none] , but with an understandable name.
On Unix ,we'll use separate queues for high priority and low priority items. high priority queue is checked before low prio when an event is dequeued.
On Windows threadpool, it is possible to 'yield' low prio work items.
On Unix, to avoid starvation of the low prio items, periodically the old items in low prio queue need to be merged at the end of high prio queue. We can use 'thread_pool_kickup_timer' logic, like MySQL Enterprise is doing it.
We won't be using 'throttling of low prio queue' like Percona, as restricting the number of active+waiting threads can easily lead to a deadlock (single global lock or table lock would suffice to check that)
{"report":{"fcp":802,"ttfb":263,"pageVisibility":"visible","entityId":57250,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"4adf11c9-f21b-416a-a411-cdc864a3af00","navigationType":0,"readyForUser":857.7000000476837,"redirectCount":0,"resourceLoadedEnd":369.5,"resourceLoadedStart":269.8000000715256,"resourceTiming":[{"duration":4.100000023841858,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":269.8000000715256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":269.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":273.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":4.600000023841858,"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":270.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":270.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":274.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":84.69999992847443,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":270.3000000715256,"connectEnd":270.3000000715256,"connectStart":270.3000000715256,"domainLookupEnd":270.3000000715256,"domainLookupStart":270.3000000715256,"fetchStart":270.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":279.2000000476837,"responseEnd":355,"responseStart":296.60000002384186,"secureConnectionStart":270.3000000715256},{"duration":99,"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":270.5,"connectEnd":270.5,"connectStart":270.5,"domainLookupEnd":270.5,"domainLookupStart":270.5,"fetchStart":270.5,"redirectEnd":0,"redirectStart":0,"requestStart":279.40000009536743,"responseEnd":369.5,"responseStart":309.40000009536743,"secureConnectionStart":270.5},{"duration":42.5,"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":270.7000000476837,"connectEnd":270.7000000476837,"connectStart":270.7000000476837,"domainLookupEnd":270.7000000476837,"domainLookupStart":270.7000000476837,"fetchStart":270.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":279.5,"responseEnd":313.2000000476837,"responseStart":311.3000000715256,"secureConnectionStart":270.7000000476837},{"duration":48.10000002384186,"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":270.8000000715256,"connectEnd":270.8000000715256,"connectStart":270.8000000715256,"domainLookupEnd":270.8000000715256,"domainLookupStart":270.8000000715256,"fetchStart":270.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":283.10000002384186,"responseEnd":318.90000009536743,"responseStart":318.40000009536743,"secureConnectionStart":270.8000000715256},{"duration":55.300000071525574,"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":271,"connectEnd":271,"connectStart":271,"domainLookupEnd":271,"domainLookupStart":271,"fetchStart":271,"redirectEnd":0,"redirectStart":0,"requestStart":283.5,"responseEnd":326.3000000715256,"responseStart":325.8000000715256,"secureConnectionStart":271},{"duration":8.899999976158142,"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":271.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":271.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":280,"responseStart":0,"secureConnectionStart":0},{"duration":55.699999928474426,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":271.3000000715256,"connectEnd":271.3000000715256,"connectStart":271.3000000715256,"domainLookupEnd":271.3000000715256,"domainLookupStart":271.3000000715256,"fetchStart":271.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":283.7000000476837,"responseEnd":327,"responseStart":326.5,"secureConnectionStart":271.3000000715256},{"duration":11.600000023841858,"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":271.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":271.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":283.10000002384186,"responseStart":0,"secureConnectionStart":0},{"duration":58.700000047683716,"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":271.60000002384186,"connectEnd":271.60000002384186,"connectStart":271.60000002384186,"domainLookupEnd":271.60000002384186,"domainLookupStart":271.60000002384186,"fetchStart":271.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":285.8000000715256,"responseEnd":330.3000000715256,"responseStart":329.40000009536743,"secureConnectionStart":271.60000002384186},{"duration":57.799999952316284,"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":281.8000000715256,"connectEnd":281.8000000715256,"connectStart":281.8000000715256,"domainLookupEnd":281.8000000715256,"domainLookupStart":281.8000000715256,"fetchStart":281.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":289.3000000715256,"responseEnd":339.60000002384186,"responseStart":339,"secureConnectionStart":281.8000000715256},{"duration":61.799999952316284,"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":281.90000009536743,"connectEnd":281.90000009536743,"connectStart":281.90000009536743,"domainLookupEnd":281.90000009536743,"domainLookupStart":281.90000009536743,"fetchStart":281.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":291.10000002384186,"responseEnd":343.7000000476837,"responseStart":343.3000000715256,"secureConnectionStart":281.90000009536743},{"duration":187.89999997615814,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":567.2000000476837,"connectEnd":567.2000000476837,"connectStart":567.2000000476837,"domainLookupEnd":567.2000000476837,"domainLookupStart":567.2000000476837,"fetchStart":567.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":711.9000000953674,"responseEnd":755.1000000238419,"responseStart":754.5,"secureConnectionStart":567.2000000476837},{"duration":103.20000004768372,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":781.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":781.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":884.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":105.30000007152557,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":802.1000000238419,"connectEnd":802.1000000238419,"connectStart":802.1000000238419,"domainLookupEnd":802.1000000238419,"domainLookupStart":802.1000000238419,"fetchStart":802.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":866.4000000953674,"responseEnd":907.4000000953674,"responseStart":906.7000000476837,"secureConnectionStart":802.1000000238419}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":112,"responseStart":263,"responseEnd":281,"domLoading":267,"domInteractive":904,"domContentLoadedEventStart":904,"domContentLoadedEventEnd":939,"domComplete":1276,"loadEventStart":1276,"loadEventEnd":1276,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":886.6000000238419},{"name":"bigPipe.sidebar-id.end","time":887.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":887.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":888.5},{"name":"activityTabFullyLoaded","time":955.4000000953674}],"measures":[],"correlationId":"9572b7830e575a","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":94,"dbReadsTimeInMs":9,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
the repository that contains the patch is here https://github.com/MariaDB/server/commits/bb-10.2-wlad-threadpool