Mysql::Error: Lock wait timeout exceeded; try restarting transaction

Hello all

I am using acts_as_ferret in user model.

Error Message:

ActiveRecord::StatementInvalid: Mysql::Error: Lock wait timeout
exceeded;
try restarting transaction: UPDATE users SET updated_at =
‘2009-12-28
14:31:50’, active_till = ‘2009-12-28 14:31:50’ WHERE id = 21

Where:

calls#audit
/var/lib/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract_adapter.rb,
line 219

Does any one have any solution ?


Sandip


You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

On Dec 28, 12:24 pm, Sandip R. [email protected] wrote:

Hello all

I am using acts_as_ferret in user model.

Error Message:

ActiveRecord::StatementInvalid: Mysql::Error: Lock wait timeout exceeded;
try restarting transaction: UPDATE users SET updated_at = ‘2009-12-28
14:31:50’, active_till = ‘2009-12-28 14:31:50’ WHERE id = 21

The problem is not that update. The problem is that something else was
causing that row (and probably others) to be locked for long enough
that mysql gave up waiting to be able to get a lock for writing. What
else is happening at the time that might cause this ?

Fred

—www.funonrails.com

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

@Frederick
*
*
*After debug i found that Ferret index update is the cause, any views ?
*

Sandip


You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

On Dec 28, 12:43 pm, Sandip R. [email protected] wrote:

@Frederick
*
*
*After debug i found that Ferret index update is the cause, any views ?
*

I know very little about ferret, however in general you might try to
either do the index update in smaller chunks (so that any given row is
not locked for too long) or setup a slave database and do index
rebuilds against the slave database.

Fred


Sandip

—www.funonrails.com

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.