How to reproduce "Lock wait timeout" on production.log

Added by mizuka sano over 3 years ago

Hi,
The follwoing message occured on production.log, so resources of memory was tight.

ActiveRecord::StatementInvalid(Mysql2::Error: Lock wait timeout exceeded; try restarting transaction: SELECT `issues`.*FROM `issues` OORDER BY `issues`.`rgt` desc LIMIT 1 FOR UPDATE):
lib/plugins/awesome_nested_set/lib/awesome_nested_set/model.rb:165:in `right_most_bound`
lib/plugins/awesome_nested_set/lib/awesome_nested_set/model.rb:182:in `set_default_and_right`
app/models/issue.rb:165:in `create_or_update`
app/controllers/issues_controller.rb:150:in `create`

I think it's relevant issues with "redmine Defect #6579",
http://www.redmine.org/issues/6579
I tried to reproduce this problem with large parent-child hierarchies ticket, but can't reproduce.
I want to reproduce the problem to proposal for updating redmine3.0.0.
Could you tell me how to reproduce the conditions?

I use redmine2.6.0.

Replies (4)

RE: How to reproduce "Lock wait timeout" on production.log - Added by Toshi MARUYAMA over 3 years ago

mizuka sano wrote:

Could you tell me how to reproduce the conditions?

Simultaneously updating issue tree.

#6579 was fixed Redmine 3.0.0.
But MySQL >= 5.6 and MariaDB have problem (#19344).
I recommend you use PostgreSQL instead of MySQL and MariaDB.

RE: How to reproduce "Lock wait timeout" on production.log - Added by mizuka sano over 3 years ago

Thank you for your reply, Toshi-san!

Simultaneously updating issue tree.

Now I tried to update two tickets with same parent-child hierarchies at same time, this problem could not reproduce. (child and child, parent and grandchild)
Is my procedure correct?

RE: How to reproduce "Lock wait timeout" on production.log - Added by Toshi MARUYAMA over 3 years ago

Easy way to reproduce:

In MySQL console:

begin;
select * from issues for update;

RE: How to reproduce "Lock wait timeout" on production.log - Added by mizuka sano over 3 years ago

Hi,Toshi san
Thank you for your reply, I could reproduce.
However, it also occured the problem with non parent_child hierarchies ticket.
Is this result correct?

Many thanks,
mizuka sano

(1-4/4)