Browse Source

use math rand v2

pull/6288/head
chrislu 1 month ago
parent
commit
04081128a9
  1. 4
      weed/shell/command_ec_common.go

4
weed/shell/command_ec_common.go

@ -3,7 +3,7 @@ package shell
import ( import (
"context" "context"
"fmt" "fmt"
"math/rand"
"math/rand/v2"
"github.com/seaweedfs/seaweedfs/weed/glog" "github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/operation" "github.com/seaweedfs/seaweedfs/weed/operation"
@ -564,7 +564,7 @@ func pickRackToBalanceShardsInto(rackToEcNodes map[RackId]*EcRack, rackToShardCo
if len(targets) == 0 { if len(targets) == 0 {
return "" return ""
} }
return targets[rand.Intn(len(targets))]
return targets[rand.IntN(len(targets))]
} }
func balanceEcShardsWithinRacks(commandEnv *CommandEnv, allEcNodes []*EcNode, racks map[RackId]*EcRack, collection string, applyBalancing bool) error { func balanceEcShardsWithinRacks(commandEnv *CommandEnv, allEcNodes []*EcNode, racks map[RackId]*EcRack, collection string, applyBalancing bool) error {

Loading…
Cancel
Save