Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

Fix wrong error handling in volume.tier.upload when stream == nil but copyErr != nil (#6867)

NyaMisty53e5c845233c
diff --git a/weed/shell/command_volume_tier_upload.go b/weed/shell/command_volume_tier_upload.go
index 5ef1c5209e..7eff20876d 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 {