diff options
| author | NyaMisty <gyc990326@gmail.com> | 2024-06-03 05:15:39 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-02 14:15:39 -0700 |
| commit | e1c671c02833573075b2ab49b879c0bec7428969 (patch) | |
| tree | c03a634179aed970c81a435cf0f601b2154c0810 /weed/shell/command_volume_tier_upload.go | |
| parent | f2a37933b1ffa0d3b60df3a24ec201a3dba2a6cd (diff) | |
| download | seaweedfs-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.go | 6 |
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() |
