PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction:

UPDATE {variable} 
SET value=:db_update_placeholder_0 
WHERE ( (name = :db_condition_placeholder_0) );

Array ( 
  [:db_update_placeholder_0] => a:24:{s:36:"feeds_import_suggested_coupon_import";i:0;s:17:"feeds_import_user";i:1;s:21:"flag_unflagged_review";i:2;s:12:"node_presave";i:3;s:9:"node_view";i:4;s:4:"init";i:5;s:4:"cron";i:6;s:8:"watchdog";i:7;s:11:"user_insert";i:8;s:12:"user_presave";i:9;s:11:"user_delete";i:10;s:11:"user_logout";i:11;s:14:"comment_update";i:12;s:15:"comment_presave";i:13;s:12:"comment_view";i:14;s:14:"comment_delete";i:15;s:20:"taxonomy_term_insert";i:16;s:20:"taxonomy_term_update";i:17;s:21:"taxonomy_term_presave";i:18;s:20:"taxonomy_term_delete";i:19;s:26:"taxonomy_vocabulary_insert";i:20;s:26:"taxonomy_vocabulary_update";i:21;s:27:"taxonomy_vocabulary_presave";i:22;s:26:"taxonomy_vocabulary_delete";i:23;} 
  [:db_condition_placeholder_0] => rules_empty_sets
)

in variable_set() (line 986 of /var/www/html/includes/bootstrap.inc).

In reality this (rules_empty_sets) should be using a cache table and not the variable table.

CommentFileSizeAuthor
#1 1903498-less-aggressive-variable.patch1.96 KBbdragon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bdragon’s picture

Status: Active » Needs review
FileSize
1.96 KB

Nah, the variable is good for bootstrap performance. The *problem* is the excessive mucking about with it.

Seems to me that not deleting it at the drop of a hat and only updating it on an as-needed basis will prevent most of the pain here.

Status: Needs review » Needs work

The last submitted patch, 1903498-less-aggressive-variable.patch, failed testing.

bdragon’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1903498-less-aggressive-variable.patch, failed testing.

bdragon’s picture

Issue summary: View changes
Status: Needs work » Closed (duplicate)

Ya know, I think in the end this was probably just another case of #937284: DEADLOCK errors on MergeQuery INSERT due to InnoDB gap locking when condition in SELECT ... FOR UPDATE results in 0 rows.

It also appears that this bit of code doesn't exist anymore either.