I am using drupal 7.25 version. Suddenly I am going to have a strange problem, I am having a MYSQL error of deadlock while updating the node pragmatically. The error message is as bellow.

PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction: DELETE FROM {semaphore} WHERE (name = :db_condition_placeholder_0) AND (value = :db_condition_placeholder_1) ; Array ( [:db_condition_placeholder_0] => variable_init [:db_condition_placeholder_1] => 724779688531d7c464a12c5.93905386 ) in lock_release() (line 254 of /mnt/www/smartster/web/includes/lock.inc).

Please someone guide me about it.
Kind Regards,
Rafiq Ahmed

Comments

udaykant’s picture

Its mysql import problem. Remove old data from database and import again.
I think it will be fixed.

Jooblay.net’s picture

Have your performed any updates?
What does your log say when your receive this error?
Have your modified any php, mysql?
More information on what steps your have taken to produce this error.

If in fact your database is corrupted. How big is your database?

mysql -u username -p -h localhost databasename < /path/to/database.sql

Will quickly reload your database. Befor you do that remember to make backups. Are your running drush? Oh you would also want to clean out the database tables first as well.

rafiqasad’s picture

Can someone told me what type of data is stored in semaphore table? My database size is around 10GB with about 700 000 nodes.

Jooblay.net’s picture

have your processed any updates? or what has changed?

https://drupal.org/node/1854088
https://drupal.org/node/937284

these are similar issues with a deadlock

Version: 7.25 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

avpaderno’s picture

Issue tags: -Mysql Deadlock on semaphore during updating node programatically

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.