math/rand => math/rand/v2
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user