From 7ee1f520a4b1b200fa7ff71e9d22dff903ae59a4 Mon Sep 17 00:00:00 2001 From: rhysm Date: Thu, 4 Jul 2024 10:51:25 +1200 Subject: [PATCH] volume.tier.upload: Fix deleting replicated volumes (#5743) Co-authored-by: Rhys M --- weed/shell/command_volume_tier_upload.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weed/shell/command_volume_tier_upload.go b/weed/shell/command_volume_tier_upload.go index 6932317ab..cb805b0cf 100644 --- a/weed/shell/command_volume_tier_upload.go +++ b/weed/shell/command_volume_tier_upload.go @@ -113,11 +113,14 @@ func doVolumeTierUpload(commandEnv *CommandEnv, writer io.Writer, collection str return fmt.Errorf("copy dat file for volume %d on %s to %s: %v", vid, existingLocations[0].Url, dest, err) } + if keepLocalDatFile { + return nil + } // now the first replica has the .idx and .vif files. // ask replicas on other volume server to delete its own local copy for i, location := range existingLocations { if i == 0 { - break + continue } fmt.Printf("delete volume %d from %s\n", vid, location.Url) err = deleteVolume(commandEnv.option.GrpcDialOption, vid, location.ServerAddress(), false)