diff options
| author | chrislu <chris.lu@gmail.com> | 2024-08-29 09:52:21 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-08-29 09:52:21 -0700 |
| commit | a4b25a642d6b2ed6056496ffddce864100932f3d (patch) | |
| tree | 181b5690d9d257e2833b257992be6d29f78fb817 /weed/topology/volume_layout.go | |
| parent | ded5e084ea324c074e61bc74bba0bfaeb2af88d7 (diff) | |
| download | seaweedfs-a4b25a642d6b2ed6056496ffddce864100932f3d.tar.xz seaweedfs-a4b25a642d6b2ed6056496ffddce864100932f3d.zip | |
math/rand => math/rand/v2
Diffstat (limited to 'weed/topology/volume_layout.go')
| -rw-r--r-- | weed/topology/volume_layout.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/topology/volume_layout.go b/weed/topology/volume_layout.go index 3fab74843..89378ba97 100644 --- a/weed/topology/volume_layout.go +++ b/weed/topology/volume_layout.go @@ -3,7 +3,7 @@ package topology import ( "fmt" "github.com/seaweedfs/seaweedfs/weed/stats" - "math/rand" + "math/rand/v2" "sync" "sync/atomic" "time" @@ -296,7 +296,7 @@ func (vl *VolumeLayout) PickForWrite(count uint64, option *VolumeGrowOption) (vi return 0, 0, nil, true, fmt.Errorf("%s in volume layout", noWritableVolumes) } if option.DataCenter == "" && option.Rack == "" && option.DataNode == "" { - vid := vl.writables[rand.Intn(lenWriters)] + vid := vl.writables[rand.IntN(lenWriters)] locationList = vl.vid2location[vid] if locationList == nil || len(locationList.list) == 0 { return 0, 0, nil, false, fmt.Errorf("Strangely vid %s is on no machine!", vid.String()) |
