Bug #36792 | Assertion table->in_use == current_thd in Field_string::store, line 6259 | ||
---|---|---|---|
Submitted: | 19 May 2008 6:51 | Modified: | 29 Jul 2008 11:41 |
Reporter: | Philip Stoev | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: Backup | Severity: | S1 (Critical) |
Version: | 6.0-bk | OS: | Any |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[19 May 2008 6:51]
Philip Stoev
[19 May 2008 9:43]
Philip Stoev
Test case for bug 36792
Attachment: bug36792.zip (application/x-zip-compressed, text), 1.18 KiB.
[19 May 2008 9:48]
Philip Stoev
To reproduce the bug, please unpack the attached archive so that the .txt files are in mysql-test/ and the .test files are in mysql-test/t and then run: $ perl ./mysql-test-run.pl --stress --stress-init-file=bug36792_init.txt --stress-test-file=bug36792_run.txt --stress-test-duration=120 --stress-threads=2 --skip-ndb --mysqld=--skip-innodb The crash will happen immediately. Partitioning + Falcon is required to reproduce the bug. Innodb and non-partitioned tables are not affected.
[25 Jul 2008 9:13]
Øystein Grøvlen
I suspect that this error is related to attempting to do two backups in parallel. master.err contains the following: 080724 14:22:10 [Note] Backup: Starting backup process 080724 14:22:10 [Note] Backup: Backing up selected databases 080724 14:22:10 [Note] Backup: Starting backup process 080724 14:22:10 [ERROR] Backup: Can't execute this command because another BACKUP/RESTORE operation is in progress 080724 14:22:10 [Note] Backup: Backup completed Probably the thread for the second backup is not terminated in the appropriate way. It seems the assert failure occurs for a later connection. The full list of operation performed by the stress test before failure is: Time Id Command Argument 080724 14:22:09 1 Connect root@localhost on test 1 Query CREATE TABLE inter1 ( t1_autoinc INTEGER NOT NULL AUTO_INCREMENT, t1_uuid CHAR(36), t2_uuid CHAR(36), t1_blob MEDIUMTEXT, PRIMARY KEY (t1_autoinc), KEY (t1_uuid), KEY (t2_uuid) ) ENGINE = Falcon 1 Query ALTER TABLE inter1 PARTITION BY HASH(t1_autoinc) 080724 14:22:10 1 Query SHOW WARNINGS 1 Quit 2 Connect root@localhost on test 2 Query SELECT CONCAT('backup', CONNECTION_ID()) 2 Query BACKUP DATABASE test TO "/home/og136792/mysql/shared/mysql-6.0-backup-clean/mysql-test/var/backup2" 3 Connect root@localhost on test 3 Query SELECT CONCAT('backup', CONNECTION_ID()) 3 Query BACKUP DATABASE test TO "/home/og136792/mysql/shared/mysql-6.0-backup-clean/mysql-test/var/backup3" 3 Query SHOW WARNINGS 3 Quit 080724 14:22:11 4 Connect root@localhost on test 4 Query SET @uuid = CONVERT(UUID() USING latin1) 4 Query INSERT INTO inter1 (t1_uuid) VALUES (@uuid) 4 Query UPDATE inter1 SET t1_blob = 'a' WHERE inter1.t1_uuid = @uuid 4 Query SHOW WARNINGS 4 Quit
[25 Jul 2008 14:54]
Øystein Grøvlen
I have been able to reproduce the bug with the following test script. (Had to fix some other concurrency bugs before I got so far. More on that later.) Note that column types and partitioning seems to be significant in order to reproduce bug. ========================================================================= CREATE DATABASE backup_concurrent; USE backup_concurrent; #Create table. Make it partitioned --echo Creating Table CREATE TABLE inter1 ( t1_autoinc INTEGER NOT NULL AUTO_INCREMENT, t1_uuid CHAR(36), PRIMARY KEY (t1_autoinc) ) ENGINE = Falcon; ALTER TABLE inter1 PARTITION BY HASH(t1_autoinc); --echo Sending First Backup connect(backup1,localhost,root,,); send BACKUP DATABASE backup_concurrent TO 'backup1'; --echo Starting Second Backup, will fail since previous still active connection default; --error ER_BACKUP_RUNNING BACKUP DATABASE backup_concurrent TO 'backup2'; --echo Inserting Data INSERT INTO inter1 (t1_uuid) VALUES (1); --echo Starting third backup BACKUP DATABASE backup_concurrent TO 'backup3';
[28 Jul 2008 8:47]
Øystein Grøvlen
Turns out this has nothing to do with parallel backup commands. I was able to reproduce the assert with two sequential backups as follows: ================================================== CREATE DATABASE backup_concurrent; USE backup_concurrent; #Create table. Make it partitioned --echo Creating Table CREATE TABLE inter1 ( t1_autoinc INTEGER NOT NULL AUTO_INCREMENT, t1_uuid CHAR(36), PRIMARY KEY (t1_autoinc) ) ENGINE = Falcon; ALTER TABLE inter1 PARTITION BY HASH(t1_autoinc); --echo First Backup BACKUP DATABASE backup_concurrent TO 'backup1'; --echo Inserting Data INSERT INTO inter1 (t1_uuid) VALUES (1); --echo Starting second backup BACKUP DATABASE backup_concurrent TO 'backup2';
[29 Jul 2008 11:16]
Øystein Grøvlen
Turns out first backup is not necessary, either. The following test script provokes the assert: CREATE DATABASE backup_concurrent; USE backup_concurrent; #Create table. Make it partitioned --echo Creating Table CREATE TABLE inter1 ( t1_autoinc INTEGER NOT NULL AUTO_INCREMENT, t1_uuid CHAR(36), PRIMARY KEY (t1_autoinc) ) ENGINE = Falcon; ALTER TABLE inter1 PARTITION BY HASH(t1_autoinc); --echo Inserting Data INSERT INTO inter1 (t1_uuid) VALUES (1); --echo Starting Backup BACKUP DATABASE backup_concurrent TO 'backup1';
[29 Jul 2008 11:41]
Øystein Grøvlen
This is a duplicate of Bug#33566
[12 Aug 2008 13:53]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/51418 2681 Jorgen Loland 2008-08-12 Bug#35117 - Backup: Server crash for backup of CSV engine with CHAR data type Bug#33566 - Backup: crash with partitions and Falcon Bug#36792 - Assertion table->in_use == current_thd in Field_string::store, line 6259 Patch applies to all three bugs. Before: With default driver, the table->in_use variable is set to point to the locking thread when a table is locked. The variable points to the wrong thread (i.e., the locking thread) when backup later tries to get the data from the table. Now: Before getting data from a table, the default driver sets the table->in_use pointer to the backup thread.
[13 Aug 2008 6:15]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/51473 2681 Jorgen Loland 2008-08-13 Bug#35117 - Backup: Server crash for backup of CSV engine with CHAR data type Bug# 33566 - Backup: crash with partitions and Falcon Bug# 36792 - Assertion table->in_use == current_thd in Field_string::store, line 6259 Patch attached to 35117 but applies to all three bugs. Before: With default driver, the table->in_use variable is set to point to the locking thread when a table is locked. The variable points to the wrong thread (i.e., the locking thread) when backup later tries to get the data from the table. Now: Before getting data from a table, the default driver sets the table->in_use pointer to the backup thread.
[18 Aug 2008 8:23]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/51822 2675 Jorgen Loland 2008-08-18 Bug#35117 - Backup: Server crash for backup of CSV engine with CHAR data type Bug 33566 - Backup: crash with partitions and Falcon Bug 36792 - Assertion table->in_use == current_thd in Field_string::store, line 6259 Patch attached to 35117 but applies to all three bugs. Before: With default driver, the table->in_use variable is set to point to the locking thread when a table is locked. The variable points to the wrong thread (i.e., the locking thread) when backup later tries to get the data from the table. Now: Before getting data from a table, the default driver sets the table->in_use pointer to the backup thread.