Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.6.9
-
Component/s: None
-
Labels:
-
Documentation Required?:None
-
Funding Source:Contributed Code
Description
We are hitting deadlocks on this query
CRM_Core_DAO::executeQuery('DELETE FROM civicrm_acl_contact_cache WHERE contact_id IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1)');
Since it is a delete clause with a subquery it locks the whole table rather than the relevant rows.
Logically this should be (possibly) done when the contact is trashed rather than at random access times. I say possibly because there is an implicit assumption the acled user cannot see deleted contacts in this action.
I took a look at the create clause and I feel like it is already aggressively clearing caches from there so adding a specific, non-locking delete clause to the deletecontact function should be enough to warrant removing this query.
Attachments
Issue Links
- is supplemented by
-
CRM-18120 Deadlocks on ACL contact Cache
- Done/Fixed
- links to