master: delete partially created replicated volumes during volume growth

fix https://github.com/seaweedfs/seaweedfs/discussions/3792#discussioncomment-3973120
This commit is contained in:
chrislu
2022-10-26 12:32:24 -07:00
parent e90ad660ff
commit 1e0d64c048
2 changed files with 39 additions and 9 deletions

View File

@@ -30,3 +30,15 @@ func AllocateVolume(dn *DataNode, grpcDialOption grpc.DialOption, vid needle.Vol
})
}
func DeleteVolume(dn *DataNode, grpcDialOption grpc.DialOption, vid needle.VolumeId) error {
return operation.WithVolumeServerClient(false, dn.ServerAddress(), grpcDialOption, func(client volume_server_pb.VolumeServerClient) error {
_, allocateErr := client.VolumeDelete(context.Background(), &volume_server_pb.VolumeDeleteRequest{
VolumeId: uint32(vid),
})
return allocateErr
})
}