-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Missing keyspace notifications after master failover #3543
Comments
@ManelCoutinhoSensei Hi! We will have a look on it in near time |
The issue is that when you set the configuration, it is applied only to the current master, and Redis does not replicate configuration settings to replicas. So, when the master fails and a new master is promoted, the new master does not inherit the previous configuration, which means no messages are sent to the Pub/Sub channel. One possible solution in your code is to retrieve all replicas and apply the same configuration before failover to ensure consistency. I'm not sure whether the client should handle this differently from the server. |
Hi @petyaslavova, I agree that this is the reason for the issue, but I'm not entirely sure whether this is what should happen. As I mentioned, other libraries have encountered the same problem and implemented fixes, but let's consider a simple example with 2 replicas where the user implements your solution and replicates the configuration. What happens when Redis A fails and Redis B takes over? We are faced with one of the following situations: For these reasons, unless I'm missing smt, I believe a Redisson-like approach would be a more suitable solution. But let's see what @vladvildanov says. |
Expected behavior
When a Redis master fails over in a Sentinel-managed cluster, the client should continue receiving keyspace notifications from the new master without requiring any additional configuration.
Actual behavior
Keyspace notifications from the new master are lost after master fails over.
Reproduce behavior
docker-compose.yml
:Note that no notifications are printed after the failover unless the second
config_set("notify-keyspace-events", "KEA")
command (currently commented out) is re-executed.Additional Comments
A similar issue was reported and fixed in other libraries, such as Redisson (1, 2).
The text was updated successfully, but these errors were encountered: