Skip to content

Commit

Permalink
cli: tweak slow decommission message
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
cameronnunez committed Apr 5, 2022
1 parent b7b37f4 commit a21eab1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/cli/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ func runDecommissionNodeImpl(
}

if numReplicaReport > 0 {
printDecommissionReplicas(ctx, *resp)
printDecommissionReplicas(*resp)
}

if !reflect.DeepEqual(&prevResponse, resp) {
Expand Down Expand Up @@ -622,13 +622,13 @@ func printDecommissionStatus(resp serverpb.DecommissionStatusResponse) error {
clisqlexec.NewRowSliceIter(decommissionResponseValueToRows(resp.Status), decommissionResponseAlignment()))
}

func printDecommissionReplicas(ctx context.Context, resp serverpb.DecommissionStatusResponse) {
fmt.Fprintln(stderr, "\npossible decommission stall detected; reporting decommissioning replicas")
func printDecommissionReplicas(resp serverpb.DecommissionStatusResponse) {
fmt.Fprintln(stderr, "\npossible decommission stall detected")

for _, nodeStatus := range resp.Status {
for _, replica := range nodeStatus.ReportedReplicas {
fmt.Fprintf(stderr,
"n%d still has replica id %d for range r%d",
"n%d still has replica id %d for range r%d\n",
nodeStatus.NodeID,
replica.ReplicaID,
replica.RangeID,
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2389,7 +2389,7 @@ func (s *adminServer) decommissionStatusHelper(
// numReplicaReport is the number of replicas reported for each node.
var replicasToReport map[roachpb.NodeID][]*serverpb.DecommissionStatusResponse_Replica
if numReplicaReport > 0 {
log.Ops.Warning(ctx, "possible decommission stall detected; reporting decommissioning replicas")
log.Ops.Warning(ctx, "possible decommission stall detected")
replicasToReport = make(map[roachpb.NodeID][]*serverpb.DecommissionStatusResponse_Replica)
}

Expand Down

0 comments on commit a21eab1

Please sign in to comment.