Bug #115511 | Inplace ALTER TABLE might fail with duplicate key error if concurrent insertions | ||
---|---|---|---|
Submitted: | 4 Jul 11:46 | Modified: | 4 Jul 13:12 |
Reporter: | Dmitry Lenev (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[4 Jul 11:46]
Dmitry Lenev
[4 Jul 13:12]
MySQL Verification Team
Hi Mr. Lenev, Thank you very much for your bug report. We have already built a debug version of mysql-8.0.38 (with memory checking included). Hence, we have just introduced the said DEBUG_SYNC_C and ran your test case. We then ran your test case and indeed got: "ERROR 1062 (23000): Duplicate entry 'ccccc' for key 't1.PRIMARY'' error This is now a verified bug for 8.0 and higher supported versions. We thank you very much for your patch contribution. Verified.
[4 Jul 14:16]
MySQL Verification Team
Hi Dmitry, This is the full output from the test run: ------------------------------------------------------------------ ============================================================================== TEST NAME RESULT TIME (ms) COMMENT ------------------------------------------------------------------------------ [ 50%] main.dmitry_115511 [ fail ] Test ended at 2024-07-04 17:14:14 CURRENT_TEST: main.dmitry_115511 mysqltest: At line 20: Query 'reap' failed. ERROR 1062 (23000): Duplicate entry 'ccccc' for key 't1.PRIMARY' safe_process[33185]: Child process: 33186, exit: 1 Mysqltest client output from logfile ----------- MYSQLTEST OUTPUT START ----------- CREATE TABLE t1 (pk CHAR(5) PRIMARY KEY); INSERT INTO t1 VALUES ('aaaaa'), ('bbbbb'), ('ccccc'), ('ddddd'), ('eeeee'); SET DEBUG='+d,ddl_buf_add_two'; SET DEBUG_SYNC='ddl_bulk_inserter_latches_released SIGNAL latches_released WAIT_FOR go'; ALTER TABLE t1 ENGINE=InnoDB, ALGORITHM=INPLACE; SET DEBUG_SYNC='now WAIT_FOR latches_released'; INSERT INTO t1 VALUES ('ccaaa'); SET DEBUG_SYNC='now SIGNAL go'; ------------ MYSQLTEST OUTPUT END ----------- -----------------------------------------------------------------