forked from mirror/redis
cluster: retry same node on retryable error
This commit is contained in:
parent
467749ade8
commit
092971361b
|
@ -816,6 +816,12 @@ func (c *ClusterClient) defaultProcess(cmd Cmder) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if internal.IsRetryableError(err, true) {
|
if internal.IsRetryableError(err, true) {
|
||||||
|
// Firstly retry the same node.
|
||||||
|
if attempt == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// Secondly try random node.
|
||||||
node, err = c.nodes.Random()
|
node, err = c.nodes.Random()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue