Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Refactor ACL Contact Cache generation to be more efficient #15592

Merged

Conversation

seamuslee001
Copy link
Contributor

Overview

This picks up the ACL contact Cache changes from Matt's patches here https://github.com/mattwire/civicrm-groupaclcache/blob/master/patches/master...mattwire:refactor_groupaclcache.diff#L4 but uses the standardised temp table class to generate the temporary table. AUG have been running with this for the last couple of days and haven't seen any performance degradation or any issues around access control so far.

Before

Cache building is less efficient.

After

Cache building is more efficient

Technical Details

A couple of main differences here is

  1. we add in a locking to ensure multiple processes don't try and fill the cache for the specific user at the same time
  2. We use a temporary table but don't do a left JOIN onto civicrm_acl_contact_cache as that causes some performance issues and also is mostly notionally redundant by virtue of the check in L225 -> L237 which essentially checks to see if there are any rows in the acl contact cache for this user for that particular operation (view or edit) and aborts if there are

ping @eileenmcnaughton @mattwire @monishdeb @pfigel @aydun

@civibot
Copy link

civibot bot commented Oct 23, 2019

(Standard links)

@civibot civibot bot added the master label Oct 23, 2019
@seamuslee001 seamuslee001 changed the title Refactor ACL Contact Cache generation to be more efficient [REF] Refactor ACL Contact Cache generation to be more efficient Oct 23, 2019
@mattwire
Copy link
Contributor

@seamuslee001 So do you think the changes in this file can be merged separate to the other changes in #15588?

@eileenmcnaughton
Copy link
Contributor

I would endorse merging this if others have tested / are OK with it. I think it makes the mostt important change from @mattwire's work - ie separating temp table creation from insert into possibly congested table

@mattwire
Copy link
Contributor

mattwire commented Nov 1, 2019

Merging per comments in mattermost + long-term use some of my client sites

@mattwire mattwire merged commit e6447bd into civicrm:master Nov 1, 2019
@seamuslee001 seamuslee001 deleted the ref_acl_contact_cache_generation branch November 1, 2019 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants