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":1777.3999999761581,"ttfb":912,"pageVisibility":"visible","entityId":67989,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"b6e5e051-1f1b-4f8a-8bc6-d5a45531c318","navigationType":0,"readyForUser":1856,"redirectCount":0,"resourceLoadedEnd":2852.5,"resourceLoadedStart":917.5999999046326,"resourceTiming":[{"duration":284.3000000715256,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":917.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":917.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1201.8999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":284.1999999284744,"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":918,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":918,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1202.1999999284744,"responseStart":0,"secureConnectionStart":0},{"duration":381.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":918.0999999046326,"connectEnd":918.0999999046326,"connectStart":918.0999999046326,"domainLookupEnd":918.0999999046326,"domainLookupStart":918.0999999046326,"fetchStart":918.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":918.0999999046326,"responseEnd":1300,"responseStart":1300,"secureConnectionStart":918.0999999046326},{"duration":435.2999999523163,"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":918.2999999523163,"connectEnd":918.2999999523163,"connectStart":918.2999999523163,"domainLookupEnd":918.2999999523163,"domainLookupStart":918.2999999523163,"fetchStart":918.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":918.2999999523163,"responseEnd":1353.5999999046326,"responseStart":1353.5999999046326,"secureConnectionStart":918.2999999523163},{"duration":439.1999999284744,"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":918.5,"connectEnd":918.5,"connectStart":918.5,"domainLookupEnd":918.5,"domainLookupStart":918.5,"fetchStart":918.5,"redirectEnd":0,"redirectStart":0,"requestStart":918.5,"responseEnd":1357.6999999284744,"responseStart":1357.6999999284744,"secureConnectionStart":918.5},{"duration":439.39999997615814,"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":918.7999999523163,"connectEnd":918.7999999523163,"connectStart":918.7999999523163,"domainLookupEnd":918.7999999523163,"domainLookupStart":918.7999999523163,"fetchStart":918.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":918.7999999523163,"responseEnd":1358.1999999284744,"responseStart":1358.1999999284744,"secureConnectionStart":918.7999999523163},{"duration":439.5,"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":919,"connectEnd":919,"connectStart":919,"domainLookupEnd":919,"domainLookupStart":919,"fetchStart":919,"redirectEnd":0,"redirectStart":0,"requestStart":919,"responseEnd":1358.5,"responseStart":1358.5,"secureConnectionStart":919},{"duration":527.2000000476837,"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":919.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":919.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1446.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":439.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":919.2999999523163,"connectEnd":919.2999999523163,"connectStart":919.2999999523163,"domainLookupEnd":919.2999999523163,"domainLookupStart":919.2999999523163,"fetchStart":919.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":919.2999999523163,"responseEnd":1359,"responseStart":1359,"secureConnectionStart":919.2999999523163},{"duration":527,"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":919.3999999761581,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":919.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1446.3999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":439.90000009536743,"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":919.5999999046326,"connectEnd":919.5999999046326,"connectStart":919.5999999046326,"domainLookupEnd":919.5999999046326,"domainLookupStart":919.5999999046326,"fetchStart":919.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":919.5999999046326,"responseEnd":1359.5,"responseStart":1359.5,"secureConnectionStart":919.5999999046326},{"duration":1024.5,"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":920.8999999761581,"connectEnd":920.8999999761581,"connectStart":920.8999999761581,"domainLookupEnd":920.8999999761581,"domainLookupStart":920.8999999761581,"fetchStart":920.8999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":920.8999999761581,"responseEnd":1945.3999999761581,"responseStart":1945.3999999761581,"secureConnectionStart":920.8999999761581},{"duration":1931.5,"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":921,"connectEnd":921,"connectStart":921,"domainLookupEnd":921,"domainLookupStart":921,"fetchStart":921,"redirectEnd":0,"redirectStart":0,"requestStart":921,"responseEnd":2852.5,"responseStart":2852.5,"secureConnectionStart":921},{"duration":489.2000000476837,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1458.7999999523163,"connectEnd":1458.7999999523163,"connectStart":1458.7999999523163,"domainLookupEnd":1458.7999999523163,"domainLookupStart":1458.7999999523163,"fetchStart":1458.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":1458.7999999523163,"responseEnd":1948,"responseStart":1948,"secureConnectionStart":1458.7999999523163}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":749,"responseStart":912,"responseEnd":915,"domLoading":915,"domInteractive":2884,"domContentLoadedEventStart":2884,"domContentLoadedEventEnd":2930,"domComplete":4637,"loadEventStart":4637,"loadEventEnd":4639,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2858.6999999284744},{"name":"bigPipe.sidebar-id.end","time":2859.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":2859.7999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":2864.5999999046326},{"name":"activityTabFullyLoaded","time":2937.6999999284744}],"measures":[],"correlationId":"59134524d09931","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":107,"dbReadsTimeInMs":18,"dbConnsTimeInMs":28,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}