Bug #9839 Column with AUTOINC contains -1 Value on node stop
Submitted: 12 Apr 2005 10:44 Modified: 15 Apr 2005 18:58
Reporter: Hartmut Holzgraefe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:4.1.10 OS:HP/UX (HP/UX)
Assigned to: Martin Skold CPU Architecture:Any

[12 Apr 2005 10:44] Hartmut Holzgraefe
Description:
A value of -1 was inserted into autoinc column during ndb node shutdown. 

How to repeat:
The following situation led into this error:

-) ndb cluster (4 node, 2 replicas) running on two machines
-) insert - procedure ./ins.pl -n 100 -r 40000 -t myvalue was running on machine 1
-) shutdown nodes on the other machine using ndb_mgm> x stop
(I waited with 2 stop until the clusterlog told us that node shutdown has completed)
-) the insert procedure generated errors

mysql@uxrpxa02:/MysqlTools/mysql/local/ac > ./ins.pl -n 100 -r 400000 -t myvalue
forking: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sleeping for 11 seconds while kids get ready
waiting: DBD::mysql::st execute failed: Duplicate entry '-1' for key 1 at ./ins.pl line 48.
DBD::mysql::st execute failed: Duplicate entry '-1' for key 1 at ./ins.pl line 48.
DBD::mysql::st execute failed: Duplicate entry '-1' for key 1 at ./ins.pl line 48.
DBD::mysql::st execute failed: Got error 4350 'Transaction already aborted' from ndbcluster at ./ins.pl line 50.
DBD::mysql::st execute failed: Got error 4350 'Transaction already aborted' from ndbcluster at ./ins.pl line 50.
DBD::mysql::st execute failed: Duplicate entry '-1' for key 1 at ./ins.pl line 48.
DBD::mysql::st execute failed: Got error 4350 'Transaction already aborted' from ndbcluster at ./ins.pl line 50.
DBD::mysql::st execute failed: Duplicate entry '-1' for key 1 at ./ins.pl line 48.
DBD::mysql::st execute failed: Duplicate entry '-1' for key 1 at ./ins.pl line 48.
DBD::mysql::st execute failed: Duplicate entry '-1' for key 1 at ./ins.pl line 48.
DBD::mysql::st execute failed: Duplicate entry '-1' for key 1 at ./ins.pl line 48.
DBD::mysql::st execute failed: Duplicate entry '-1' for key 1 at ./ins.pl line 48.
DBD::mysql::st execute failed: Duplicate entry '-1' for key 1 at ./ins.pl line 48.
....

-) a record exists in the table containing -1 in the auto-inc column
[15 Apr 2005 12:42] Martin Skold
Several bug fixes have been done for auto_increment in latest 4.1 src tree, 
please verify that this problem still exist
[15 Apr 2005 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/internals/24053
[15 Apr 2005 14: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/internals/24054