Skip to content

Commit

Permalink
bugfix: index panic
Browse files Browse the repository at this point in the history
  • Loading branch information
vinllen committed Jun 3, 2019
1 parent 2aafbe7 commit c581555
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/redis-shake/common/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ func parseAddress(tp, address, redisType string, isSource bool) error {
setAddressList(isSource, address)
}
case conf.RedisTypeProxy:
if addressLen != 1 {
return fmt.Errorf("address[%v] length[%v] must == 1 when type is 'proxy'", addressLen, addressLen)
if isSource && addressLen != 1 {
return fmt.Errorf("address[%v] length[%v] must == 1 when type is 'proxy'", address, addressLen)
}
if isSource && tp != conf.TypeRump {
return fmt.Errorf("source.type == proxy should only happens when mode is 'rump'")
Expand Down
8 changes: 7 additions & 1 deletion src/redis-shake/rump.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ func (cr *CmdRump) Main() {
cr.receiver()
}

/*------------------------------------------------------*/
// one rump link corresponding to one dbRumper
type dbRumper struct {

}

func (cr *CmdRump) fetcher(idx int) {
length, err := cr.scanners[idx].NodeCount()
if err != nil || length <= 0 {
Expand All @@ -94,7 +100,7 @@ func (cr *CmdRump) fetcher(idx int) {
// iterate all source nodes
for i := 0; i < length; i++ {
// fetch db number from 'info Keyspace'
dbNumber, err := cr.getSourceDbList(i)
dbNumber, err := cr.getSourceDbList(idx)
if err != nil {
log.Panic(err)
}
Expand Down

0 comments on commit c581555

Please sign in to comment.