Type:
Bug
Priority:
Blocker
Resolution:
Fixed
Affects Version/s:
N/A
Filing separately from MDEV-26198 because this one seems to be a recent regression.
The test case is non-deterministic, run with --repeat. It currently fails very well for me (usually on the 1st attempt or within a few), but it can vary on different machines and builds. Try to modify --sleep if it doesn't fail.
--source include/have_innodb.inc
--source include/have_sequence.inc
CREATE TABLE t (pk INT PRIMARY KEY , f varchar (1024)) ENGINE=InnoDB;
INSERT INTO t SELECT seq, REPEAT(CHR(seq%26+97),1024) FROM seq_1_to_10000;
--connect (con1,localhost,root,,test)
--send
ALTER TABLE t ADD KEY (f);
--connection default
--sleep 0.2
UPDATE t SET f = 'foo' ;
--connection con1
--reap
# Cleanup
DROP TABLE t;
--disconnect con1
10.6 a42e327a
mariadbd: /data/src/10.6/storage/innobase/row/row0log.cc:3290: const mrec_t* row_log_apply_op(dict_index_t*, row_merge_dup_t*, dberr_t*, mem_heap_t*, mem_heap_t*, bool, const mrec_t*, const mrec_t*, rec_offs*): Assertion `index->lock.have_x() == has_index_lock' failed.
220502 1:59:57 [ERROR] mysqld got signal 6 ;
#7 0x00007f423bf82662 in __GI___assert_fail (assertion=0x5600cba65b58 "index->lock.have_x() == has_index_lock", file=0x5600cba63b28 "/data/src/10.6/storage/innobase/row/row0log.cc", line=3290, function=0x5600cba65d20 "const mrec_t* row_log_apply_op(dict_index_t*, row_merge_dup_t*, dberr_t*, mem_heap_t*, mem_heap_t*, bool, const mrec_t*, const mrec_t*, rec_offs*)") at assert.c:101
#8 0x00005600cb305001 in row_log_apply_op (index=0x7f41dc021388, dup=0x7f42352ca590, error=0x7f42352ca35c, offsets_heap=0x7f41dc53ef78, heap=0x7f41dc070d18, has_index_lock=false, mrec=0x7f42343a6000 "b\003", mrec_end=0x7f42344a6000 'd' <repeats 200 times>..., offsets=0x7f41dc0201c8) at /data/src/10.6/storage/innobase/row/row0log.cc:3290
#9 0x00005600cb307033 in row_log_apply_ops (trx=0x7f42365c4680, index=0x7f41dc021388, dup=0x7f42352ca590, stage=0x7f41dc020158) at /data/src/10.6/storage/innobase/row/row0log.cc:3632
#10 0x00005600cb307766 in row_log_apply (trx=0x7f42365c4680, index=0x7f41dc021388, table=0x7f42352cb2f0, stage=0x7f41dc020158) at /data/src/10.6/storage/innobase/row/row0log.cc:3744
#11 0x00005600cb181dfa in ha_innobase::commit_inplace_alter_table (this=0x7f41d821da70, altered_table=0x7f42352cb2f0, ha_alter_info=0x7f42352cb230, commit=true) at /data/src/10.6/storage/innobase/handler/handler0alter.cc:11036
#12 0x00005600cad23670 in handler::ha_commit_inplace_alter_table (this=0x7f41d821da70, altered_table=0x7f42352cb2f0, ha_alter_info=0x7f42352cb230, commit=true) at /data/src/10.6/sql/handler.cc:5218
#13 0x00005600caa856c2 in mysql_inplace_alter_table (thd=0x7f41dc000db8, table_list=0x7f41dc014238, table=0x7f41d8237f38, altered_table=0x7f42352cb2f0, ha_alter_info=0x7f42352cb230, target_mdl_request=0x7f42352cbb30, ddl_log_state=0x7f42352cb1d0, trigger_param=0x7f42352cb6e0, alter_ctx=0x7f42352cc690) at /data/src/10.6/sql/sql_table.cc:7471
#14 0x00005600caa8e0d0 in mysql_alter_table (thd=0x7f41dc000db8, new_db=0x7f41dc0059b8, new_name=0x7f41dc005dd0, create_info=0x7f42352cd4a0, table_list=0x7f41dc014238, alter_info=0x7f42352cd3b0, order_num=0, order=0x0, ignore=false, if_exists=false) at /data/src/10.6/sql/sql_table.cc:10267
#15 0x00005600cab41c92 in Sql_cmd_alter_table::execute (this=0x7f41dc0149f8, thd=0x7f41dc000db8) at /data/src/10.6/sql/sql_alter.cc:542
#16 0x00005600ca98bd0a in mysql_execute_command (thd=0x7f41dc000db8, is_called_from_prepared_stmt=false) at /data/src/10.6/sql/sql_parse.cc:6012
#17 0x00005600ca991d68 in mysql_parse (thd=0x7f41dc000db8, rawbuf=0x7f41dc014160 "ALTER TABLE t ADD KEY (f)", length=25, parser_state=0x7f42352ce500) at /data/src/10.6/sql/sql_parse.cc:8045
#18 0x00005600ca97e3bb in dispatch_command (command=COM_QUERY, thd=0x7f41dc000db8, packet=0x7f41dc00b879 "", packet_length=25, blocking=true) at /data/src/10.6/sql/sql_parse.cc:1912
#19 0x00005600ca97cce8 in do_command (thd=0x7f41dc000db8, blocking=true) at /data/src/10.6/sql/sql_parse.cc:1409
#20 0x00005600cab36c5c in do_handle_one_connection (connect=0x5600ce6344c8, put_in_cache=true) at /data/src/10.6/sql/sql_connect.cc:1418
#21 0x00005600cab368fb in handle_one_connection (arg=0x5600ce6344c8) at /data/src/10.6/sql/sql_connect.cc:1312
#22 0x00005600cb051182 in pfs_spawn_thread (arg=0x5600ce6345a8) at /data/src/10.6/storage/perfschema/pfs.cc:2201
#23 0x00007f423c44eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#24 0x00007f423c04bdef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
The failure most likely started happening on 10.6 after this commit:
commit 4b80c11f52a3da189bafd7a772bcbf3519ceb41e
Author: Thirunarayanan Balathandayuthapani
Date: Mon Apr 25 13:36:56 2022 +0530
MDEV-15250 UPSERT during ALTER TABLE results in 'Duplicate entry' error for alter
- InnoDB DDL results in `Duplicate entry' if concurrent DML throws
is caused by
MDEV-15250
UPSERT during ALTER-TABLE results in 'Duplicate entry' error for alter
Closed
{"report":{"fcp":685.3000001907349,"ttfb":135.10000014305115,"pageVisibility":"visible","entityId":110464,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"096e1133-f060-4036-9923-8751db53a2b0","navigationType":0,"readyForUser":771.2000000476837,"redirectCount":0,"resourceLoadedEnd":819.8000001907349,"resourceLoadedStart":141,"resourceTiming":[{"duration":7.800000190734863,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":141,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":141,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":148.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":7.700000047683716,"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":141.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":141.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":149.10000014305115,"responseStart":0,"secureConnectionStart":0},{"duration":64.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":141.40000009536743,"connectEnd":141.40000009536743,"connectStart":141.40000009536743,"domainLookupEnd":141.40000009536743,"domainLookupStart":141.40000009536743,"fetchStart":141.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":141.40000009536743,"responseEnd":205.70000004768372,"responseStart":205.70000004768372,"secureConnectionStart":141.40000009536743},{"duration":147,"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":141.5,"connectEnd":141.5,"connectStart":141.5,"domainLookupEnd":141.5,"domainLookupStart":141.5,"fetchStart":141.5,"redirectEnd":0,"redirectStart":0,"requestStart":141.5,"responseEnd":288.5,"responseStart":288.5,"secureConnectionStart":141.5},{"duration":150.29999995231628,"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":141.70000004768372,"connectEnd":141.70000004768372,"connectStart":141.70000004768372,"domainLookupEnd":141.70000004768372,"domainLookupStart":141.70000004768372,"fetchStart":141.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":141.70000004768372,"responseEnd":292,"responseStart":291.90000009536743,"secureConnectionStart":141.70000004768372},{"duration":151.10000014305115,"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":141.70000004768372,"connectEnd":141.70000004768372,"connectStart":141.70000004768372,"domainLookupEnd":141.70000004768372,"domainLookupStart":141.70000004768372,"fetchStart":141.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":141.70000004768372,"responseEnd":292.80000019073486,"responseStart":292.80000019073486,"secureConnectionStart":141.70000004768372},{"duration":151.79999995231628,"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":141.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":141.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":293.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":151.29999995231628,"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":141.90000009536743,"connectEnd":141.90000009536743,"connectStart":141.90000009536743,"domainLookupEnd":141.90000009536743,"domainLookupStart":141.90000009536743,"fetchStart":141.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":141.90000009536743,"responseEnd":293.2000000476837,"responseStart":293.2000000476837,"secureConnectionStart":141.90000009536743},{"duration":151.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":142,"connectEnd":142,"connectStart":142,"domainLookupEnd":142,"domainLookupStart":142,"fetchStart":142,"redirectEnd":0,"redirectStart":0,"requestStart":142,"responseEnd":293.7000000476837,"responseStart":293.7000000476837,"secureConnectionStart":142},{"duration":152.09999990463257,"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":142.10000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":142.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":294.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":152,"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":142.30000019073486,"connectEnd":142.30000019073486,"connectStart":142.30000019073486,"domainLookupEnd":142.30000019073486,"domainLookupStart":142.30000019073486,"fetchStart":142.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":142.30000019073486,"responseEnd":294.30000019073486,"responseStart":294.30000019073486,"secureConnectionStart":142.30000019073486},{"duration":421.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":184.80000019073486,"connectEnd":184.80000019073486,"connectStart":184.80000019073486,"domainLookupEnd":184.80000019073486,"domainLookupStart":184.80000019073486,"fetchStart":184.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":184.80000019073486,"responseEnd":606.3000001907349,"responseStart":606.3000001907349,"secureConnectionStart":184.80000019073486},{"duration":421.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":185.90000009536743,"connectEnd":185.90000009536743,"connectStart":185.90000009536743,"domainLookupEnd":185.90000009536743,"domainLookupStart":185.90000009536743,"fetchStart":185.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":185.90000009536743,"responseEnd":607.4000000953674,"responseStart":607.4000000953674,"secureConnectionStart":185.90000009536743},{"duration":136.40000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":425.90000009536743,"connectEnd":425.90000009536743,"connectStart":425.90000009536743,"domainLookupEnd":425.90000009536743,"domainLookupStart":425.90000009536743,"fetchStart":425.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":425.90000009536743,"responseEnd":562.3000001907349,"responseStart":562.3000001907349,"secureConnectionStart":425.90000009536743},{"duration":185.29999995231628,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/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":631.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":631.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":817.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":184.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/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":632.8000001907349,"connectEnd":632.8000001907349,"connectStart":632.8000001907349,"domainLookupEnd":632.8000001907349,"domainLookupStart":632.8000001907349,"fetchStart":632.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":632.8000001907349,"responseEnd":817.4000000953674,"responseStart":817.4000000953674,"secureConnectionStart":632.8000001907349},{"duration":186.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/f51ef5507eea4c158f257c66c93b2a3f-CDN/lu2bu7/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":633.2000000476837,"connectEnd":633.2000000476837,"connectStart":633.2000000476837,"domainLookupEnd":633.2000000476837,"domainLookupStart":633.2000000476837,"fetchStart":633.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":633.2000000476837,"responseEnd":819.8000001907349,"responseStart":819.8000001907349,"secureConnectionStart":633.2000000476837},{"duration":188.30000019073486,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":669.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":669.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":857.8000001907349,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":7,"responseStart":135,"responseEnd":186,"domLoading":139,"domInteractive":847,"domContentLoadedEventStart":847,"domContentLoadedEventEnd":885,"domComplete":1543,"loadEventStart":1543,"loadEventEnd":1544,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":815.2000000476837},{"name":"bigPipe.sidebar-id.end","time":816},{"name":"bigPipe.activity-panel-pipe-id.start","time":816.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":818.7000000476837},{"name":"activityTabFullyLoaded","time":899.2000000476837}],"measures":[],"correlationId":"53c5a61d88a2f2","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":71,"dbReadsTimeInMs":12,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}