Browse Source
Fix wrong error handling in volume.tier.upload when stream == nil but copyErr != nil (#6867)
pull/6871/head
NyaMisty
4 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
9 additions and
5 deletions
-
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 { |
|
|
|