Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
cache system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Feb 2014 at 21:04 UTC
Updated:
8 Dec 2015 at 07:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mikeytown2 commentedComment #2
mikeytown2 commentedLooks like cache_field operations can cause deadlocks in other places as well.
field.info.class.incfield_info:field_map
field_info:fields
field_info:instances
field_info:bundle:$entity_type:$bundle
field_info:bundle_extra:$entity_type:$bundle
field.info.incfield_info_types:$langcode
field.attach.incfield:$entity_type:$id
The deadlock in field.attach.inc should not be fixed; if there is a collision one of the inserts/updates should be rolled back. All others should be fixed.
Comment #3
mikeytown2 commentedComment #4
fabianx commentedThis is still helpful to have for the core cache backends.
**RTBC**
Comment #5
mikeytown2 commentedI would like to add that this patch is not applicable to D8 as the field_info keys are being set in their own cache table now and thus the cache_field table doesn't have this issue.
Comment #8
mikeytown2 commentedComment #11
mikeytown2 commentedComment #12
dcam commentedComment #13
anybodyWhao, great progress! I'm looking forward to seeing this in core soon :)
Comment #16
dcam commentedComment #21
dcam commentedComment #23
David_Rothstein commentedComment #25
David_Rothstein commentedCommitted to 7.x - thanks!
I had to think about this one for a while before committing it... I think the patch makes sense, though. I'd feel better if anyone can confirm that they are running this on a production site with no problems so far :)
Comment #27
joelpittet@David_Rothstein I am running this on a production server. So far no problems and no deadlocks, have had it applied since Oct 29th. So not that long.
Comment #28
David_Rothstein commentedAwesome, thanks @joelpittet.
Comment #30
jsheller commentedI have a question to this. On our website Core 7.34 is currently installed (since middle of december) but when I click "Clear Cache" on the administration interface or when I add a new field to a content type (what seems to clear the cache itself) I still get this deadlock. Do I miss something? What can I do? After the deadlock the mysql server connection is lost and the website is not reachable. Thank you very much!
Comment #31
brad.bulger commentedI am still getting this deadlock error with this change in place on 7.34 as well.
Comment #32
mikeytown2 commentedThis issue did fix part of the problem; it does reduce the deadlock occurrences. Odds are you're experiencing this issue as well #2222635: Waiting for table metadata lock on cache_field table.
I am working on a module that fixes the rest of the cache issues when using the database as the cache backend; still not ready but getting closer https://www.drupal.org/project/apdqc. Think I'll put out a beta 1 by the end of the week if things at work are smooth going. I will say that as of right now using the module and fixing all the issues that the status report page complains about will make it so the cache tables no longer lock. We had an issue on production where APDQC slowed down the site (all cache queries took right around 75ms) but we never got a database lock or a metadata lock as a result even thought the load spiked to 50 on the MySQL box #2416895: Fix issues when ran on a live production server. Once all the module's issues, except for session handling, is fixed expect a beta 1 to be released.
Comment #33
gopisathya commentedWe are using 7.41 and still get this error during production deployment
PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction: DELETE FROM {cache_field}
We do use "drush fra -y" during deployment