volume.tier.upload: Fix deleting replicated volumes (#5743)

Co-authored-by: Rhys M <rhysm@protonmail.com>
This commit is contained in:
rhysm 2024-07-04 10:51:25 +12:00 committed by GitHub
parent 8943a572d8
commit 7ee1f520a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)