Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-17464

Deadlocks on acl_cache clearing

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6.9
    • Fix Version/s: 4.6.14, 4.7.3
    • Component/s: None
    • 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

          Activity

            People

            • Assignee:
              eileen Eileen McNaughton
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: