Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

use math rand v2

chrislu04081128a915
diff --git a/weed/shell/command_ec_common.go b/weed/shell/command_ec_common.go
index 6e7ad7e43c..7328fffe76 100644
--- a/weed/shell/command_ec_common.go
+++ b/weed/shell/command_ec_common.go
@@ -3,7 +3,7 @@ package shell
import (
"context"
"fmt"
- "math/rand"
+ "math/rand/v2"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/operation"
@@ -564,7 +564,7 @@ func pickRackToBalanceShardsInto(rackToEcNodes map[RackId]*EcRack, rackToShardCo
if len(targets) == 0 {
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 {