add some unittests and bug fix

This commit is contained in:
hdt3213
2021-05-02 18:48:44 +08:00
parent 37779717e4
commit 9f3ac88b36
19 changed files with 256 additions and 146 deletions

View File

@@ -116,6 +116,6 @@ func MakeRouter() map[string]CmdFunc {
// relay command to responsible peer, and return its reply to client
func defaultFunc(cluster *Cluster, c redis.Connection, args [][]byte) redis.Reply {
key := string(args[1])
peer := cluster.peerPicker.Get(key)
peer := cluster.peerPicker.PickNode(key)
return cluster.Relay(peer, c, args)
}