Bug #44081 Lock with Unique Key in NDB Cluster
Submitted: 3 Apr 2009 18:28 Modified: 9 Apr 2009 13:55
Reporter: Emerson Yoshinaga Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:mysql-5.1-telco-6.3.14, 6.4.2 OS:Linux (Ubuntu Hardy )
Assigned to: Assigned Account CPU Architecture:Any
Tags: lock, ndb, unique key

[3 Apr 2009 18:28] Emerson Yoshinaga
Description:
We are facing problems while a transaction is started and selecting a row using a unique key field. This select is not using "for update" command.
In a second client we try to update the same row but the statement keeps locked while the transaction is not release for any reason.

We also tried in a innodb engine in the other hand the statement was not locked.

Is this a cluster limitation or a bug?

How to repeat:
1. Create table nbdcluster engine:
create table t1 (
	col1 tinyint unsigned not null, 
	col2 tinyint unsigned not null, 
	col3 varchar(100), 
	unique key uk1 (col2), 
	primary key (col1)
) engine=ndbcluster;

2. Insert data into the table

insert into t1 values (1,1,'foo1');

start transaction; select * from t1 where col2 = 1;

3. In antoher client session try to update the same row:

update t1 set col3 = 'foo123' where col1 = 1;

Here we have our statement locked!!!

4. Release the transaction in the first client.

rollback;

5. Now we have the update statement executed in the second client!!!
[6 Apr 2009 15:50] Sveta Smirnova
Thank you for the report.

Verified as described.
[7 Apr 2009 5:36] Jonas Oreland
Hi,

This behavior is a "fact" about our unique index impl.
I.e it has been this since day one.
[13 Mar 2014 13:37] Omer Barnir
This bug is not scheduled to be fixed at this time.