14 messages in com.mysql.lists.clusterRe: select for update problem
FromSent OnAttachments
Yong Lee12 Mar 2007 21:58 
Jon Stephens13 Mar 2007 04:21 
Christiaan den Besten13 Mar 2007 06:54 
Stewart Smith13 Mar 2007 08:16 
Jon Stephens13 Mar 2007 08:34 
Yong Lee13 Mar 2007 09:00 
Yong Lee13 Mar 2007 09:50 
Martin Skold13 Mar 2007 09:52 
Martin Skold13 Mar 2007 09:54 
Stewart Smith14 Mar 2007 00:51 
Martin Skold14 Mar 2007 06:33 
Yong Lee14 Mar 2007 09:53 
Martin Skold14 Mar 2007 11:08 
Yong Lee14 Mar 2007 12:58 
Subject:Re: select for update problem
From:Martin Skold (Mart@mysql.com)
Date:03/13/2007 09:52:55 AM
List:com.mysql.lists.cluster

Hi!

Do you have an index on subscribers.id? If not, I suggest you can try set engine_condition_pushdown=on; then you will only read up subscribers from the data nodes matching this condition.

BR -- Martin Yong Lee wrote:

Hi all,

I'm using mysql 5.0 clusters using a 3 node setup (1 mgmt, 2 sql/ndb combo nodes) and am trying to test out a simple lock transaction.

Through mysql I run a command :

begin work; select * from subscribers where id = 1000 for update;

In another window, I'll login and run : begin work; select * from subscribers where id = 1000 for update;

In the subscribers table, the id is an auto incrementing primary key

I'm expecting the second query to fail because of a lock timeout. What I'm getting is my swap space usage increasing dramatically, and the query taking a very long time to respond. It will eventually come back with a lock timeout message or crash mysql or crash ndbd

checking free

total used free shared buffers cached Mem: 1001 986 15 0 37 352 -/+ buffers/cache: 595 405 Swap: 1983 554 1429

total used free shared buffers cached Mem: 1001 973 27 0 0 12 -/+ buffers/cache: 960 40 Swap: 1983 1880 103

in top : 4993 mysql 17 0 2003m 679m 960 S 1 67.8 0:09.55 mysqld

Node 4: Forced node shutdown completed. Initiated by signal 0. Caused by error 2305: 'Node lost connection to other nodes and can not form a unpartitioned cluster, please investigate if there are error(s) on other node(s)(Arbitration error). Temporary err

So it looks like mysql is sucking up all the memory and when this runs out it's causing ndbd or mysql to die. I'm confused as to why a lock request would suck up so much memory. The database seems fine otherwise, in that I can do normal operations like select, insert, delete etc. no problem. I'm thinking that I may have a configuration file parameter set wrong, but I'm not too sure which one it may be.

I hope someone out there can shed some light into this problem,

thanks, Yong.