aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_volume_tier_upload.go
diff options
context:
space:
mode:
authorNyaMisty <gyc990326@gmail.com>2024-06-03 05:15:39 +0800
committerGitHub <noreply@github.com>2024-06-02 14:15:39 -0700
commite1c671c02833573075b2ab49b879c0bec7428969 (patch)
treec03a634179aed970c81a435cf0f601b2154c0810 /weed/shell/command_volume_tier_upload.go
parentf2a37933b1ffa0d3b60df3a24ec201a3dba2a6cd (diff)
downloadseaweedfs-e1c671c02833573075b2ab49b879c0bec7428969.tar.xz
seaweedfs-e1c671c02833573075b2ab49b879c0bec7428969.zip
Fix volume.tier.upload nil pointer panic (#5634)
Diffstat (limited to 'weed/shell/command_volume_tier_upload.go')
-rw-r--r--weed/shell/command_volume_tier_upload.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/shell/command_volume_tier_upload.go b/weed/shell/command_volume_tier_upload.go
index c109d59d8..6932317ab 100644
--- a/weed/shell/command_volume_tier_upload.go
+++ b/weed/shell/command_volume_tier_upload.go
@@ -139,6 +139,12 @@ 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
+ }
var lastProcessed int64
for {
resp, recvErr := stream.Recv()