Closed singular-seal closed 5 months ago
I setup a redis cluster with 2 nodes(1 master and 1 slave) and tried to test go-redis client side behaviour using the code below
func ConnectRedisTarget() *ClusterClient { return NewClusterClient(&ClusterOptions{ Addrs: []string{ "127.0.0.1:6666", }, ReadOnly: true, }) } func TestOne(t *testing.T) { c := ConnectRedisTarget() ctx := context.Background() for i := 0; i < 100; i++ { p := c.Pipeline() p.Get(ctx, "c") cs, err := p.Exec(ctx) if err != nil { fmt.Println("err from c " + fmt.Sprint(err)) } else { for _, cmder := range cs { fmt.Println(cmder.String()) } } p.Get(ctx, "a") cs, err = p.Exec(ctx) if err != nil { fmt.Println("err from a " + fmt.Sprint(err)) fmt.Println(err) } else { for _, cmder := range cs { fmt.Println(cmder.String()) } } time.Sleep(time.Second * 5) } }
The key 'a' is in redis and 'c' is not in redis.
It always prints
err from c redis: nil get a: 1
It prints
err from c dial tcp 127.0.0.1:6666: connect: connection refused err from a dial tcp 127.0.0.1:6666: connect: connection refused dial tcp 127.0.0.1:6666: connect: connection refused
after I shutdown the master node
Don't mark node as failing when error Nil happens.
I setup a redis cluster with 2 nodes(1 master and 1 slave) and tried to test go-redis client side behaviour using the code below
The key 'a' is in redis and 'c' is not in redis.
Expected Behavior
It always prints
Current Behavior
It prints
after I shutdown the master node
Possible Solution
Don't mark node as failing when error Nil happens.
Steps to Reproduce
Context (Environment)
Detailed Description
Possible Implementation