Skip to content

Commit

Permalink
cli: handle merged range descriptors in debug keys
Browse files Browse the repository at this point in the history
Noticed during cockroachdb#29252.

Release note: None
  • Loading branch information
tbg committed Sep 6, 2018
1 parent e25f016 commit 1be9890
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/cli/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,13 @@ func loadRangeDescriptor(
// doesn't parse as a range descriptor just skip it.
return false, nil
}
if len(kv.Value) == 0 {
// RangeDescriptor was deleted (range merged away).
return false, nil
}
if err := (roachpb.Value{RawBytes: kv.Value}).GetProto(&desc); err != nil {
return false, err
log.Warningf(context.Background(), "ignoring range descriptor due to error %s: %+v", err, kv)
return false, nil
}
return desc.RangeID == rangeID, nil
}
Expand Down

0 comments on commit 1be9890

Please sign in to comment.