diff options
| author | NyaMisty <gyc990326@gmail.com> | 2025-06-16 11:28:40 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-15 20:28:40 -0700 |
| commit | 53e5c845233c0823346a237984f868a671e4ba37 (patch) | |
| tree | 50009852394a4a2895266851fff306646938a196 /weed/shell/command_volume_tier_upload.go | |
| parent | cdc543aa9ea012e2e04de04b2433505214694abf (diff) | |
| download | seaweedfs-53e5c845233c0823346a237984f868a671e4ba37.tar.xz seaweedfs-53e5c845233c0823346a237984f868a671e4ba37.zip | |
Fix wrong error handling in volume.tier.upload when stream == nil but copyErr != nil (#6867)
Diffstat (limited to 'weed/shell/command_volume_tier_upload.go')
| -rw-r--r-- | weed/shell/command_volume_tier_upload.go | 14 |
1 files 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 { |
