Bug #41722 | Restore crashes with backup of Falcon tables | ||
---|---|---|---|
Submitted: | 23 Dec 2008 22:02 | Modified: | 26 Apr 2009 0:07 |
Reporter: | Sveta Smirnova | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Backup | Severity: | S3 (Non-critical) |
Version: | 6.0, 6.0-backup | OS: | Linux |
Assigned to: | Ingo Strüwing | CPU Architecture: | Any |
[23 Dec 2008 22:02]
Sveta Smirnova
[23 Dec 2008 22:03]
Sveta Smirnova
Server is accessible during restore.
[11 Feb 2009 10:28]
Sveta Smirnova
Can be related to bug #41716
[6 Mar 2009 15:26]
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/68515 2777 Ingo Struewing 2009-03-06 Bug#41722 - Restore crashes with backup of Falcon tables Partial fix. It defeats the server crash in the reported test case. The main problem is that Falcon sporadically reports "out of record memory". See the bug report for further information. The cause for the crash was incomplete implementation of error handling during restore of table data. Restore::send_data() did not take into account that a reported error will not immediately stop the restore progress, but instead retry to call send_data() for a couple of times. Fixed by setting up status variables so that re-entering send_data() after an error does not take a wrong path. @ mysql-test/suite/backup/r/backup_default_debug.result Bug#41722 - Restore crashes with backup of Falcon tables New test result. @ mysql-test/suite/backup/t/backup_default_debug.test Bug#41722 - Restore crashes with backup of Falcon tables New test case. @ sql/backup/be_default.cc Bug#41722 - Restore crashes with backup of Falcon tables Added error injection to fake a deterministic write error. Report engine write errors as warnings to the error log. Reset 'mode' and 'cur_blob' so that re-entering send_data() does not take a wrong code path.
[6 Mar 2009 15:39]
Ingo Strüwing
The above patch is just a partial fix for the problem. It defeats the crash in the RESTORE code. But the real problem is that Falcon returns "out of record memory" errors to the RESTORE code sporadically. Thus RESTORE fails sporadically with "Error when sending data (for table #1) to Snapshot restore driver". See below for a test case that catches the problem more often than not. But it still succeeds somtimes. By changing the server variable or command line option "falcon_record_memory_max", it is possible to provoke the problem with higher probability and earlier in the test case. To my big surprise, it didn't matter if I doubled the default value of 250m or if I halved it. I tried to guess that it might be possible that Falcon has kind of a garbage collector. So I inserted sleeps of 9 seconds between each of five attempts to call ha_write_row(), after the first error appeared. It didn't change anything. So I think, this bug should be reassigned to the Falcon team, after the partial patch is accepted and pushed. Here is my test case (it runs quite some time, say 1h): ====================================================================== SET GLOBAL falcon_record_memory_max= 262144000; SELECT @@falcon_record_memory_max; CREATE DATABASE mysql_db1; CREATE TABLE mysql_db1.t01 (f1 TEXT) ENGINE=Falcon; INSERT INTO mysql_db1.t01 VALUES('fdafdsfdsfdsfdsfdsfd'); # --let $count= 17 while ($count) { INSERT INTO mysql_db1.t01 SELECT * FROM mysql_db1.t01; --dec $count } SELECT COUNT(*) FROM mysql_db1.t01; # --let $count= 19 while ($count) { eval CREATE TABLE mysql_db1.t$count ENGINE=Falcon SELECT * FROM mysql_db1.t01; --dec $count } # --replace_column 1 # BACKUP DATABASE mysql_db1 TO 'mysqltest.bak'; # DROP DATABASE mysql_db1; # --replace_column 1 # RESTORE FROM 'mysqltest.bak'; # DROP DATABASE mysql_db1; --replace_column 1 # RESTORE FROM 'mysqltest.bak'; DROP DATABASE mysql_db1; --replace_column 1 # RESTORE FROM 'mysqltest.bak'; DROP DATABASE mysql_db1; --replace_column 1 # RESTORE FROM 'mysqltest.bak'; DROP DATABASE mysql_db1; --replace_column 1 # RESTORE FROM 'mysqltest.bak'; DROP DATABASE mysql_db1; --replace_column 1 # RESTORE FROM 'mysqltest.bak'; DROP DATABASE mysql_db1; --replace_column 1 # RESTORE FROM 'mysqltest.bak'; DROP DATABASE mysql_db1; --replace_column 1 # RESTORE FROM 'mysqltest.bak'; DROP DATABASE mysql_db1; --replace_column 1 # RESTORE FROM 'mysqltest.bak'; DROP DATABASE mysql_db1; --replace_column 1 # RESTORE FROM 'mysqltest.bak'; DROP DATABASE mysql_db1; --replace_column 1 # RESTORE FROM 'mysqltest.bak'; DROP DATABASE mysql_db1; --replace_column 1 # RESTORE FROM 'mysqltest.bak'; DROP DATABASE mysql_db1; --replace_column 1 # RESTORE FROM 'mysqltest.bak'; DROP DATABASE mysql_db1; --replace_column 1 # RESTORE FROM 'mysqltest.bak'; DROP DATABASE mysql_db1; --replace_column 1 # RESTORE FROM 'mysqltest.bak'; DROP DATABASE mysql_db1; --replace_column 1 # RESTORE FROM 'mysqltest.bak'; # query_vertical SHOW CREATE TABLE mysql_db1.t01; query_vertical SHOW CREATE TABLE mysql_db1.t10; # DROP DATABASE mysql_db1;
[11 Mar 2009 10:39]
Rafal Somla
Proposed alternative solution and asked Ingo for opinion.
[25 Mar 2009 13:22]
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/70353 2803 Ingo Struewing 2009-03-25 Bug#41722 - Restore crashes with backup of Falcon tables During RESTORE of a not so small Falcon table, the server crashed. The cause for the crash was an attempt to retry to send table data to the restore driver after an error from the restore driver. Restore::send_data() does not expect to be called again with table data after returning an error. Fixed by aborting RESTORE, if a driver returns an error. @ mysql-test/suite/backup/r/backup_default_debug.result Bug#41722 - Restore crashes with backup of Falcon tables New test result. @ mysql-test/suite/backup/t/backup_default_debug.test Bug#41722 - Restore crashes with backup of Falcon tables New test case. @ sql/backup/backup_engine.h Bug#41722 - Restore crashes with backup of Falcon tables Updated comments. @ sql/backup/be_default.cc Bug#41722 - Restore crashes with backup of Falcon tables Added error injection to fake a storage engine write error. @ sql/backup/data_backup.cc Bug#41722 - Restore crashes with backup of Falcon tables Dropped repetition on errors during restore of table data.
[26 Mar 2009 11:32]
Rafal Somla
Good to push.
[30 Mar 2009 13:10]
Chuck Bell
Approved.
[30 Mar 2009 16:49]
Ingo Strüwing
Queued to mysql-6.0-backup.
[23 Apr 2009 7:18]
Bugs System
Pushed into 6.0.11-alpha (revid:alik@sun.com-20090423070920-e5lq3vrrqi016z2c) (version source revid:alik@sun.com-20090423070920-e5lq3vrrqi016z2c) (merge vers: 6.0.11-alpha) (pib:6)
[26 Apr 2009 0:07]
Paul DuBois
Noted in 6.0.11 changelog. RESTORE crashed for Falcon tables.