Sandip Ransing
2009-Dec-28 11:24 UTC
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 --- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2009-Dec-28 11:34 UTC
Re: Mysql::Error: Lock wait timeout exceeded; try restarting transaction
On Dec 28, 12:24 pm, Sandip Ransing <san2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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> Where: > ------ > calls#audit > /var/lib/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adap ters/abstract_adapter.rb, > line 219 > > Does any one have any solution ? > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sandip Ransing
2009-Dec-28 11:43 UTC
Re: Re: Mysql::Error: Lock wait timeout exceeded; try restarting transaction
@Frederick * * *After debug i found that Ferret index update is the cause, any views ? * -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2009-Dec-28 12:15 UTC
Re: Mysql::Error: Lock wait timeout exceeded; try restarting transaction
On Dec 28, 12:43 pm, Sandip Ransing <san2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.