Assertion `!"secondary index is out of sync"' failed in dict_index_t::vers_history_row
--source include/have_innodb.inc
|
|
CREATE TABLE t1 (a INT, b INT AS (a*2) VIRTUAL, KEY(a)) ENGINE=InnoDB WITH SYSTEM VERSIONING;
|
SET FOREIGN_KEY_CHECKS = OFF;
|
INSERT IGNORE INTO t1 (a) VALUES (1),(2),(3),(4);
|
ALTER TABLE t1 ADD FOREIGN KEY (b) REFERENCES t1 (a), ALGORITHM=COPY;
|
UPDATE t1 SET a = NULL ORDER BY a LIMIT 2;
|
DELETE FROM t1 ORDER BY a, b LIMIT 2;
|
SET FOREIGN_KEY_CHECKS = ON;
|
DELETE HISTORY FROM t1;
|
DELETE FROM t1;
|
|
# Cleanup
|
DROP TABLE t1;
|
10.3 ade89fc8
|
mysqld: /data/src/10.3/storage/innobase/dict/dict0mem.cc:1504: bool dict_index_t::vers_history_row(const rec_t*, bool&): Assertion `!"secondary index is out of sync"' failed.
|
200122 18:58:46 [ERROR] mysqld got signal 6 ;
|
|
#6 0x00007fccad32de67 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x55fa615f39a0 "!\"secondary index is out of sync\"", file=file@entry=0x55fa615f2fb8 "/data/src/10.3/storage/innobase/dict/dict0mem.cc", line=line@entry=1504, function=function@entry=0x55fa615f4ea0 <dict_index_t::vers_history_row(unsigned char const*, bool&)::__PRETTY_FUNCTION__> "bool dict_index_t::vers_history_row(const rec_t*, bool&)") at assert.c:92
|
#7 0x00007fccad32df12 in __GI___assert_fail (assertion=0x55fa615f39a0 "!\"secondary index is out of sync\"", file=0x55fa615f2fb8 "/data/src/10.3/storage/innobase/dict/dict0mem.cc", line=1504, function=0x55fa615f4ea0 <dict_index_t::vers_history_row(unsigned char const*, bool&)::__PRETTY_FUNCTION__> "bool dict_index_t::vers_history_row(const rec_t*, bool&)") at assert.c:101
|
#8 0x000055fa60f8303f in dict_index_t::vers_history_row (this=0x7fcc5c094418, rec=0x7fcca2e9808e "\200", history_row=@0x7fcca269faea: false) at /data/src/10.3/storage/innobase/dict/dict0mem.cc:1504
|
#9 0x000055fa60d6224a in row_ins_check_foreign_constraint (check_ref=0, foreign=0x7fcc5c0921b8, table=0x7fcc5c08fa78, entry=0x7fcc5c03f018, thr=0x7fcc5c074ba0) at /data/src/10.3/storage/innobase/row/row0ins.cc:1776
|
#10 0x000055fa60df533c in row_upd_check_references_constraints (node=0x7fcc5c074838, pcur=0x7fcca26a0580, table=0x7fcc5c08fa78, index=0x7fcc5c093aa8, offsets=0x7fcc5c03ebf0, thr=0x7fcc5c074ba0, mtr=0x7fcca26a0c80) at /data/src/10.3/storage/innobase/row/row0upd.cc:295
|
#11 0x000055fa60dfb434 in row_upd_sec_index_entry (node=0x7fcc5c074838, thr=0x7fcc5c074ba0) at /data/src/10.3/storage/innobase/row/row0upd.cc:2517
|
#12 0x000055fa60dfb7a3 in row_upd_sec_step (node=0x7fcc5c074838, thr=0x7fcc5c074ba0) at /data/src/10.3/storage/innobase/row/row0upd.cc:2566
|
#13 0x000055fa60dfe565 in row_upd (node=0x7fcc5c074838, thr=0x7fcc5c074ba0) at /data/src/10.3/storage/innobase/row/row0upd.cc:3336
|
#14 0x000055fa60dfe9b2 in row_upd_step (thr=0x7fcc5c074ba0) at /data/src/10.3/storage/innobase/row/row0upd.cc:3451
|
#15 0x000055fa60d8fbb7 in row_update_for_mysql (prebuilt=0x7fcc5c074018) at /data/src/10.3/storage/innobase/row/row0mysql.cc:1888
|
#16 0x000055fa60bf8d2b in ha_innobase::update_row (this=0x7fcc5c0724e8, old_row=0x7fcc5c0720a8 "\371\004", new_row=0x7fcc5c072090 "\371\004") at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:8838
|
#17 0x000055fa609d7cd8 in handler::ha_update_row (this=0x7fcc5c0724e8, old_data=0x7fcc5c0720a8 "\371\004", new_data=0x7fcc5c072090 "\371\004") at /data/src/10.3/sql/handler.cc:6479
|
#18 0x000055fa60b7ec95 in TABLE::delete_row (this=0x7fcc5c0a4da0) at /data/src/10.3/sql/sql_delete.cc:249
|
#19 0x000055fa60b7bd59 in mysql_delete (thd=0x7fcc5c000af0, table_list=0x7fcc5c0128e0, conds=0x7fcc5c013bc0, order_list=0x7fcc5c0053b8, limit=18446744073709551614, options=0, result=0x0) at /data/src/10.3/sql/sql_delete.cc:720
|
#20 0x000055fa606b1066 in mysql_execute_command (thd=0x7fcc5c000af0) at /data/src/10.3/sql/sql_parse.cc:4658
|
#21 0x000055fa606bbb91 in mysql_parse (thd=0x7fcc5c000af0, rawbuf=0x7fcc5c012818 "DELETE FROM t1", length=14, parser_state=0x7fcca26a25e0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7818
|
#22 0x000055fa606a8705 in dispatch_command (command=COM_QUERY, thd=0x7fcc5c000af0, packet=0x7fcc5c165951 "DELETE FROM t1", packet_length=14, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1856
|
#23 0x000055fa606a704d in do_command (thd=0x7fcc5c000af0) at /data/src/10.3/sql/sql_parse.cc:1401
|
#24 0x000055fa6081e9bc in do_handle_one_connection (connect=0x55fa63546850) at /data/src/10.3/sql/sql_connect.cc:1403
|
#25 0x000055fa6081e71e in handle_one_connection (arg=0x55fa63546850) at /data/src/10.3/sql/sql_connect.cc:1308
|
#26 0x000055fa611cf6ee in pfs_spawn_thread (arg=0x55fa634eacb0) at /data/src/10.3/storage/perfschema/pfs.cc:1869
|
#27 0x00007fccaf2b64a4 in start_thread (arg=0x7fcca26a3700) at pthread_create.c:456
|
#28 0x00007fccad3ead0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
|
Reproducible with 10.3-10.5.
Non-debug version doesn't crash, but produces an error in the error log:
10.3 ade89fc8 non-debug
|
2020-01-22 19:00:01 9 [ERROR] InnoDB: foreign constraints: secondary index is out of sync
|
{"report":{"fcp":992,"ttfb":329.1000003814697,"pageVisibility":"visible","entityId":82572,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"fde916d4-105f-472c-bde9-6d0e7ba0fae3","navigationType":0,"readyForUser":1132.3999996185303,"redirectCount":0,"resourceLoadedEnd":770.5,"resourceLoadedStart":339.69999980926514,"resourceTiming":[{"duration":42.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":339.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":339.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":381.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":43,"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":340,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":340,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":383,"responseStart":0,"secureConnectionStart":0},{"duration":258.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":340.1000003814697,"connectEnd":340.1000003814697,"connectStart":340.1000003814697,"domainLookupEnd":340.1000003814697,"domainLookupStart":340.1000003814697,"fetchStart":340.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":385.3999996185303,"responseEnd":598.3000001907349,"responseStart":422.5,"secureConnectionStart":340.1000003814697},{"duration":370.80000019073486,"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":340.3999996185303,"connectEnd":340.3999996185303,"connectStart":340.3999996185303,"domainLookupEnd":340.3999996185303,"domainLookupStart":340.3999996185303,"fetchStart":340.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":402.19999980926514,"responseEnd":711.1999998092651,"responseStart":435.19999980926514,"secureConnectionStart":340.3999996185303},{"duration":105,"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":340.5,"connectEnd":340.5,"connectStart":340.5,"domainLookupEnd":340.5,"domainLookupStart":340.5,"fetchStart":340.5,"redirectEnd":0,"redirectStart":0,"requestStart":405.1000003814697,"responseEnd":445.5,"responseStart":437.1000003814697,"secureConnectionStart":340.5},{"duration":105.5,"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":340.69999980926514,"connectEnd":340.69999980926514,"connectStart":340.69999980926514,"domainLookupEnd":340.69999980926514,"domainLookupStart":340.69999980926514,"fetchStart":340.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":405.5,"responseEnd":446.19999980926514,"responseStart":438.30000019073486,"secureConnectionStart":340.69999980926514},{"duration":106.20000076293945,"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":340.8999996185303,"connectEnd":340.8999996185303,"connectStart":340.8999996185303,"domainLookupEnd":340.8999996185303,"domainLookupStart":340.8999996185303,"fetchStart":340.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":405.6000003814697,"responseEnd":447.1000003814697,"responseStart":440.1000003814697,"secureConnectionStart":340.8999996185303},{"duration":60.30000019073486,"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":341.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":341.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":401.5,"responseStart":0,"secureConnectionStart":0},{"duration":116.60000038146973,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":341.3999996185303,"connectEnd":341.3999996185303,"connectStart":341.3999996185303,"domainLookupEnd":341.3999996185303,"domainLookupStart":341.3999996185303,"fetchStart":341.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":409.6000003814697,"responseEnd":458,"responseStart":452.80000019073486,"secureConnectionStart":341.3999996185303},{"duration":60.80000019073486,"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":341.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":341.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":402.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":121.19999980926514,"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":341.69999980926514,"connectEnd":341.69999980926514,"connectStart":341.69999980926514,"domainLookupEnd":341.69999980926514,"domainLookupStart":341.69999980926514,"fetchStart":341.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":409.80000019073486,"responseEnd":462.8999996185303,"responseStart":455,"secureConnectionStart":341.69999980926514},{"duration":409.69999980926514,"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":359.80000019073486,"connectEnd":359.80000019073486,"connectStart":359.80000019073486,"domainLookupEnd":359.80000019073486,"domainLookupStart":359.80000019073486,"fetchStart":359.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":475.5,"responseEnd":769.5,"responseStart":762.1000003814697,"secureConnectionStart":359.80000019073486},{"duration":407.80000019073486,"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":362.69999980926514,"connectEnd":362.69999980926514,"connectStart":362.69999980926514,"domainLookupEnd":362.69999980926514,"domainLookupStart":362.69999980926514,"fetchStart":362.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":544.3000001907349,"responseEnd":770.5,"responseStart":765,"secureConnectionStart":362.69999980926514},{"duration":105.09999942779541,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":733.1000003814697,"connectEnd":733.1000003814697,"connectStart":733.1000003814697,"domainLookupEnd":733.1000003814697,"domainLookupStart":733.1000003814697,"fetchStart":733.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":804.5,"responseEnd":838.1999998092651,"responseStart":836.8999996185303,"secureConnectionStart":733.1000003814697},{"duration":227.39999961853027,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":984.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":984.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1211.8999996185303,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":62,"responseStart":329,"responseEnd":362,"domLoading":338,"domInteractive":1215,"domContentLoadedEventStart":1215,"domContentLoadedEventEnd":1275,"domComplete":1796,"loadEventStart":1796,"loadEventEnd":1797,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1183.6999998092651},{"name":"bigPipe.sidebar-id.end","time":1184.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1184.6000003814697},{"name":"bigPipe.activity-panel-pipe-id.end","time":1187.3999996185303},{"name":"activityTabFullyLoaded","time":1292}],"measures":[],"correlationId":"cc2b6fb6269bf7","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":103,"dbReadsTimeInMs":15,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The assertion mutated a bit in 10.5:
10.5 91e79dff
mariadbd: /data/src/10.5/storage/innobase/dict/dict0mem.cc:1338: bool dict_index_t::vers_history_row(const rec_t*, bool&): Assertion `"secondary index is out of sync" == 0' failed.
200414 21:49:29 [ERROR] mysqld got signal 6 ;
c/10.5/storage/innobase/dict/dict0mem.cc", line=1338, function=0x55d8c8d74b40 <dict_index_t::vers_history_row(unsigned char const*, bool&)::__PRETTY_FUNCTION__> "bool dict_index_t::vers_history_row(const rec_t*, bool&)") at assert.c:101
#8 0x000055d8c7a141bd in dict_index_t::vers_history_row (this=0x6190000e7f20, rec=0x7f669536807e "\200", history_row=@0x7f668ff4e720: false) at /data/src/10.5/storage/innobase/dict/dict0mem.cc:1338
#9 0x000055d8c7637232 in row_ins_check_foreign_constraint (check_ref=1, foreign=0x616000060a20, table=0x6190000e5720, entry=0x61b000070f20, thr=0x6210000f1e98) at /data/src/10.5/storage/innobase/row/row0ins.cc:1746
#10 0x000055d8c76382e9 in row_ins_check_foreign_constraints (table=0x6190000e5720, index=0x6190000e9d20, pk=false, entry=0x61b000070f20, thr=0x6210000f1e98) at /data/src/10.5/storage/innobase/row/row0ins.cc:1992
#11 0x000055d8c763eaa2 in row_ins_sec_index_entry (index=0x6190000e9d20, entry=0x61b000070f20, thr=0x6210000f1e98, check_foreign=true) at /data/src/10.5/storage/innobase/row/row0ins.cc:3254
#12 0x000055d8c763f060 in row_ins_index_entry (index=0x6190000e9d20, entry=0x61b000070f20, thr=0x6210000f1e98) at /data/src/10.5/storage/innobase/row/row0ins.cc:3330
#13 0x000055d8c764014c in row_ins_index_entry_step (node=0x6210000f1bc0, thr=0x6210000f1e98) at /data/src/10.5/storage/innobase/row/row0ins.cc:3497
#14 0x000055d8c7640b61 in row_ins (node=0x6210000f1bc0, thr=0x6210000f1e98) at /data/src/10.5/storage/innobase/row/row0ins.cc:3634
#15 0x000055d8c7641bc0 in row_ins_step (thr=0x6210000f1e98) at /data/src/10.5/storage/innobase/row/row0ins.cc:3773
#16 0x000055d8c768b4ed in row_insert_for_mysql (mysql_rec=0x6190000f1040 "\341", prebuilt=0x6210000f15a0, ins_mode=ROW_INS_NORMAL) at /data/src/10.5/storage/innobase/row/row0mysql.cc:1462
#17 0x000055d8c7309bc3 in ha_innobase::write_row (this=0x61d000265328, record=0x6190000f1040 "\341") at /data/src/10.5/storage/innobase/handler/ha_innodb.cc:7771
#18 0x000055d8c685d899 in handler::ha_write_row (this=0x61d000265328, buf=0x6190000f1040 "\341") at /data/src/10.5/sql/handler.cc:6946
#19 0x000055d8c5fb350f in write_record (thd=0x62b0000bd288, table=0x620000050108, info=0x7f668ff50710, sink=0x0) at /data/src/10.5/sql/sql_insert.cc:2091
#20 0x000055d8c5fab325 in mysql_insert (thd=0x62b0000bd288, table_list=0x62b0000c4408, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=true, result=0x0) at /data/src/10.5/sql/sql_insert.cc:1088
#21 0x000055d8c606e7ab in mysql_execute_command (thd=0x62b0000bd288) at /data/src/10.5/sql/sql_parse.cc:4515
#22 0x000055d8c6087173 in mysql_parse (thd=0x62b0000bd288, rawbuf=0x62b0000c42a8 "INSERT IGNORE INTO table_virtual (field1) VALUES (0),(5)", length=56, parser_state=0x7f668ff51a50, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:7953
#23 0x000055d8c605cf63 in dispatch_command (command=COM_QUERY, thd=0x62b0000bd288, packet=0x6290002bc289 "INSERT IGNORE INTO table_virtual (field1) VALUES (0),(5)", packet_length=56, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1839
#24 0x000055d8c6059998 in do_command (thd=0x62b0000bd288) at /data/src/10.5/sql/sql_parse.cc:1358
#25 0x000055d8c6478eb1 in do_handle_one_connection (connect=0x611000030908, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1422
#26 0x000055d8c647874c in handle_one_connection (arg=0x611000030908) at /data/src/10.5/sql/sql_connect.cc:1319
#27 0x000055d8c7117a06 in pfs_spawn_thread (arg=0x61600000fa08) at /data/src/10.5/storage/perfschema/pfs.cc:2201
#28 0x00007f669f0f0fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#29 0x00007f669e93f4cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95