Type:
Bug
Priority:
Minor
Resolution:
Fixed
Affects Version/s:
10.5
This issue was found while analysing MDEV-28800 . For low buffer pool size, the scenario sometimes hangs instead of exiting with Fatal Error. The issue is likely there for long time but is not repeatable easily. It is better to fix it as it can affect internal tests using low BP.
The issue can be repeated using debug enforcement to allocate more locks. The expected behaviour is ER_LOCK_TABLE_FULL instead of a server hang.
Code
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 0891ad5ceb7..d9a3c96aab0 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -1739,6 +1739,11 @@ lock_rec_find_similar_on_page(
const trx_t* trx) /*!< in: transaction */
{
ut_ad(lock_mutex_own());
+ DBUG_EXECUTE_IF("innodb_skip_lock_bitmap", {
+ if (!trx->in_rollback) {
+ return nullptr;
+ }
+ });
for (/* No op */;
lock != NULL;
Test
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
call mtr.add_suppression("\\[Warning\\] InnoDB: Over 67 percent of the buffer pool.*");
CREATE TABLE t1 (col1 INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
SET DEBUG_DBUG="+d,innodb_skip_lock_bitmap";
--error ER_LOCK_TABLE_FULL
INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e, t1 f, t1 g LIMIT 45000;
SET DEBUG_DBUG="-d,innodb_skip_lock_bitmap";
SELECT COUNT(*) FROM t1;
DROP TABLE t1;
Debarun Banerjee
made changes -
2024-05-15 12:14
Field
Original Value
New Value
Fix Version/s
10.6
[ 24028
]
Debarun Banerjee
made changes -
2024-05-15 12:14
Status
Open
[ 1
]
Confirmed
[ 10101
]
Debarun Banerjee
made changes -
2024-05-15 12:15
Assignee
Debarun Banerjee
[ JIRAUSER54513
]
Marko Mäkelä
[ marko
]
Status
Confirmed
[ 10101
]
In Review
[ 10002
]
Marko Mäkelä
made changes -
2024-05-21 07:01
Assignee
Marko Mäkelä
[ marko
]
Debarun Banerjee
[ JIRAUSER54513
]
Status
In Review
[ 10002
]
Stalled
[ 10000
]
Debarun Banerjee
made changes -
2024-05-21 10:52
Fix Version/s
10.5.26
[ 29832
]
Fix Version/s
10.6
[ 24028
]
Resolution
Fixed
[ 1
]
Status
Stalled
[ 10000
]
Closed
[ 6
]
JiraAutomate
made changes -
2024-05-21 10:52
Fix Version/s
10.6.19
[ 29833
]
Fix Version/s
10.11.9
[ 29834
]
Fix Version/s
11.1.6
[ 29835
]
Fix Version/s
11.2.5
[ 29836
]
Fix Version/s
11.4.3
[ 29837
]
Roel Van de Paar
made changes -
2024-05-24 01:48
Description
This issue was found while analysing[ MDEV-28800 |https://jira.mariadb.org/browse/MDEV-28800 ]. For low buffer pool size, the scenario sometimes hangs instead of exiting with Fatal Error. The issue is likely there for long time but is not repeatable easily. It is better to fix it as it can affect internal tests using low BP.
The issue can be repeated using debug enforcement to allocate more locks. The expected behaviour is ER_LOCK_TABLE_FULL instead of a server hang.
+Code+
{code:C++}
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 0891ad5ceb7..d9a3c96aab0 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -1739,6 +1739,11 @@ lock_rec_find_similar_on_page(
const trx_t* trx) /*!< in: transaction */
{
ut_ad(lock_mutex_own());
+ DBUG_EXECUTE_IF("innodb_skip_lock_bitmap", {
+ if (!trx->in_rollback) {
+ return nullptr;
+ }
+ });
for (/* No op */;
lock != NULL;
{code}
+Test+
{code:C++}
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
call mtr.add_suppression("\\[Warning\\] InnoDB: Over 67 percent of the buffer pool.*");
CREATE TABLE t1 (col1 INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
SET DEBUG_DBUG="+d,innodb_skip_lock_bitmap";
--error ER_LOCK_TABLE_FULL
INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e, t1 f, t1 g LIMIT 45000;
SET DEBUG_DBUG="-d,innodb_skip_lock_bitmap";
SELECT COUNT(*) FROM t1;
DROP TABLE t1;
{code}
This issue was found while analysing MDEV-28800 . For low buffer pool size, the scenario sometimes hangs instead of exiting with Fatal Error. The issue is likely there for long time but is not repeatable easily. It is better to fix it as it can affect internal tests using low BP.
The issue can be repeated using debug enforcement to allocate more locks. The expected behaviour is ER_LOCK_TABLE_FULL instead of a server hang.
+Code+
{code:C++}
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 0891ad5ceb7..d9a3c96aab0 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -1739,6 +1739,11 @@ lock_rec_find_similar_on_page(
const trx_t* trx) /*!< in: transaction */
{
ut_ad(lock_mutex_own());
+ DBUG_EXECUTE_IF("innodb_skip_lock_bitmap", {
+ if (!trx->in_rollback) {
+ return nullptr;
+ }
+ });
for (/* No op */;
lock != NULL;
{code}
+Test+
{code:C++}
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
call mtr.add_suppression("\\[Warning\\] InnoDB: Over 67 percent of the buffer pool.*");
CREATE TABLE t1 (col1 INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
SET DEBUG_DBUG="+d,innodb_skip_lock_bitmap";
--error ER_LOCK_TABLE_FULL
INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e, t1 f, t1 g LIMIT 45000;
SET DEBUG_DBUG="-d,innodb_skip_lock_bitmap";
SELECT COUNT(*) FROM t1;
DROP TABLE t1;
{code}
{"report":{"fcp":1095.8000001907349,"ttfb":308.30000019073486,"pageVisibility":"visible","entityId":129151,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"94fe3b84-7041-4187-bb72-980a47789f8c","navigationType":0,"readyForUser":1179.7000002861023,"redirectCount":0,"resourceLoadedEnd":805,"resourceLoadedStart":320,"resourceTiming":[{"duration":31.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":320,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":320,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":351.5,"responseStart":0,"secureConnectionStart":0},{"duration":31.699999809265137,"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":320.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":320.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":352,"responseStart":0,"secureConnectionStart":0},{"duration":194.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":320.5,"connectEnd":320.5,"connectStart":320.5,"domainLookupEnd":320.5,"domainLookupStart":320.5,"fetchStart":320.5,"redirectEnd":0,"redirectStart":0,"requestStart":355.40000009536743,"responseEnd":514.9000000953674,"responseStart":376.7000002861023,"secureConnectionStart":320.5},{"duration":484.2999997138977,"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":320.7000002861023,"connectEnd":320.7000002861023,"connectStart":320.7000002861023,"domainLookupEnd":320.7000002861023,"domainLookupStart":320.7000002861023,"fetchStart":320.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":356.80000019073486,"responseEnd":805,"responseStart":377.7000002861023,"secureConnectionStart":320.7000002861023},{"duration":35.09999990463257,"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":320.90000009536743,"connectEnd":320.90000009536743,"connectStart":320.90000009536743,"domainLookupEnd":320.90000009536743,"domainLookupStart":320.90000009536743,"fetchStart":320.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":320.90000009536743,"responseEnd":356,"responseStart":356,"secureConnectionStart":320.90000009536743},{"duration":36.40000009536743,"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":321.09999990463257,"connectEnd":321.09999990463257,"connectStart":321.09999990463257,"domainLookupEnd":321.09999990463257,"domainLookupStart":321.09999990463257,"fetchStart":321.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":321.09999990463257,"responseEnd":357.5,"responseStart":357.5,"secureConnectionStart":321.09999990463257},{"duration":38.59999990463257,"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":321.30000019073486,"connectEnd":321.30000019073486,"connectStart":321.30000019073486,"domainLookupEnd":321.30000019073486,"domainLookupStart":321.30000019073486,"fetchStart":321.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":321.30000019073486,"responseEnd":359.90000009536743,"responseStart":359.90000009536743,"secureConnectionStart":321.30000019073486},{"duration":39.19999980926514,"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":321.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":321.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":360.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":64.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":321.59999990463257,"connectEnd":321.59999990463257,"connectStart":321.59999990463257,"domainLookupEnd":321.59999990463257,"domainLookupStart":321.59999990463257,"fetchStart":321.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":361.59999990463257,"responseEnd":385.90000009536743,"responseStart":382.09999990463257,"secureConnectionStart":321.59999990463257},{"duration":39,"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":321.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":321.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":360.7000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":66.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":321.90000009536743,"connectEnd":321.90000009536743,"connectStart":321.90000009536743,"domainLookupEnd":321.90000009536743,"domainLookupStart":321.90000009536743,"fetchStart":321.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":362.7000002861023,"responseEnd":388.80000019073486,"responseStart":386.59999990463257,"secureConnectionStart":321.90000009536743},{"duration":69.90000009536743,"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":322.80000019073486,"connectEnd":322.80000019073486,"connectStart":322.80000019073486,"domainLookupEnd":322.80000019073486,"domainLookupStart":322.80000019073486,"fetchStart":322.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":322.80000019073486,"responseEnd":392.7000002861023,"responseStart":392.7000002861023,"secureConnectionStart":322.80000019073486},{"duration":84.90000009536743,"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":322.80000019073486,"connectEnd":322.80000019073486,"connectStart":322.80000019073486,"domainLookupEnd":322.80000019073486,"domainLookupStart":322.80000019073486,"fetchStart":322.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":322.80000019073486,"responseEnd":407.7000002861023,"responseStart":407.7000002861023,"secureConnectionStart":322.80000019073486},{"duration":196.80000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":644.9000000953674,"connectEnd":644.9000000953674,"connectStart":644.9000000953674,"domainLookupEnd":644.9000000953674,"domainLookupStart":644.9000000953674,"fetchStart":644.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":753.0999999046326,"responseEnd":841.7000002861023,"responseStart":838.0999999046326,"secureConnectionStart":644.9000000953674},{"duration":282.19999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1036.8000001907349,"connectEnd":1036.8000001907349,"connectStart":1036.8000001907349,"domainLookupEnd":1036.8000001907349,"domainLookupStart":1036.8000001907349,"fetchStart":1036.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1244.5,"responseEnd":1319,"responseStart":1317.5,"secureConnectionStart":1036.8000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":64,"responseStart":308,"responseEnd":315,"domLoading":317,"domInteractive":1289,"domContentLoadedEventStart":1289,"domContentLoadedEventEnd":1351,"domComplete":1736,"loadEventStart":1736,"loadEventEnd":1736,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1223.4000000953674},{"name":"bigPipe.sidebar-id.end","time":1224.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1224.2000002861023},{"name":"bigPipe.activity-panel-pipe-id.end","time":1227.8000001907349},{"name":"activityTabFullyLoaded","time":1372.7000002861023}],"measures":[],"correlationId":"2a87909d174a20","effectiveType":"4g","downlink":9.3,"rtt":0,"serverDuration":144,"dbReadsTimeInMs":29,"dbConnsTimeInMs":41,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}