Skip to content

Commit

Permalink
fix:disorderly execution of the same key when using pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
dingxiaoshuai123 committed Nov 29, 2023
1 parent 6b17abf commit 859ea43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions codis/pkg/proxy/forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,9 @@ func (d *forwardHelper) slotsmgrtExecWrapper(s *Slot, hkey []byte, database int3
}

func (d *forwardHelper) forward2(s *Slot, r *Request) *BackendConn {
var database, seed = r.Database, r.Seed16()
var database = r.Database
if s.migrate.bc == nil && !r.IsMasterOnly() && len(s.replicaGroups) != 0 {
var seed = r.Seed16()
for _, group := range s.replicaGroups {
var i = seed
for range group {
Expand All @@ -226,5 +227,6 @@ func (d *forwardHelper) forward2(s *Slot, r *Request) *BackendConn {
}
}
}
return s.backend.bc.BackendConn(database, seed, true, r.OpFlag.IsQuick())
// fix:https://github.com/OpenAtomFoundation/pika/issues/2174
return s.backend.bc.BackendConn(database, uint(s.id), true, r.OpFlag.IsQuick())
}
2 changes: 1 addition & 1 deletion codis/pkg/proxy/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ package proxy
import (
"bytes"
"hash/crc32"
"pika/codis/v2/pkg/utils/log"
"strconv"
"strings"
"sync"

"pika/codis/v2/pkg/proxy/redis"
"pika/codis/v2/pkg/utils/errors"
"pika/codis/v2/pkg/utils/log"
)

var charmap [256]byte
Expand Down

0 comments on commit 859ea43

Please sign in to comment.