Bug #16495 DD: Drop of TPC-B Database fails. (Error data: Dbdict.cpp)
Submitted: 13 Jan 2006 20:43 Modified: 28 Jan 2006 14:02
Reporter: Jonathan Miller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S1 (Critical)
Version:5.1.6-alpha OS:Linux (Linux)
Assigned to: Jonas Oreland CPU Architecture:Any

[13 Jan 2006 20:43] Jonathan Miller
Description:
After running TPC-B test I was rebuilding to make the database memory only tables. The drop fails and on data node dies.

mysql> DROP DATABASE TPCB;
Query OK, 3 rows affected, 1 warnings (0.65 sec)
mysql> show warnings;
+-------+------+---------------------------------+
| Level | Code | Message                         |
+-------+------+---------------------------------+
| Error | 1296 | Got error 0 'No error' from NDB |
+-------+------+---------------------------------+

mysql> show tables;
+----------------+
| Tables_in_TPCB |
+----------------+
| account        |
| history        |
| trans          |
+----------------+
3 rows in set (0.00 sec)

mysql> select count(*) from account;
+----------+
| count(*) |
+----------+
|   100000 |
+----------+
1 row in set (0.01 sec)

mysql> DROP TABLE account;
Query OK, 0 rows affected, 1 warning (0.11 sec)

mysql> DROP TABLE trans;
Query OK, 0 rows affected, 1 warning (0.11 sec)

mysql> DROP TABLE history;
Query OK, 0 rows affected, 1 warning (0.10 sec)

mysql> show warnings;
+-------+------+---------------------------------+
| Level | Code | Message                         |
+-------+------+---------------------------------+
| Error | 1296 | Got error 0 'No error' from NDB |
+-------+------+---------------------------------+
1 row in set (0.00 sec)
mysql> show tables;
+----------------+
| Tables_in_TPCB |
+----------------+
| account        |
| history        |
| trans          |
+----------------+
3 rows in set (0.00 sec)

NDB ERROR:

Time: Friday 13 January 2006 - 21:30:14
Status: Temporary error, restart node
Message: Internal program error (failed ndbrequire) (Internal error, programming error or missing error message, please report a bug)
Error: 2341
Error data: Dbdict.cpp
Error object: DBDICT (Line: 5721) 0x0000000a
Program: /home/ndbdev/jmiller/builds/libexec/ndbd
Pid: 3948
Trace: /space/run/ndb_7_trace.log.2
Version: Version 5.1.6 (alpha)
***EOM***
--------------- Signal ----------------
r.bn: 250 "DBDICT", r.proc: 7, r.sigId: 936819311 gsn: 202 "DROP_TAB_REQ" prio: 1
s.bn: 250 "DBDICT", s.proc: 7, s.sigId: 936819310 length: 4 trace: 0 #sec: 0 fragInf: 0
 senderRef: fa0007 senderData: 49 TableId: 11 requestType: 0
--------------- Signal ----------------
r.bn: 250 "DBDICT", r.proc: 7, r.sigId: 936819310 gsn: 201 "PREP_DROP_TAB_CONF" prio: 1
s.bn: 246 "DBDIH", s.proc: 6, s.sigId: -1 length: 3 trace: 0 #sec: 0 fragInf: 0
 senderRef: f60006 senderData: 49 TableId: 11
--------------- Signal ----------------
r.bn: 250 "DBDICT", r.proc: 7, r.sigId: 936819309 gsn: 201 "PREP_DROP_TAB_CONF" prio: 1
s.bn: 246 "DBDIH", s.proc: 4, s.sigId: -1 length: 3 trace: 0 #sec: 0 fragInf: 0
 senderRef: f60004 senderData: 49 TableId: 11
--------------- Signal ----------------

--------------- Signal ----------------
r.bn: 250 "DBDICT", r.proc: 7, r.sigId: 936819308 gsn: 201 "PREP_DROP_TAB_CONF" prio: 1
s.bn: 246 "DBDIH", s.proc: 5, s.sigId: -1 length: 3 trace: 0 #sec: 0 fragInf: 0
 senderRef: f60005 senderData: 49 TableId: 11
--------------- Signal ----------------
r.bn: 250 "DBDICT", r.proc: 7, r.sigId: 936819307 gsn: 201 "PREP_DROP_TAB_CONF" prio: 1
s.bn: 246 "DBDIH", s.proc: 7, s.sigId: 936819306 length: 3 trace: 0 #sec: 0 fragInf: 0
 senderRef: f60007 senderData: 49 TableId: 11
--------------- Signal ----------------
r.bn: 246 "DBDIH", r.proc: 7, r.sigId: 936819306 gsn: 216 "WAIT_DROP_TAB_CONF" prio: 1
s.bn: 247 "DBLQH", s.proc: 6, s.sigId: -1 length: 2 trace: 0 #sec: 0 fragInf: 0
 H'0000000b H'00f70006
--------------- Signal ----------------
r.bn: 247 "DBLQH", r.proc: 7, r.sigId: 936819305 gsn: 208 "WAIT_DROP_TAB_REQ" prio: 1
s.bn: 246 "DBDIH", s.proc: 6, s.sigId: -1 length: 2 trace: 0 #sec: 0 fragInf: 0
 H'0000000b H'00f60006
--------------- Signal ----------------

How to repeat:
See above
[27 Jan 2006 14:09] Jonas Oreland
Problem was incorrect ref count was incorrectly set after SR
I.e.
create table T tablespace TS; // will increase ref count on TS
drop table T; // will decrease ref count on TS

If a SR was performed inbetween create/drop a crash would occur on drop
  as ref count on TS was already 0
[27 Jan 2006 14:10] 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/1741
[27 Jan 2006 15:25] Jonas Oreland
pushed into 5.1.6
[28 Jan 2006 14:02] Jonas Oreland
since it's never release no need ro document