go-redis icon indicating copy to clipboard operation
go-redis copied to clipboard

Cluster Client debug object 'xxx', ERR no such key

Open daiguadaidai opened this issue 5 years ago • 3 comments

Test Code:

func TestRedisCluster_DebugObject(t *testing.T) {
	client := redis.NewClusterClient(&redis.ClusterOptions{
		Addrs:    []string{"127.0.0.1:7003"}, //set redis cluster url
		Password: "",                         //set password
	})

	rs1, err := client.Get("key:150").Result()
	if err != nil {
		t.Fatal(err.Error())
	}
	fmt.Println(rs1)

	rs2, err := client.DebugObject("key:150").Result()
	if err != nil {
		t.Fatal(err.Error())
	}

	fmt.Println(rs2)
}

output:

=== RUN   TestRedisCluster_DebugObject
val:150
--- FAIL: TestRedisCluster_DebugObject (0.00s)
    bat_test.go:266: ERR no such key
FAIL

daiguadaidai avatar Dec 13 '19 01:12 daiguadaidai

@daiguadaidai How many nodes do you have in your cluster and what ports do they attached to? 6 nodes? :7000-:7005 ports? Could you please provide a way how you create redis cluster with the key:150/val:150 value?

kshestakov avatar Feb 26 '20 22:02 kshestakov

Perhaps because this command is not recommended for usesd by clients, so redis does not specify the position of key

see Examples and search debug on this page debug object

zeast avatar Mar 26 '20 06:03 zeast

This issue is marked stale. It will be closed in 30 days if it is not updated.

github-actions[bot] avatar Jan 28 '24 00:01 github-actions[bot]