From 53e5c845233c0823346a237984f868a671e4ba37 Mon Sep 17 00:00:00 2001 From: NyaMisty Date: Mon, 16 Jun 2025 11:28:40 +0800 Subject: [PATCH] Fix wrong error handling in volume.tier.upload when stream == nil but copyErr != nil (#6867) --- weed/shell/command_volume_tier_upload.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/weed/shell/command_volume_tier_upload.go b/weed/shell/command_volume_tier_upload.go index 5ef1c5209..7eff20876 100644 --- a/weed/shell/command_volume_tier_upload.go +++ b/weed/shell/command_volume_tier_upload.go @@ -147,11 +147,15 @@ func uploadDatToRemoteTier(grpcDialOption grpc.DialOption, writer io.Writer, vol KeepLocalDatFile: keepLocalDatFile, }) - if stream == nil && copyErr == nil { - // when the volume is already uploaded, VolumeTierMoveDatToRemote will return nil stream and nil error - // so we should directly return in this case - fmt.Fprintf(writer, "volume %v already uploaded", volumeId) - return nil + if stream == nil { + if copyErr == nil { + // when the volume is already uploaded, VolumeTierMoveDatToRemote will return nil stream and nil error + // so we should directly return in this caseAdd commentMore actions + fmt.Fprintf(writer, "volume %v already uploaded", volumeId) + return nil + } else { + return copyErr + } } var lastProcessed int64 for {