Note: Even with the injection below, the test is far from deterministic, the injection only makes the failure more probable. There is still a lot of race involved. On a rotating disk it fails fairly quickly for me (within a minute, usually less), but doesn't fail either on SSD or in shm. I suppose really fast rotating disks can also make reproducing problematic. It seems to be a very good case for debugging through an rr profile.
10.4 edc3899d9 with provided injection
|
mysqld: /data/src/10.4-bug/storage/innobase/trx/trx0rseg.cc:102: void trx_rseg_update_wsrep_checkpoint(trx_rsegf_t*, const XID*, mtr_t*): Assertion `xid_seqno > wsrep_seqno' failed.
|
200410 22:01:26 [ERROR] mysqld got signal 6 ;
|
|
#15 0x00007f86ceea6102 in __GI___assert_fail (assertion=0x55fcc5daf66c "xid_seqno > wsrep_seqno", file=0x55fcc5daf5a0 "/data/src/10.4-bug/storage/innobase/trx/trx0rseg.cc", line=102, function=0x55fcc5dafde0 <trx_rseg_update_wsrep_checkpoint(unsigned char*, xid_t const*, mtr_t*)::__PRETTY_FUNCTION__> "void trx_rseg_update_wsrep_checkpoint(trx_rsegf_t*, const XID*, mtr_t*)") at assert.c:101
|
#16 0x000055fcc55ebc6f in trx_rseg_update_wsrep_checkpoint (rseg_header=0x7f868c664026 "", xid=0x55fcc7b7cfd0, mtr=0x7f86880ad5d0) at /data/src/10.4-bug/storage/innobase/trx/trx0rseg.cc:102
|
#17 0x000055fcc55cd60c in trx_purge_add_undo_to_history (trx=0x7f8698bf8390, undo=@0x7f8698bf93b0: 0x7f86142bcb30, mtr=0x7f86880ad5d0) at /data/src/10.4-bug/storage/innobase/trx/trx0purge.cc:281
|
#18 0x000055fcc55f7be7 in trx_write_serialisation_history (trx=0x7f8698bf8390, mtr=0x7f86880ad5d0) at /data/src/10.4-bug/storage/innobase/trx/trx0trx.cc:1135
|
#19 0x000055fcc55fa015 in trx_commit_low (trx=0x7f8698bf8390, mtr=0x7f86880ad5d0) at /data/src/10.4-bug/storage/innobase/trx/trx0trx.cc:1574
|
#20 0x000055fcc55fa175 in trx_commit (trx=0x7f8698bf8390) at /data/src/10.4-bug/storage/innobase/trx/trx0trx.cc:1642
|
#21 0x000055fcc55fa65a in trx_commit_for_mysql (trx=0x7f8698bf8390) at /data/src/10.4-bug/storage/innobase/trx/trx0trx.cc:1788
|
#22 0x000055fcc53843bc in innobase_commit_low (trx=0x7f8698bf8390) at /data/src/10.4-bug/storage/innobase/handler/ha_innodb.cc:4401
|
#23 0x000055fcc53847e6 in innobase_commit_ordered_2 (trx=0x7f8698bf8390, thd=0x7f8614000d50) at /data/src/10.4-bug/storage/innobase/handler/ha_innodb.cc:4523
|
#24 0x000055fcc5384ab2 in innobase_commit_ordered (hton=0x55fcc7b57f30, thd=0x7f8614000d50, all=false) at /data/src/10.4-bug/storage/innobase/handler/ha_innodb.cc:4583
|
#25 0x000055fcc527a356 in TC_LOG::run_commit_ordered (this=0x55fcc65b4e00 <mysql_bin_log>, thd=0x7f8614000d50, all=false) at /data/src/10.4-bug/sql/log.cc:8944
|
#26 0x000055fcc5277ff2 in MYSQL_BIN_LOG::trx_group_commit_leader (this=0x55fcc65b4e00 <mysql_bin_log>, leader=0x7f86880adfe0) at /data/src/10.4-bug/sql/log.cc:8178
|
#27 0x000055fcc5276995 in MYSQL_BIN_LOG::write_transaction_to_binlog_events (this=0x55fcc65b4e00 <mysql_bin_log>, entry=0x7f86880adfe0) at /data/src/10.4-bug/sql/log.cc:7767
|
#28 0x000055fcc5275e81 in MYSQL_BIN_LOG::write_transaction_to_binlog (this=0x55fcc65b4e00 <mysql_bin_log>, thd=0x7f8614000d50, cache_mngr=0x7f86141f9320, end_ev=0x7f86880ae180, all=false, using_stmt_cache=true, using_trx_cache=true) at /data/src/10.4-bug/sql/log.cc:7415
|
#29 0x000055fcc5264def in binlog_flush_cache (thd=0x7f8614000d50, cache_mngr=0x7f86141f9320, end_ev=0x7f86880ae180, all=false, using_stmt=true, using_trx=true) at /data/src/10.4-bug/sql/log.cc:1786
|
#30 0x000055fcc5265472 in binlog_commit_flush_xid_caches (thd=0x7f8614000d50, cache_mngr=0x7f86141f9320, all=false, xid=42) at /data/src/10.4-bug/sql/log.cc:1894
|
#31 0x000055fcc527c8f9 in MYSQL_BIN_LOG::log_and_order (this=0x55fcc65b4e00 <mysql_bin_log>, thd=0x7f8614000d50, xid=42, all=false, need_prepare_ordered=false, need_commit_ordered=true) at /data/src/10.4-bug/sql/log.cc:9727
|
#32 0x000055fcc514292f in ha_commit_trans (thd=0x7f8614000d50, all=false) at /data/src/10.4-bug/sql/handler.cc:1624
|
#33 0x000055fcc4f7faf3 in trans_commit_stmt (thd=0x7f8614000d50) at /data/src/10.4-bug/sql/transaction.cc:436
|
#34 0x000055fcc4df10ce in mysql_execute_command (thd=0x7f8614000d50) at /data/src/10.4-bug/sql/sql_parse.cc:6158
|
#35 0x000055fcc4df6135 in mysql_parse (thd=0x7f8614000d50, rawbuf=0x7f8614014288 "INSERT /* QNO 21 CON_ID 17 */ INTO t1 (k) VALUES (0)", length=52, parser_state=0x7f86880b0190, is_com_multi=false, is_next_command=false) at /data/src/10.4-bug/sql/sql_parse.cc:7900
|
#36 0x000055fcc4df5735 in wsrep_mysql_parse (thd=0x7f8614000d50, rawbuf=0x7f8614014288 "INSERT /* QNO 21 CON_ID 17 */ INTO t1 (k) VALUES (0)", length=52, parser_state=0x7f86880b0190, is_com_multi=false, is_next_command=false) at /data/src/10.4-bug/sql/sql_parse.cc:7704
|
#37 0x000055fcc4de12fe in dispatch_command (command=COM_QUERY, thd=0x7f8614000d50, packet=0x7f8614008751 "INSERT /* QNO 21 CON_ID 17 */ INTO t1 (k) VALUES (0)", packet_length=52, is_com_multi=false, is_next_command=false) at /data/src/10.4-bug/sql/sql_parse.cc:1827
|
#38 0x000055fcc4ddfad3 in do_command (thd=0x7f8614000d50) at /data/src/10.4-bug/sql/sql_parse.cc:1359
|
#39 0x000055fcc4f66a9c in do_handle_one_connection (connect=0x55fcc8823e90) at /data/src/10.4-bug/sql/sql_connect.cc:1412
|
#40 0x000055fcc4f667eb in handle_one_connection (arg=0x55fcc8823e90) at /data/src/10.4-bug/sql/sql_connect.cc:1316
|
#41 0x00007f86cf720fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
|
#42 0x00007f86cef6f4cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
All threads' stack traces are attached.
injection
|
index 39035dc545e..c0d53381be0 100644
|
--- a/storage/innobase/trx/trx0purge.cc
|
+++ b/storage/innobase/trx/trx0purge.cc
|
@@ -277,6 +277,7 @@ trx_purge_add_undo_to_history(const trx_t* trx, trx_undo_t*& undo, mtr_t* mtr)
|
|
#ifdef WITH_WSREP
|
if (wsrep_is_wsrep_xid(trx->xid)) {
|
+ DBUG_EXECUTE_IF("sleep_before_update_checkpoint",my_sleep(100000););
|
trx_rseg_update_wsrep_checkpoint(rseg_header, trx->xid, mtr);
|
}
|
#endif
|
To reproduce:
- apply the debug injection above and build with -DCMAKE_BUILD_TYPE=Debug;
- Run the RQG test (put real paths in the command line instead of placeholders):
git clone https://github.com/MariaDB/randgen --branch mdev22216 rqg-mdev22216
|
cd rqg-mdev22216
|
. ./mdev22216.cmd --basedir=<basedir> --vardir=<vardir on the slowest disk that you have> --mysqld=--wsrep-provider=<location of Galera-4 library>
|
The grammar is already in the RQG branch and in command-line parameters. For the record, the contents of the grammar:
thread1_init:
|
CREATE DATABASE IF NOT EXISTS db
|
; CREATE TABLE IF NOT EXISTS t1 (
|
id INT NOT NULL auto_increment,
|
k INT,
|
PRIMARY KEY (id)
|
) ENGINE=InnoDB
|
; SET debug_dbug= '+d,sleep_before_update_checkpoint'
|
;
|
|
thread1:
|
INSERT INTO t1 (k) VALUES (0);
|
|
thread2:
|
CREATE TABLE db.t SELECT id FROM t1 LIMIT 0
|
; DROP TABLE IF EXISTS db.t
|
;
|
|
thread3:
|
CREATE DATABASE IF NOT EXISTS db
|
; DROP TABLE IF EXISTS x
|
;
|
Reproducible on at least 10.4 and 10.5. I don't have information about earlier versions or about the effect on non-debug builds.
rr-packed profile created on Debian 10 Buster: ftp://ftp.askmonty.org/public/rr-mdev22216-debian10-x86_64.tar.gz
Transition |
Time In Source Status |
Execution Times |
Open |
|
In Progress |
|
278d 15h 38m
|
1
|
In Progress |
|
Closed |
|
24m 56s
|
1
|
{"report":{"fcp":850.3999998569489,"ttfb":165.39999985694885,"pageVisibility":"visible","entityId":85340,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":1,"journeyId":"6cb51168-728e-4509-b81b-709c30576fa3","navigationType":0,"readyForUser":941.2000000476837,"redirectCount":0,"resourceLoadedEnd":933.8999998569489,"resourceLoadedStart":170.59999990463257,"resourceTiming":[{"duration":6.700000047683716,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":170.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":170.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":177.29999995231628,"responseStart":0,"secureConnectionStart":0},{"duration":6.700000047683716,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":170.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":170.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":177.5,"responseStart":0,"secureConnectionStart":0},{"duration":62.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/b09d0d077992e4331b5f9ec0d3ec448c-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":171,"connectEnd":171,"connectStart":171,"domainLookupEnd":171,"domainLookupStart":171,"fetchStart":171,"redirectEnd":0,"redirectStart":0,"requestStart":171,"responseEnd":233.09999990463257,"responseStart":233.09999990463257,"secureConnectionStart":171},{"duration":316.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/b47ab3df14096803b180217eb8482517-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":171.09999990463257,"connectEnd":171.09999990463257,"connectStart":171.09999990463257,"domainLookupEnd":171.09999990463257,"domainLookupStart":171.09999990463257,"fetchStart":171.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":171.09999990463257,"responseEnd":488,"responseStart":488,"secureConnectionStart":171.09999990463257},{"duration":320,"initiatorType":"script","name":"https://jira.mariadb.org/s/6c569cbf8087ab04e40d0bef98627457-CDN/lu2bsh/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":171.20000004768372,"connectEnd":171.20000004768372,"connectStart":171.20000004768372,"domainLookupEnd":171.20000004768372,"domainLookupStart":171.20000004768372,"fetchStart":171.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":171.20000004768372,"responseEnd":491.2000000476837,"responseStart":491.2000000476837,"secureConnectionStart":171.20000004768372},{"duration":320.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":171.20000004768372,"connectEnd":171.20000004768372,"connectStart":171.20000004768372,"domainLookupEnd":171.20000004768372,"domainLookupStart":171.20000004768372,"fetchStart":171.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":171.20000004768372,"responseEnd":491.7000000476837,"responseStart":491.7000000476837,"secureConnectionStart":171.20000004768372},{"duration":320.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":171.39999985694885,"connectEnd":171.39999985694885,"connectStart":171.39999985694885,"domainLookupEnd":171.39999985694885,"domainLookupStart":171.39999985694885,"fetchStart":171.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":171.39999985694885,"responseEnd":492.09999990463257,"responseStart":492.09999990463257,"secureConnectionStart":171.39999985694885},{"duration":321,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bsh/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":171.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":171.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":492.5,"responseStart":0,"secureConnectionStart":0},{"duration":320.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":171.59999990463257,"connectEnd":171.59999990463257,"connectStart":171.59999990463257,"domainLookupEnd":171.59999990463257,"domainLookupStart":171.59999990463257,"fetchStart":171.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":171.59999990463257,"responseEnd":492.5,"responseStart":492.5,"secureConnectionStart":171.59999990463257},{"duration":321.2999999523163,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bsh/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":171.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":171.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":493,"responseStart":0,"secureConnectionStart":0},{"duration":321.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/81b5d7c27af3ebc078cc4a36383678ba-CDN/lu2bsh/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":171.79999995231628,"connectEnd":171.79999995231628,"connectStart":171.79999995231628,"domainLookupEnd":171.79999995231628,"domainLookupStart":171.79999995231628,"fetchStart":171.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":171.79999995231628,"responseEnd":493.09999990463257,"responseStart":493.09999990463257,"secureConnectionStart":171.79999995231628},{"duration":518.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":177,"connectEnd":177,"connectStart":177,"domainLookupEnd":177,"domainLookupStart":177,"fetchStart":177,"redirectEnd":0,"redirectStart":0,"requestStart":177,"responseEnd":695.5,"responseStart":695.5,"secureConnectionStart":177},{"duration":648.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":177.09999990463257,"connectEnd":177.09999990463257,"connectStart":177.09999990463257,"domainLookupEnd":177.09999990463257,"domainLookupStart":177.09999990463257,"fetchStart":177.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":177.09999990463257,"responseEnd":825.2999999523163,"responseStart":825.2999999523163,"secureConnectionStart":177.09999990463257},{"duration":318,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":377.09999990463257,"connectEnd":377.09999990463257,"connectStart":377.09999990463257,"domainLookupEnd":377.09999990463257,"domainLookupStart":377.09999990463257,"fetchStart":377.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":377.09999990463257,"responseEnd":695.0999999046326,"responseStart":695.0999999046326,"secureConnectionStart":377.09999990463257},{"duration":76.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bsh/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":749.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":749.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":825.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":179.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":750,"connectEnd":750,"connectStart":750,"domainLookupEnd":750,"domainLookupStart":750,"fetchStart":750,"redirectEnd":0,"redirectStart":0,"requestStart":750,"responseEnd":929.7000000476837,"responseStart":929.7000000476837,"secureConnectionStart":750},{"duration":183.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/a000436f14ae82363031988faf35ddba-CDN/lu2bsh/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":750.3999998569489,"connectEnd":750.3999998569489,"connectStart":750.3999998569489,"domainLookupEnd":750.3999998569489,"domainLookupStart":750.3999998569489,"fetchStart":750.3999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":750.3999998569489,"responseEnd":933.8999998569489,"responseStart":933.8999998569489,"secureConnectionStart":750.3999998569489},{"duration":91.39999985694885,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":843.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":843.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":934.5999999046326,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":22,"responseStart":166,"responseEnd":171,"domLoading":169,"domInteractive":1015,"domContentLoadedEventStart":1015,"domContentLoadedEventEnd":1064,"domComplete":1243,"loadEventStart":1243,"loadEventEnd":1244,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":986.2999999523163},{"name":"bigPipe.sidebar-id.end","time":987},{"name":"bigPipe.activity-panel-pipe-id.start","time":987.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":988.0999999046326},{"name":"activityTabFullyLoaded","time":1081.7000000476837}],"measures":[],"correlationId":"6885a963b9a024","effectiveType":"4g","downlink":9.6,"rtt":0,"serverDuration":83,"dbReadsTimeInMs":18,"dbConnsTimeInMs":25,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}