Skip to content

Commit

Permalink
allocatorimpl: vlog on all excl. repl due to catchup conditions
Browse files Browse the repository at this point in the history
Previously, we would only `VEventf(ctx, 5, ...)` when a replica was
being excluded due to having a send queue, or not being in
`StateReplicate`.

Now also:
- `V(4)` log when a replica is included due to missing stats.
- `V(6)` log when a replica is included due to passing stats.

Part of: cockroachdb#123509
Release note: None
  • Loading branch information
kvoli committed Oct 14, 2024
1 parent f11d7d1 commit e98f773
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions pkg/kv/kvserver/allocator/allocatorimpl/allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3084,14 +3084,23 @@ func excludeReplicasInNeedOfCatchup(
sendStreamStats(stats)
filled := 0
for _, repl := range replicas {
if stats, ok := stats.ReplicaSendStreamStats(repl.ReplicaID); ok &&
(!stats.IsStateReplicate || stats.HasSendQueue) {
if replicaSendStreamStats, ok := stats.ReplicaSendStreamStats(repl.ReplicaID); ok &&
(!replicaSendStreamStats.IsStateReplicate || replicaSendStreamStats.HasSendQueue) {
log.KvDistribution.VEventf(ctx, 5,
"not considering %s as a potential candidate for a lease transfer "+
"not considering %v as a potential candidate for a lease transfer "+
"because the replica requires catchup: "+
"[is_state_replicate=%v has_send_queue=%v]",
repl, stats.IsStateReplicate, stats.HasSendQueue)
"replica=(%v) range=%v",
repl, replicaSendStreamStats, stats)
continue
} else if ok {
log.KvDistribution.VEventf(ctx, 6,
"replica %v is up-to-date and does not require catchup "+
"replica=(%v) range=%v",
repl, replicaSendStreamStats, stats)
} else {
log.KvDistribution.VEventf(ctx, 4,
"replica %v is not in the send stream stats range=%v",
repl, stats)
}
// We are also not excluding any replicas which weren't included in the
// stats here. If they weren't included it indicates that they were either
Expand Down

0 comments on commit e98f773

Please sign in to comment.