@@ -653,6 +653,32 @@ var _ = Describe("ClusterClient", func() {
653653 Expect (client .Close ()).NotTo (HaveOccurred ())
654654 })
655655
656+ It ("determines hash slots correctly for generic commands" , func () {
657+ opt := redisClusterOptions ()
658+ opt .MaxRedirects = - 1
659+ client := cluster .newClusterClient (ctx , opt )
660+
661+ err := client .Do (ctx , "GET" , "A" ).Err ()
662+ Expect (err ).To (Equal (redis .Nil ))
663+
664+ err = client .Do (ctx , []byte ("GET" ), []byte ("A" )).Err ()
665+ Expect (err ).To (Equal (redis .Nil ))
666+
667+ Eventually (func () error {
668+ return client .SwapNodes (ctx , "A" )
669+ }, 30 * time .Second ).ShouldNot (HaveOccurred ())
670+
671+ err = client .Do (ctx , "GET" , "A" ).Err ()
672+ Expect (err ).To (HaveOccurred ())
673+ Expect (err .Error ()).To (ContainSubstring ("MOVED" ))
674+
675+ err = client .Do (ctx , []byte ("GET" ), []byte ("A" )).Err ()
676+ Expect (err ).To (HaveOccurred ())
677+ Expect (err .Error ()).To (ContainSubstring ("MOVED" ))
678+
679+ Expect (client .Close ()).NotTo (HaveOccurred ())
680+ })
681+
656682 It ("follows node redirection immediately" , func () {
657683 // Configure retry backoffs far in excess of the expected duration of redirection
658684 opt := redisClusterOptions ()
0 commit comments