mysqltest: At line 787: query 'DROP TABLE t1' failed: 2013: Lost connection to MySQL server during query
…
Version: '10.5.0-MariaDB-debug-log' socket: '/dev/shm/var/tmp/3/mysqld.1.sock' port: 16040 Source distribution
2019-12-03 7:49:20 4 [ERROR] InnoDB: Cannot add field `c10` in table `test`.`t1` because after adding it, the row size is 1979 which is greater than maximum allowed size (1979 bytes) for a record on index leaf page.
2019-12-03 7:49:20 4 [ERROR] InnoDB: Cannot add field `c10` in table `test`.`t1` because after adding it, the row size is 1982 which is greater than maximum allowed size (1982 bytes) for a record on index leaf page.
2019-12-03 7:49:20 4 [ERROR] InnoDB: Cannot add field `c10` in table `test`.`t1` because after adding it, the row size is 1902 which is greater than maximum allowed size (1900 bytes) for a record on index leaf page.
2019-12-03 7:49:20 4 [ERROR] InnoDB: Cannot add field `c10` in table `test`.`t1` because after adding it, the row size is 1982 which is greater than maximum allowed size (1982 bytes) for a record on index leaf page.
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
DROP TABLE t1;
+--disable_query_log
+SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
+--enable_query_log
It will still not fail every time. For a crash that I reproduced, node_ptr-block->frame in btr_discard_page() was 8351, which is more than the configured innodb_page_size=4k.
It requires a high concurrency to fail. I was also able to reproduce it for the 4k,full_crc32 combination.
Marko Mäkelä
added a comment - Waiting for purge before the DROP TABLE dramatically improves reproducibility:
diff --git a/mysql-test/suite/innodb_zip/r/page_size.result b/mysql-test/suite/innodb_zip/r/page_size.result
index e65a57326ec..c823c9d0d3f 100644
--- a/mysql-test/suite/innodb_zip/r/page_size.result
+++ b/mysql-test/suite/innodb_zip/r/page_size.result
@@ -566,6 +566,7 @@ SET @r = repeat('e', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
DELETE from t1;
+InnoDB 0 transactions not purged
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
diff --git a/mysql-test/suite/innodb_zip/t/page_size.test b/mysql-test/suite/innodb_zip/t/page_size.test
index 0faf4428f62..c8d2a3c4d2a 100644
--- a/mysql-test/suite/innodb_zip/t/page_size.test
+++ b/mysql-test/suite/innodb_zip/t/page_size.test
@@ -3,6 +3,8 @@
SET default_storage_engine=InnoDB;
--disable_query_log
+SET @save_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
let $MYSQLD_DATADIR = `select @@datadir`;
let $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
@@ -821,6 +823,7 @@ SET @r = repeat('e', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
DELETE from t1;
+--source ../../innodb/include/wait_all_purged.inc
DROP TABLE t1;
#-- disable_query_log
@@ -872,3 +875,6 @@ CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
DROP TABLE t1;
+--disable_query_log
+SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
+--enable_query_log
It will still not fail every time. For a crash that I reproduced, node_ptr-block->frame in btr_discard_page() was 8351, which is more than the configured innodb_page_size=4k .
It requires a high concurrency to fail. I was also able to reproduce it for the 4k,full_crc32 combination.
The assertion would fail, because only a subsequent call to btr_level_list_remove() in the same mini-transaction would make merge_block the leftmost on its level. I think that we can retain the assertion by refactoring the code a little more.
Marko Mäkelä
added a comment - There were two bugs in the code. The second one is an assertion that would fail if we had passed the correct parameter to the function call:
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -4182,7 +4178,7 @@ btr_discard_page(
because everything will take place within a single
mini-transaction and because writing to the redo log
is an atomic operation (performed by mtr_commit()). */
- btr_set_min_rec_mark(node_ptr, *block, mtr);
+ btr_set_min_rec_mark(node_ptr, *merge_block, mtr);
}
if (dict_index_is_spatial(index)) {
diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h
--- a/storage/innobase/include/btr0btr.h
+++ b/storage/innobase/include/btr0btr.h
@@ -532,7 +532,6 @@ inline void btr_set_min_rec_mark(rec_t *rec, const buf_block_t &block,
{
ut_ad(block.frame == page_align(rec));
ut_ad(!page_is_leaf(block.frame));
- ut_ad(!page_has_prev(block.frame));
rec-= page_rec_is_comp(rec) ? REC_NEW_INFO_BITS : REC_OLD_INFO_BITS;
The assertion would fail, because only a subsequent call to btr_level_list_remove() in the same mini-transaction would make merge_block the leftmost on its level. I think that we can retain the assertion by refactoring the code a little more.
People
Marko Mäkelä
Marko Mäkelä
Votes:
0Vote for this issue
Watchers:
1Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":821.7000000476837,"ttfb":182,"pageVisibility":"visible","entityId":80851,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"af06f114-6df7-4168-91a1-13573544d3fe","navigationType":0,"readyForUser":882.6000000238419,"redirectCount":0,"resourceLoadedEnd":415,"resourceLoadedStart":189.60000002384186,"resourceTiming":[{"duration":100.30000007152557,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":189.60000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":189.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":289.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":100.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":189.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":189.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":290.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":192.39999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":189.90000009536743,"connectEnd":189.90000009536743,"connectStart":189.90000009536743,"domainLookupEnd":189.90000009536743,"domainLookupStart":189.90000009536743,"fetchStart":189.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":293.2000000476837,"responseEnd":382.3000000715256,"responseStart":306.3000000715256,"secureConnectionStart":189.90000009536743},{"duration":224.89999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":190.10000002384186,"connectEnd":190.10000002384186,"connectStart":190.10000002384186,"domainLookupEnd":190.10000002384186,"domainLookupStart":190.10000002384186,"fetchStart":190.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":294.3000000715256,"responseEnd":415,"responseStart":313.40000009536743,"secureConnectionStart":190.10000002384186},{"duration":123,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":190.20000004768372,"connectEnd":190.20000004768372,"connectStart":190.20000004768372,"domainLookupEnd":190.20000004768372,"domainLookupStart":190.20000004768372,"fetchStart":190.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":295.10000002384186,"responseEnd":313.2000000476837,"responseStart":312.3000000715256,"secureConnectionStart":190.20000004768372},{"duration":131.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":190.20000004768372,"connectEnd":190.20000004768372,"connectStart":190.20000004768372,"domainLookupEnd":190.20000004768372,"domainLookupStart":190.20000004768372,"fetchStart":190.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":296.8000000715256,"responseEnd":322,"responseStart":320.90000009536743,"secureConnectionStart":190.20000004768372},{"duration":132.89999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":190.30000007152557,"connectEnd":190.30000007152557,"connectStart":190.30000007152557,"domainLookupEnd":190.30000007152557,"domainLookupStart":190.30000007152557,"fetchStart":190.30000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":297.3000000715256,"responseEnd":323.2000000476837,"responseStart":322.2000000476837,"secureConnectionStart":190.30000007152557},{"duration":106.80000007152557,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":190.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":190.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":297.3000000715256,"responseStart":0,"secureConnectionStart":0},{"duration":135.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":190.5,"connectEnd":190.5,"connectStart":190.5,"domainLookupEnd":190.5,"domainLookupStart":190.5,"fetchStart":190.5,"redirectEnd":0,"redirectStart":0,"requestStart":300,"responseEnd":325.90000009536743,"responseStart":324.40000009536743,"secureConnectionStart":190.5},{"duration":107.70000004768372,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":190.60000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":190.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":298.3000000715256,"responseStart":0,"secureConnectionStart":0},{"duration":137.39999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":190.80000007152557,"connectEnd":190.80000007152557,"connectStart":190.80000007152557,"domainLookupEnd":190.80000007152557,"domainLookupStart":190.80000007152557,"fetchStart":190.80000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":300.90000009536743,"responseEnd":328.2000000476837,"responseStart":326.40000009536743,"secureConnectionStart":190.80000007152557},{"duration":204.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":199.80000007152557,"connectEnd":199.80000007152557,"connectStart":199.80000007152557,"domainLookupEnd":199.80000007152557,"domainLookupStart":199.80000007152557,"fetchStart":199.80000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":347.90000009536743,"responseEnd":404.3000000715256,"responseStart":403.3000000715256,"secureConnectionStart":199.80000007152557},{"duration":197.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":208.40000009536743,"connectEnd":208.40000009536743,"connectStart":208.40000009536743,"domainLookupEnd":208.40000009536743,"domainLookupStart":208.40000009536743,"fetchStart":208.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":389.90000009536743,"responseEnd":405.90000009536743,"responseStart":404.90000009536743,"secureConnectionStart":208.40000009536743},{"duration":204.20000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":577,"connectEnd":577,"connectStart":577,"domainLookupEnd":577,"domainLookupStart":577,"fetchStart":577,"redirectEnd":0,"redirectStart":0,"requestStart":749.2000000476837,"responseEnd":781.2000000476837,"responseStart":780.6000000238419,"secureConnectionStart":577},{"duration":190,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":800.6000000238419,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":800.6000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":990.6000000238419,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":23,"domainLookupEnd":32,"connectStart":32,"connectEnd":52,"secureConnectionStart":41,"requestStart":52,"responseStart":182,"responseEnd":208,"domLoading":186,"domInteractive":942,"domContentLoadedEventStart":942,"domContentLoadedEventEnd":986,"domComplete":1492,"loadEventStart":1492,"loadEventEnd":1493,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":916.9000000953674},{"name":"bigPipe.sidebar-id.end","time":917.6000000238419},{"name":"bigPipe.activity-panel-pipe-id.start","time":917.8000000715256},{"name":"bigPipe.activity-panel-pipe-id.end","time":920.5},{"name":"activityTabFullyLoaded","time":1005.2000000476837}],"measures":[],"correlationId":"1ffc6d0f3ea6a7","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":74,"dbReadsTimeInMs":11,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Waiting for purge before the DROP TABLE dramatically improves reproducibility:
diff --git a/mysql-test/suite/innodb_zip/r/page_size.result b/mysql-test/suite/innodb_zip/r/page_size.result
index e65a57326ec..c823c9d0d3f 100644
--- a/mysql-test/suite/innodb_zip/r/page_size.result
+++ b/mysql-test/suite/innodb_zip/r/page_size.result
@@ -566,6 +566,7 @@ SET @r = repeat('e', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
DELETE from t1;
+InnoDB 0 transactions not purged
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
diff --git a/mysql-test/suite/innodb_zip/t/page_size.test b/mysql-test/suite/innodb_zip/t/page_size.test
index 0faf4428f62..c8d2a3c4d2a 100644
--- a/mysql-test/suite/innodb_zip/t/page_size.test
+++ b/mysql-test/suite/innodb_zip/t/page_size.test
@@ -3,6 +3,8 @@
SET default_storage_engine=InnoDB;
--disable_query_log
+SET @save_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
let $MYSQLD_DATADIR = `select @@datadir`;
let $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
@@ -821,6 +823,7 @@ SET @r = repeat('e', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
DELETE from t1;
+--source ../../innodb/include/wait_all_purged.inc
DROP TABLE t1;
#-- disable_query_log
@@ -872,3 +875,6 @@ CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
DROP TABLE t1;
+--disable_query_log
+SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
It will still not fail every time. For a crash that I reproduced, node_ptr-block->frame in btr_discard_page() was 8351, which is more than the configured innodb_page_size=4k.
It requires a high concurrency to fail. I was also able to reproduce it for the 4k,full_crc32 combination.