Type:
Task
Priority:
Major
Resolution:
Unresolved
Fix Version/s:
None
Currently, lock_t is a union of table locks and record lock bitmaps. There can be multiple record lock bitmaps in a transaction. A record lock bitmap is specific to an index leaf page and a locking mode. It could be more efficient to use a single bitmap per page, with 4 bits per record heap number to represent all combinations of record and gap lock modes: {shared,exclusive,gap-read,gap-write}.
There are two types of gap locks (covering the open range of keys from the preceding record to the anchor record). A gap-read lock (acquired by UPDATE , DELETE , or a locking SELECT ) prevents any subsequent INSERT to that range.
INSERT will acquire a gap-write or insert-intention lock (LOCK_INSERT_INTENTION ). It conflicts with previously granted gap-read locks. Gap-read locks may be granted on the same lock if a gap-write lock has been granted to an active transaction.
An INSERT requires both a gap-write lock and an exclusive lock on the key that is being inserted. Any amount of gap-read locks may be held on the same gap by different transactions.
In lock_rec_has_to_wait() , gap-write locks do not conflict with gap-write locks of other transactions, even though lock_mode_compatible() would not hold.
A transaction can wait for at most one record. MDEV-24671 already simplified lock waits by introducing the function lock_wait() . If we pack 2 record heap numbers per byte (4 bits per heap number) in the record lock bitmap, there is no space for a further LOCK_WAIT flag. We might want to create a special type of bitmap for a waiting lock request, to avoid allocating a large bitmap (if the record heap number is 3000, the size of a straightforward bitmap would be 1500 bytes). We might store the attributes of the single-record lock request in the trx_t object. Maybe we could just preallocate a record lock bitmap object in trx_t , to be used for all waiting requests?
{"report":{"fcp":1083.7999999970198,"ttfb":267,"pageVisibility":"visible","entityId":67989,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"aa3dc944-24a4-49ec-9a98-f7377029f5b4","navigationType":0,"readyForUser":1218.0999999940395,"redirectCount":0,"resourceLoadedEnd":1281.0999999940395,"resourceLoadedStart":271.90000000596046,"resourceTiming":[{"duration":260.29999999701977,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":271.90000000596046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":271.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":532.2000000029802,"responseStart":0,"secureConnectionStart":0},{"duration":255.79999999701977,"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":276.70000000298023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":276.70000000298023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":532.5,"responseStart":0,"secureConnectionStart":0},{"duration":270.40000000596046,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":277,"connectEnd":277,"connectStart":277,"domainLookupEnd":277,"domainLookupStart":277,"fetchStart":277,"redirectEnd":0,"redirectStart":0,"requestStart":277,"responseEnd":547.4000000059605,"responseStart":547.4000000059605,"secureConnectionStart":277},{"duration":360.20000000298023,"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":278,"connectEnd":278,"connectStart":278,"domainLookupEnd":278,"domainLookupStart":278,"fetchStart":278,"redirectEnd":0,"redirectStart":0,"requestStart":278,"responseEnd":638.2000000029802,"responseStart":638.2000000029802,"secureConnectionStart":278},{"duration":363.79999999701977,"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":278.40000000596046,"connectEnd":278.40000000596046,"connectStart":278.40000000596046,"domainLookupEnd":278.40000000596046,"domainLookupStart":278.40000000596046,"fetchStart":278.40000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":278.40000000596046,"responseEnd":642.2000000029802,"responseStart":642.0999999940395,"secureConnectionStart":278.40000000596046},{"duration":364,"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":278.70000000298023,"connectEnd":278.70000000298023,"connectStart":278.70000000298023,"domainLookupEnd":278.70000000298023,"domainLookupStart":278.70000000298023,"fetchStart":278.70000000298023,"redirectEnd":0,"redirectStart":0,"requestStart":278.70000000298023,"responseEnd":642.7000000029802,"responseStart":642.7000000029802,"secureConnectionStart":278.70000000298023},{"duration":364,"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":279.09999999403954,"connectEnd":279.09999999403954,"connectStart":279.09999999403954,"domainLookupEnd":279.09999999403954,"domainLookupStart":279.09999999403954,"fetchStart":279.09999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":279.09999999403954,"responseEnd":643.0999999940395,"responseStart":643.0999999940395,"secureConnectionStart":279.09999999403954},{"duration":421.6000000089407,"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":279.29999999701977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":279.29999999701977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":700.9000000059605,"responseStart":0,"secureConnectionStart":0},{"duration":364.09999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":279.5,"connectEnd":279.5,"connectStart":279.5,"domainLookupEnd":279.5,"domainLookupStart":279.5,"fetchStart":279.5,"redirectEnd":0,"redirectStart":0,"requestStart":279.5,"responseEnd":643.5999999940395,"responseStart":643.5999999940395,"secureConnectionStart":279.5},{"duration":421.3999999910593,"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":279.70000000298023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":279.70000000298023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":701.0999999940395,"responseStart":0,"secureConnectionStart":0},{"duration":364.5,"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":279.79999999701977,"connectEnd":279.79999999701977,"connectStart":279.79999999701977,"domainLookupEnd":279.79999999701977,"domainLookupStart":279.79999999701977,"fetchStart":279.79999999701977,"redirectEnd":0,"redirectStart":0,"requestStart":279.79999999701977,"responseEnd":644.2999999970198,"responseStart":644.2000000029802,"secureConnectionStart":279.79999999701977},{"duration":519.5,"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":281.20000000298023,"connectEnd":281.20000000298023,"connectStart":281.20000000298023,"domainLookupEnd":281.20000000298023,"domainLookupStart":281.20000000298023,"fetchStart":281.20000000298023,"redirectEnd":0,"redirectStart":0,"requestStart":281.20000000298023,"responseEnd":800.7000000029802,"responseStart":800.7000000029802,"secureConnectionStart":281.20000000298023},{"duration":999.6999999880791,"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":281.40000000596046,"connectEnd":281.40000000596046,"connectStart":281.40000000596046,"domainLookupEnd":281.40000000596046,"domainLookupStart":281.40000000596046,"fetchStart":281.40000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":281.40000000596046,"responseEnd":1281.0999999940395,"responseStart":1281.0999999940395,"secureConnectionStart":281.40000000596046},{"duration":84.6000000089407,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":717.5999999940395,"connectEnd":717.5999999940395,"connectStart":717.5999999940395,"domainLookupEnd":717.5999999940395,"domainLookupStart":717.5999999940395,"fetchStart":717.5999999940395,"redirectEnd":0,"redirectStart":0,"requestStart":717.5999999940395,"responseEnd":802.2000000029802,"responseStart":802.2000000029802,"secureConnectionStart":717.5999999940395}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":100,"responseStart":267,"responseEnd":273,"domLoading":270,"domInteractive":1317,"domContentLoadedEventStart":1317,"domContentLoadedEventEnd":1362,"domComplete":2780,"loadEventStart":2780,"loadEventEnd":2782,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1297.7999999970198},{"name":"bigPipe.sidebar-id.end","time":1298.7000000029802},{"name":"bigPipe.activity-panel-pipe-id.start","time":1298.9000000059605},{"name":"bigPipe.activity-panel-pipe-id.end","time":1301.4000000059605},{"name":"activityTabFullyLoaded","time":1370.5999999940395}],"measures":[],"correlationId":"c4763871907d44","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":109,"dbReadsTimeInMs":18,"dbConnsTimeInMs":27,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}