You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given Redis Sentinel mode, a master node is down, and failover is trigger: other Redis node become the new master.
RedisKeyRegistrationHandler is not smart enough and still tries to write to the old master node:
{"timestamp":"2025-03-04T01:49:52.685Z","level":"ERROR","thread":"lettuce-epollEventLoop-4-4","logger":"org.apache.james.events.RedisKeyRegistrationHandler","message":"Error while binding key","context":"default","exception":"io.lettuce.core.RedisReadOnlyException: READONLY You can't write against a read only replica. at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:144) at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:116) at io.lettuce.core.RedisPublisher$SubscriptionCommand.doOnComplete(RedisPublisher.java:761) at io.lettuce.core.protocol.CommandWrapper.complete(CommandWrapper.java:65) at io.lettuce.core.protocol.CommandWrapper.complete(CommandWrapper.java:63) at io.lettuce.core.protocol.CommandHandler.complete(CommandHandler.java:745) at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:680) at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:597) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1407) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918) at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:799) at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:501) at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:399) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Unknown Source)"}
We need to try to make it smarter: following the Redis failover, it should write to the new master node.
The text was updated successfully, but these errors were encountered:
Might be potentially I think more connected to the way we connect after we create the redis client.
We connect normally, like master/replica way, but actually in the client you have connectSentinel methods that should be I think better adapted for handling change of master in case of failover
Why
Given Redis Sentinel mode, a master node is down, and failover is trigger: other Redis node become the new master.
RedisKeyRegistrationHandler
is not smart enough and still tries to write to the old master node:We need to try to make it smarter: following the Redis failover, it should write to the new master node.
The text was updated successfully, but these errors were encountered: