Skip to content

Commit

Permalink
storage: improve replica GC queue log visibility
Browse files Browse the repository at this point in the history
Convert the log.V calls to log.VEvent calls in the replica GC queue so
that they show up in the debug enqueue page.

Release note: None
  • Loading branch information
benesch committed Oct 20, 2018
1 parent dd15397 commit eacea57
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions pkg/storage/replica_gc_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,15 @@ func (rgcq *replicaGCQueue) process(
// but also on how good a job the queue does at inspecting every
// Replica (see #8111) when inactive ones can be starved by
// event-driven additions.
if log.V(1) {
log.Infof(ctx, "not gc'able, replica is still in range descriptor: %v", currentDesc)
}
log.VEventf(ctx, 1, "not gc'able, replica is still in range descriptor: %v", currentDesc)
if err := repl.setLastReplicaGCTimestamp(ctx, repl.store.Clock().Now()); err != nil {
return err
}
} else if desc.RangeID == replyDesc.RangeID {
// We are no longer a member of this range, but the range still exists.
// Clean up our local data.
rgcq.metrics.RemoveReplicaCount.Inc(1)
if log.V(1) {
log.Infof(ctx, "destroying local data")
}
log.VEventf(ctx, 1, "destroying local data")
if err := repl.store.RemoveReplica(ctx, repl, replyDesc.NextReplicaID, RemoveOptions{
DestroyData: true,
}); err != nil {
Expand Down Expand Up @@ -261,10 +257,8 @@ func (rgcq *replicaGCQueue) process(
return errors.Errorf("expected 1 range descriptor, got %d", len(rs))
}
if leftReplyDesc := rs[0]; !leftDesc.Equal(leftReplyDesc) {
if log.V(1) {
log.Infof(ctx, "left neighbor %s not up-to-date with meta descriptor %s; cannot safely GC range yet",
leftDesc, leftReplyDesc)
}
log.VEventf(ctx, 1, "left neighbor %s not up-to-date with meta descriptor %s; cannot safely GC range yet",
leftDesc, leftReplyDesc)
return nil
}
}
Expand Down

0 comments on commit eacea57

Please sign in to comment.