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
{"report":{"fcp":754.2999999523163,"ttfb":159,"pageVisibility":"visible","entityId":85340,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"e2a3cb79-61ab-4e27-9e02-980004ecea49","navigationType":0,"readyForUser":831.5999999046326,"redirectCount":0,"resourceLoadedEnd":934.5999999046326,"resourceLoadedStart":164.20000004768372,"resourceTiming":[{"duration":117.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":164.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":164.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":281.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":116.79999995231628,"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":164.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":164.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":281.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":126.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":164.59999990463257,"connectEnd":164.59999990463257,"connectStart":164.59999990463257,"domainLookupEnd":164.59999990463257,"domainLookupStart":164.59999990463257,"fetchStart":164.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":164.59999990463257,"responseEnd":290.7000000476837,"responseStart":290.7000000476837,"secureConnectionStart":164.59999990463257},{"duration":190.69999980926514,"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":164.70000004768372,"connectEnd":164.70000004768372,"connectStart":164.70000004768372,"domainLookupEnd":164.70000004768372,"domainLookupStart":164.70000004768372,"fetchStart":164.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":164.70000004768372,"responseEnd":355.39999985694885,"responseStart":355.39999985694885,"secureConnectionStart":164.70000004768372},{"duration":194.09999990463257,"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":164.79999995231628,"connectEnd":164.79999995231628,"connectStart":164.79999995231628,"domainLookupEnd":164.79999995231628,"domainLookupStart":164.79999995231628,"fetchStart":164.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":164.79999995231628,"responseEnd":358.89999985694885,"responseStart":358.89999985694885,"secureConnectionStart":164.79999995231628},{"duration":194.40000009536743,"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":164.89999985694885,"connectEnd":164.89999985694885,"connectStart":164.89999985694885,"domainLookupEnd":164.89999985694885,"domainLookupStart":164.89999985694885,"fetchStart":164.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":164.89999985694885,"responseEnd":359.2999999523163,"responseStart":359.2999999523163,"secureConnectionStart":164.89999985694885},{"duration":194.59999990463257,"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":165,"connectEnd":165,"connectStart":165,"domainLookupEnd":165,"domainLookupStart":165,"fetchStart":165,"redirectEnd":0,"redirectStart":0,"requestStart":165,"responseEnd":359.59999990463257,"responseStart":359.59999990463257,"secureConnectionStart":165},{"duration":195.10000014305115,"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":165.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":165.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":360.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":194.89999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":165.20000004768372,"connectEnd":165.20000004768372,"connectStart":165.20000004768372,"domainLookupEnd":165.20000004768372,"domainLookupStart":165.20000004768372,"fetchStart":165.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":165.20000004768372,"responseEnd":360.09999990463257,"responseStart":360.09999990463257,"secureConnectionStart":165.20000004768372},{"duration":195.29999995231628,"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":165.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":165.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":360.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":195.30000019073486,"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":165.39999985694885,"connectEnd":165.39999985694885,"connectStart":165.39999985694885,"domainLookupEnd":165.39999985694885,"domainLookupStart":165.39999985694885,"fetchStart":165.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":165.39999985694885,"responseEnd":360.7000000476837,"responseStart":360.7000000476837,"secureConnectionStart":165.39999985694885},{"duration":352.19999980926514,"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":170.70000004768372,"connectEnd":170.70000004768372,"connectStart":170.70000004768372,"domainLookupEnd":170.70000004768372,"domainLookupStart":170.70000004768372,"fetchStart":170.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":170.70000004768372,"responseEnd":522.8999998569489,"responseStart":522.8999998569489,"secureConnectionStart":170.70000004768372},{"duration":763.7999999523163,"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":170.79999995231628,"connectEnd":170.79999995231628,"connectStart":170.79999995231628,"domainLookupEnd":170.79999995231628,"domainLookupStart":170.79999995231628,"fetchStart":170.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":170.79999995231628,"responseEnd":934.5999999046326,"responseStart":934.5999999046326,"secureConnectionStart":170.79999995231628},{"duration":380.7000000476837,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":503.89999985694885,"connectEnd":503.89999985694885,"connectStart":503.89999985694885,"domainLookupEnd":503.89999985694885,"domainLookupStart":503.89999985694885,"fetchStart":503.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":503.89999985694885,"responseEnd":884.5999999046326,"responseStart":884.5999999046326,"secureConnectionStart":503.89999985694885}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":16,"responseStart":159,"responseEnd":167,"domLoading":162,"domInteractive":954,"domContentLoadedEventStart":954,"domContentLoadedEventEnd":992,"domComplete":1672,"loadEventStart":1672,"loadEventEnd":1674,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":936.5999999046326},{"name":"bigPipe.sidebar-id.end","time":937.3999998569489},{"name":"bigPipe.activity-panel-pipe-id.start","time":937.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":939.8999998569489},{"name":"activityTabFullyLoaded","time":998.8999998569489}],"measures":[],"correlationId":"e6f8a7eff6a91d","effectiveType":"4g","downlink":9,"rtt":0,"serverDuration":82,"dbReadsTimeInMs":17,"dbConnsTimeInMs":27,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}