Defect #5683

Project copy Lock wait timeout

Added by Kazuki Kudo over 11 years ago. Updated over 11 years ago.

Status:NewStart date:2010-06-14
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Projects
Target version:-
Resolution: Affected version:0.9.3

Description

CSV download of a lot of tickets is carried out.
Project copy is performed during download execution.

ActiveRecord::StatementInvalid (Mysql::Error: Lock wait timeout exceeded; try restarting transaction: 
UPDATE `projects` SET `lft` = CASE WHEN `lft` BETWEEN 197 AND 284 THEN `lft` + 286 - 284 
WHEN `lft` BETWEEN 285 AND 286 THEN `lft` + 197 - 285 ELSE `lft` END,
 `rgt` = CASE WHEN `rgt` BETWEEN 197 AND 284 THEN `rgt` + 286 - 284 WHEN `rgt` BETWEEN 285 AND 286 THEN `rgt` + 197 - 285 ELSE `rgt` END,
 `parent_id` = CASE WHEN id = 146 THEN NULL ELSE `parent_id` END ):
  app/models/project.rb:300:in `set_parent!'
  app/models/project.rb:278:in `set_allowed_parent!'
  app/controllers/projects_controller.rb:108:in `copy'
  passenger (2.2.11) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
  passenger (2.2.11) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
  passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'

Setup of parents is not completed.
It seems that transaction management is wrong.

Setup of parents is not included in a transaction scope.

table_status.txt Magnifier - table status (15 KB) Kazuki Kudo, 2010-06-22 03:01


Related issues

Related to Redmine - Defect #8143: Problem to update subtask Closed 2011-04-13

History

#1 Updated by Holger Just over 11 years ago

This seems to be more of a restriction of MySQL ISAM tables than a Redmine restriction.

As MyISAM does not support transaction, they are emulated using locks. The issue should vanish if you use a DBMS with proper transaction support (e.g. PostgreSQL or MySQL with InnoDB)

#2 Updated by Kazuki Kudo over 11 years ago

Hello.

Thank you for your reply.

This seems to be more of a restriction of MySQL ISAM tables than a
Redmine restriction.

It is confirming.
I am using InnoDB.
The result of table status is attached.

Best Regards.

Kazuki Kudo.

Also available in: Atom PDF