-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Feature request: Manually invalidate slot cache #2516
Comments
Theoretically, fixing the underlying cache invalidation problem would solve the issue as well. As always the trick is replicating the failure. I can provide a method to invalidate the cache, but some complexity here will have to be worked through. The cache does not live in shared memory, meaning it is a global persistent variable in each php-fpm child process. Is your idea to try and flush the cache when you encounter a failure? |
Yes, this would also work, but I am not sure at this point how aggressive you would need to be with the invalidation.
Yes, and to experiment on the conditions under which to it should occur. |
I'll double-check to be sure but we flush the cache when we receive a Implementing the method should actually be simple, so it shouldn't take very long. |
I'm not running into issues with a slot getting migrated, it is when a cluster node is replaced. For example, on Elasticache
if the host 10.0.0.1 is replaced by 10.0.0.2, and cache_slots is enabled, we will keep trying to connect to 10.0.0.1 until php-fpm is restarted. |
Further details since it sounds like you want to fix this in phpredis: No exception is being thrown by RedisCluster for this event, instead I'm getting this notice:
|
I'm going to try and solve the underlying issue of PhpRedis not updating the cache in this situation. That's clearly a bug. However, I see no reason not to also provide a utility function to manually flush the cache. It's simple, and I don't really see any downside. |
Have you had any movement on this? I'm happy to help test any experimental branch if you have one. |
I'm running into an issue where RedisCluster keeps trying to use to non-existent cluster nodes when
redis.clusters.cache_slots
is enabled. Currently, the only way to invalidate the cache is to restart php-fpm. Instead, I would like to build slot cache invalidation into my PHP application and would like RedisCluster to expose a PHP function to permit this.The text was updated successfully, but these errors were encountered: