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

dev/core#2516 Invalidate only smart groups #19986

Merged
merged 2 commits into from
Apr 25, 2021

Conversation

scardinius
Copy link
Contributor

described here https://lab.civicrm.org/dev/core/-/issues/2516, abstract:

Method CRM_Contact_BAO_GroupContactCache::invalidateGroupContactCache() is described as touching smart groups but there is no condition for smart groups.

Current behaviour produced too much traffic on database (deadlocks).

@civibot
Copy link

civibot bot commented Apr 7, 2021

(Standard links)

@civibot civibot bot added the master label Apr 7, 2021
@eileenmcnaughton
Copy link
Contributor

I think this is OK as long as we also check for when children is null - since we also cache parent groups

@mattwire
Copy link
Contributor

@scardinius Please see comment from @eileenmcnaughton - needs a change to check children

@scardinius
Copy link
Contributor Author

@eileenmcnaughton do you mean?

UPDATE civicrm_group
SET cache_date = NULL
WHERE id = %1 AND (saved_search_id IS NOT NULL OR children IS NOT NULL)

@eileenmcnaughton
Copy link
Contributor

@scardinius yep that looks right

@mattwire
Copy link
Contributor

@scardinius I have patched a live site where they often have problems with deadlocks. I will merge in one weeks time if it is ok there and no one else beats me to the merge :-)

@mattwire mattwire merged commit 82fe8be into civicrm:master Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants