[MDEV-31043] ER_KEY_NOT_FOUND upon concurrent ALTER and transaction Created: 2023-04-12  Updated: 2023-08-16  Resolved: 2023-08-16

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table
Affects Version/s: N/A
Fix Version/s: 11.2.1

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Nikita Malyavin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-16329 Engine-independent online ALTER TABLE Closed
Relates
relates to MDEV-28808 Test MDEV-16329 (ALTER ONLINE TABLE) ... Stalled

 Description   

--source include/have_debug_sync.inc
 
CREATE TABLE t (a int, b int) ENGINE=MyISAM;
INSERT INTO t VALUES (1,10),(2,20);
SET debug_sync= 'alter_table_online_progress WAIT_FOR goforit';
--send
  ALTER TABLE t ADD c INT, ALGORITHM=COPY, LOCK=NONE;
 
--connect (con1,localhost,root,,)
 
UPDATE t SET b = 100;
START TRANSACTION;
UPDATE t SET b = 200;
 
--connect (con2,localhost,root,,)
DELETE FROM t ORDER BY a LIMIT 1;
DELETE FROM t ORDER BY a LIMIT 1;
 
--connection con1
COMMIT;
SET debug_sync= 'now SIGNAL goforit';
 
--connection default
--reap
 
# Cleanup
DROP TABLE t;
--disconnect con2
--disconnect con1

bb-11.0-oalter 90cf6464fae

mysqltest: At line 24: query 'reap' failed: ER_KEY_NOT_FOUND (1032): Can't find record in 't'

error log

2023-04-13  1:51:44 4 [ERROR] mariadbd: Can't find record in 't'
2023-04-13  1:51:44 4 [ERROR] Slave SQL: Could not execute Delete_rows_v1 event on table test.t; Can't find record in 't', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log FIRST, end_log_pos 112, Internal MariaDB error code: 1032

Reproducible with at least MyISAM and Aria. The test case is not directly applicable to InnoDB, it hits innodb_lock_wait_timeout instead. I didn't try to modify it for InnoDB.



 Comments   
Comment by Sergei Golubchik [ 2023-05-24 ]

485bcdf7732 is ok to push

Generated at Thu Feb 08 10:20:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.