Skip to content

Commit

Permalink
fix coordinator crash when moving key range twice (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
diPhantxm committed Aug 21, 2023
1 parent 96a4f4d commit 0b92768
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion coordinator/provider/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,8 @@ func (qc *qdbCoordinator) Move(ctx context.Context, req *kr.MoveKeyRange) error
if err := qc.traverseRouters(ctx, func(cc *grpc.ClientConn) error {
cl := routerproto.NewKeyRangeServiceClient(cc)
moveResp, err := cl.MoveKeyRange(ctx, &routerproto.MoveKeyRangeRequest{
KeyRange: krmv.ToProto(),
KeyRange: krmv.ToProto(),
ToShardId: krmv.ShardID,
})
spqrlog.Zero.Debug().
Interface("response", moveResp).
Expand Down
2 changes: 1 addition & 1 deletion qdb/etcdqdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ func (q *EtcdQDB) UpdateKeyRangeMoveStatus(ctx context.Context, moveId string, s
if err != nil {
return err
}
if len(resp.Kvs[0].Value) != 1 {
if len(resp.Kvs) != 1 {
return fmt.Errorf("failed to update move key range operation by id %s", moveId)
}
var moveKr MoveKeyRange
Expand Down

0 comments on commit 0b92768

Please sign in to comment.