Bug #35688 Falcon: Crash recovery failure with blob
Submitted: 30 Mar 2008 23:53 Modified: 27 Aug 2008 17:04
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version:6.0.5-alpha-debug OS:Linux (SUSE 10 | 32-bit)
Assigned to: Jim Starkey CPU Architecture:Any

[30 Mar 2008 23:53] Peter Gulutzan
Description:
I create a Falcon table with a BLOB or TEXT column.
I insert two rows.
I crash the system.
I restart the system.
I look at the rows.
One of the rows has lost its original data.

The behaviour is only repeatable if I cause a
crash. "mysqladmin shutdown" causes no problem.
"kill -9" causes no problem.

In order to cause a crash, I used both
Comparison with 0xfffd (Bug#32394), and
Backup Database (Bug#35229).
Since these crash methods are unrelated, I'm
sure that any crash method would cause the loss.
So if Bug#32394 and Bug#35229 are fixed by the
time you read this, just use another crash method.

I have tested this with mysql-6.0 and mysql-6.0-falcon
and mysql-6.0-falcon-team, pulled today.
So I regard the "patch queued" bug#33492 as unrelated.

How to repeat:
create table t (s1 text) engine=falcon;
insert into t values ('b');
insert into t values ('b');
backup database test to '1'; /* crashes */
... /* restart server, restart client */
select * from t; /* gives wrong answer */

OR

create table t (s1 blob) engine=falcon;
insert into t values ('b');
insert into t values ('b');
create table utf32 (s1 varchar(5) character set utf32);
insert into utf32 values (0xfffd);
select * from utf32 where s1 = 0xfffd; /* crashes */
... /* restart server, restart client */
select * from t; /* gives wrong answer */

Example run:

linux:/home/pgulutzan/mysql-6.0-falcon-team # /usr/local/mysql/bin/mysql --user=root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 6.0.5-alpha-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use test
Database changed
mysql> create table t (s1 text) engine=falcon;
Query OK, 0 rows affected (0.08 sec)

mysql> insert into t values ('b');
Query OK, 1 row affected (0.00 sec)

mysql> insert into t values ('b');
Query OK, 1 row affected (0.00 sec)

mysql> backup database test to '1';
ERROR 2013 (HY000): Lost connection to MySQL server during query

mysql> select * from t;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    1
Current database: test

+------+
| s1   |
+------+
| b    |
|      |
+------+
2 rows in set (0.03 sec)
[31 Mar 2008 16:35] Sveta Smirnova
Thank you for the report.

Verified as described. To repeat one need follow steps exactly: bug is not repeatable if I, say, create a MyISAM tabale before issuing a query which crashes server.
[7 Apr 2008 16:36] Jim Starkey
A call to Dbb:reInsertStub was missing from SRLUpdateBlob, used to recover small blobs.
[23 Apr 2008 7:38] Hakan Küçükyılmaz
Fix is in 6.0.5-alpha.
[27 Aug 2008 17:04] Paul DuBois
Noted in 6.0.5 changelog.

Following a server crash, recovery of Falcon tables containing BLOB
or TEXT columns could lose data.