From 105578a2f2425b568abaa032cd9fb3f744207a92 Mon Sep 17 00:00:00 2001 From: chrislu Date: Fri, 1 Apr 2022 20:25:35 -0700 Subject: [PATCH] skip pinging self for master and volume server --- weed/shell/command_cluster_check.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/weed/shell/command_cluster_check.go b/weed/shell/command_cluster_check.go index 3899cdc9a..a050c3f12 100644 --- a/weed/shell/command_cluster_check.go +++ b/weed/shell/command_cluster_check.go @@ -99,6 +99,9 @@ func (c *commandClusterCheck) Do(args []string, commandEnv *CommandEnv, writer i // check between masters for _, sourceMaster := range masters { for _, targetMaster := range masters { + if sourceMaster == targetMaster { + continue + } fmt.Fprintf(writer, "checking master %s to %s ... ", string(sourceMaster), string(targetMaster)) err := pb.WithMasterClient(false, sourceMaster, commandEnv.option.GrpcDialOption, func(client master_pb.SeaweedClient) error { _, err := client.Ping(context.Background(), &master_pb.PingRequest{ @@ -175,6 +178,9 @@ func (c *commandClusterCheck) Do(args []string, commandEnv *CommandEnv, writer i // check between volume servers for _, sourceVolumeServer := range volumeServers { for _, targetVolumeServer := range volumeServers { + if sourceVolumeServer == targetVolumeServer { + continue + } fmt.Fprintf(writer, "checking volume server %s to %s ... ", string(sourceVolumeServer), string(targetVolumeServer)) err := pb.WithVolumeServerClient(false, sourceVolumeServer, commandEnv.option.GrpcDialOption, func(client volume_server_pb.VolumeServerClient) error { _, err := client.Ping(context.Background(), &volume_server_pb.PingRequest{ @@ -191,12 +197,9 @@ func (c *commandClusterCheck) Do(args []string, commandEnv *CommandEnv, writer i } } - // check between filers + // check between filers, and need to connect to itself for _, sourceFiler := range filers { for _, targetFiler := range filers { - if sourceFiler == targetFiler { - continue - } fmt.Fprintf(writer, "checking filer %s to %s ... ", string(sourceFiler), string(targetFiler)) err := pb.WithFilerClient(false, sourceFiler, commandEnv.option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error { _, err := client.Ping(context.Background(), &filer_pb.PingRequest{