From 03376a5d9c7dfd7197b14ce13b24a0431a07a663 Mon Sep 17 00:00:00 2001 From: Ben Keith Date: Thu, 7 Jul 2022 14:42:57 -0400 Subject: [PATCH] fix: additional node failures in clustered pipelined reads This causes a node to be marked as failing if the client is in READONLY mode and any error occurs that is either a LOADING error (existing behvaior) or any non-redis error (e.g. connection error, timeout, etc.). This prevents that node from being tried again on the next attempt as usually non-redis errors are a strong indication that that node is not operational or degraded in some way. --- cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster.go b/cluster.go index c6d8cc5..da55d7e 100644 --- a/cluster.go +++ b/cluster.go @@ -1212,7 +1212,7 @@ func (c *ClusterClient) pipelineReadCmds( continue } - if c.opt.ReadOnly && isLoadingError(err) { + if c.opt.ReadOnly && (isLoadingError(err) || !isRedisError(err)) { node.MarkAsFailing() return err }