mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-08 02:45:48 +08:00
add volume number param in assign operation
This commit is contained in:
@@ -59,8 +59,11 @@ func (vg *VolumeGrowth) findVolumeCount(copyCount int) (count int) {
|
||||
return
|
||||
}
|
||||
|
||||
func (vg *VolumeGrowth) AutomaticGrowByType(option *VolumeGrowOption, grpcDialOption grpc.DialOption, topo *Topology) (count int, err error) {
|
||||
count, err = vg.GrowByCountAndType(grpcDialOption, vg.findVolumeCount(option.ReplicaPlacement.GetCopyCount()), option, topo)
|
||||
func (vg *VolumeGrowth) AutomaticGrowByType(option *VolumeGrowOption, grpcDialOption grpc.DialOption, topo *Topology, targetCount int) (count int, err error) {
|
||||
if targetCount == 0 {
|
||||
targetCount = vg.findVolumeCount(option.ReplicaPlacement.GetCopyCount())
|
||||
}
|
||||
count, err = vg.GrowByCountAndType(grpcDialOption, targetCount, option, topo)
|
||||
if count > 0 && count%option.ReplicaPlacement.GetCopyCount() == 0 {
|
||||
return count, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user