cockroachdb / cockroachdb/cockroach
allocator: log invalid candidates when unable to find lease transfer target
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
**Is your feature request related to a problem? Please describe.**
When unable to find a lease transfer target, the Allocator logs this line (example of drain):
```
[drain,n1,s1,r27/1:‹/Table/2{6-7}›] no lease transfer target found for r27
```
However that doesn't give information as to why there are no transfer targets found. In the case of drain specifically, if a lease is unable to transfer due to no valid candidates, it is useful to know why.
https://github.com/cockroachdb/cockroach/blob/fdf04ffe5403daab580ab0a6fb0ad407ccc23c2e/pkg/kv/kvserver/allocator/allocatorimpl/allocator.go#L2253-L2253
**Describe the solution you'd like**
Update the log line above to include information on the replica candidates which were excluded as invalid. For each candidate which is excluded, include the reason why.
**Describe alternatives you've considered**
We could also/alternatively add metrics but that wouldn't give us the specific range information.
**Additional context**
Prompted by https://github.com/cockroachdb/cockroach/issues/104304
Jira issue: CRDB-28845
Epic CRDB-54646
Contributor guide
Assessment
This issue has not been assessed yet.