-
Notifications
You must be signed in to change notification settings - Fork 68
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
Bugfix: Validate tags on cache hit #127
base: master
Are you sure you want to change the base?
Bugfix: Validate tags on cache hit #127
Conversation
…s-in-cache-invalidate Bugfix: Implement transaction locks in cache invalidate
Update master
Thanks for your contribution, highly appreciated. It would be very interesting to find out why the key doesn't get the required tag. I will investigate this further once I find some time. I'll probably add your PR with an additional option, need to check the impact it has on performance. |
Thanks 🙌 Originally I was suspecting it was Redis getting full, and it was doing cache evictions on the tags in Redis (but I don't think that anymore). Very weird issue. Thought maybe that the 1 cache didn't generate the correct tags, but I can verify with the change in this PR, that was not the case. Maybe there is another issue in the code like #124 causing this, but I can't find the cause 🤔 |
If you know the particular query which caused the issue, can you try to reproduce it locally with that query? |
I think we can trace it down to query:
But we have not been able to reproduce the issue locally. |
That looks like a rather simple query. I suspect it's an issue with Redis. Can you post the relevant PHP code please? |
The updating code:
The fetching code. That was stuck for 1 model instance (99.9% of the time there is no issue):
We've only ever seen the issue on production. |
Yeah I think it's some kind of race condition. Will be pretty hard to investigate. Going to have an in-depth look for the next release. |
Hey, just wondering if there is any updates here. I think it's just a really hard issue to investigate.
|
Sometimes updates does not invalidate all caches relevant to the model in distributed system (unknown reason)
We are running Lada-cache on a big website with a lot of users.
We can't determine the cause, but sometimes fetch requests, will give us an old (stale) state of the model.
Technically from the code this should not be able to happen, if everything works, so I cannot correct any specific file.
But we can see the error state, so we know why we are getting stale caches.
Bug state:
Expected state:
Performance on cache hits:
We have currently been running my branch on our production environment for 2 weeks, and it seems to correct the issue completely.
If the performance overhead is a concern, we could also add this as an option to the config and default it to false. That way we don't have any extra overhead for users that don't experience the issue.
I've tried to add a test that simulates the issue case.