Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix coordinator crash when moving key range twice #282

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading