skip pinging self for master and volume server

This commit is contained in:
chrislu 2022-04-01 20:25:35 -07:00
parent 4ecba915f3
commit 105578a2f2

View file

@ -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{