Bug #5702 cluster goes down during an alter table
Submitted: 22 Sep 2004 14:49 Modified: 28 Sep 2004 7:02
Reporter: Tomas Ulin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:4.1.5 source OS:Linux (linux 2.6)
Assigned to: Jonas Oreland CPU Architecture:Any

[22 Sep 2004 14:49] Tomas Ulin
Description:
alter table done through several connections cause cluster to go down

test works fine if run with just one connection

How to repeat:
-- source include/have_ndb.inc

--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
--enable_warnings

#
# Basic test to show that the ALTER TABLE
#  is working
#
CREATE TABLE t2 (
  a INT NOT NULL,
  b INT NOT NULL
) ENGINE=ndbcluster;

INSERT INTO t2 VALUES (9410,9412);
  
#
# More advanced test
#
create table t1 (
col1 int not null primary key,
col2 varchar(30) not null,
col3 varchar (20) not null,
col4 varchar(4) not null,
col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
col6 int not null, to_be_deleted int)  ENGINE=ndbcluster;
show table status;
insert into t1 values
(0,4,3,5,"PENDING",1,7),(1,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (2,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (3,4,3,5,"PENDING",1,7);

create table t3 (
  a int not null primary key,
  b text not null,
  c int not null,
  d longblob,
  key (c)
) engine=ndbcluster;

connect (con1,localhost,,,test);
connect (con2,localhost,,,test);
connect (con3,localhost,,,test);
connect (con4,localhost,,,test);

let $1=12;
while ($1)
{
 dec $1;

connection con1;
alter table t1
add column col4_5 varchar(20) not null after col4,
add column col7 varchar(30) not null after col5,
add column col8 datetime not null,
drop column to_be_deleted;

connection con2;
ALTER TABLE t2 ADD COLUMN c int not null;

connection con3;
alter table t3 add x int;

connection con4;
alter table t1 drop col4_5;
connection con1;
alter table t1 drop col7;
connection con2;
alter table t1 drop col8;
connection con3;
alter table t1 add to_be_deleted int after col6;
connection con4;
alter table t2 drop c;
connection con1;
alter table t3 drop x;
}
[22 Sep 2004 15:16] Tomas Ulin
cuts from error log and trace (2-node cluster).

Both nodes fail on same place:

Date/Time: Wednesday 22 September 2004 - 16:17:48
Type of error: error
Message: Internal program error (failed ndbrequire)
Fault ID: 2341
Problem data: Dbdict.cpp
Object of reference: DBDICT (Line: 9274) 0x0000000a
ProgramName: NDB Kernel
ProcessID: 14470
TraceFile: /home/tomas/mysql/mysql-test/ndbcluster-2200/ndb_2_trace.log.3
***EOM***

From trace file:

DBTUP   002032 
DBDICT  006545 006551 006553 
DBDICT  006545 006551 006692 
DBDICT  006624 006641 006681 006722 
DBDICT  009035 009045 009053 
DBDICT  009035 009045 009280 
DBDICT  009133 009151 009263 009508 009557 
DBDICT  009035 009099 009350 009355 
DBDICT  009133 009151 009274 

--------------- Signal ----------------
r.bn: 250 "DBDICT", r.proc: 2, r.sigId: 1657894 gsn: 605 "ALTER_INDX_CONF" prio: 1
s.bn: 250 "DBDICT", s.proc: 2, s.sigId: 1657893 length: 3 trace: 0 #sec: 0 fragInf: 0
 H'00fa0002 H'00000002 H'00000050
--------------- Signal ----------------
r.bn: 250 "DBDICT", r.proc: 2, r.sigId: 1657893 gsn: 603 "ALTER_INDX_REQ" prio: 1
s.bn: 250 "DBDICT", s.proc: 2, s.sigId: 1657892 length: 7 trace: 0 #sec: 0 fragInf: 0
 H'00fa0002 H'00000002 H'00000050 H'0000000e H'00000010 H'00000003 H'00000000
--------------- Signal ----------------
r.bn: 250 "DBDICT", r.proc: 2, r.sigId: 1657892 gsn: 605 "ALTER_INDX_CONF" prio: 1
s.bn: 250 "DBDICT", s.proc: 2, s.sigId: 1657891 length: 3 trace: 0 #sec: 0 fragInf: 0
 H'00fa0002 H'00000002 H'00000010
--------------- Signal ----------------
r.bn: 250 "DBDICT", r.proc: 2, r.sigId: 1657891 gsn: 603 "ALTER_INDX_REQ" prio: 1
s.bn: 250 "DBDICT", s.proc: 2, s.sigId: 1657890 length: 8 trace: 0 #sec: 0 fragInf: 0
 H'00fa0002 H'00000001 H'00000003 H'0000000e H'00000010 H'00000003 H'00000000
 H'00000002
--------------- Signal ----------------
r.bn: 250 "DBDICT", r.proc: 2, r.sigId: 1657890 gsn: 603 "ALTER_INDX_REQ" prio: 1
s.bn: 250 "DBDICT", s.proc: 2, s.sigId: 1657889 length: 7 trace: 0 #sec: 0 fragInf: 0
 H'00fa0002 H'00000001 H'00000003 H'0000000e H'00000010 H'00000003 H'00000000
--------------- Signal ----------------
r.bn: 250 "DBDICT", r.proc: 2, r.sigId: 1657889 gsn: 517 "DROP_INDX_CONF" prio: 1
s.bn: 250 "DBDICT", s.proc: 2, s.sigId: 1657888 length: 3 trace: 0 #sec: 0 fragInf: 0
 H'00000001 H'00fa0002 H'00000010
--------------- Signal ----------------
r.bn: 250 "DBDICT", r.proc: 2, r.sigId: 1657888 gsn: 516 "DROP_INDX_REQ" prio: 1
s.bn: 250 "DBDICT", s.proc: 2, s.sigId: 1657887 length: 7 trace: 0 #sec: 0 fragInf: 0
 H'00000000 H'80020004 H'00000001 H'ffffffff H'00000010 H'00000003 H'00000001
--------------- Signal ----------------
r.bn: 250 "DBDICT", r.proc: 2, r.sigId: 1657887 gsn: 516 "DROP_INDX_REQ" prio: 1
s.bn: 32770 "API", s.proc: 4, s.sigId: 0 length: 6 trace: 0 #sec: 0 fragInf: 0
 H'00000000 H'80020004 H'00000001 H'ffffffff H'00000010 H'00000003
[22 Sep 2004 15:26] Martin Skold
Looks like this is part of the drop table (with drop index) in the end of the alter table.
[28 Sep 2004 7:02] Tomas Ulin
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html