- last update
over 1 year ago 71 pass
Updated: Comment #N
Currently RulesPlugin:save()
clears the whole cache if the no original entity was found
or if the variables from the original entity don't match with the current ones.
Problem with this approach is that the property original
never exists
because it's deleted by EntityAPIController::save()
.
In our environment with a looooot of rules (that are triggered in the frontend) this causes some serious trouble (stampeding) when rebuilding the whole cache.
Especially since the "cache" rules_event_whitelist
is handled as variable:
#2042851: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'rules_event_whitelist' for key 'PRIMARY →
This would be less of a problem if it would be handled by cache_get()
because we use redis and that wouldn't fail this way.
However, I guess the performance problem is already enough annoying to justify a fix ;)
Fetch the original entity on our own and make it reusable for the other entity controllers.
This pattern is already implemented in several other locations e.g. RulesEntityController::save()
.
Question:
Is there a way to make the cache flush even more atomic?
E.g. just removing the current component from the cache data array.
The patch rules-rules-plugin-cache-clearing-fix-flush-specific-component.patch
contains a POC to test such an approach. The tests so far show a dramatic performance gain.
Reviews needed.
None
None
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.