Skip to content

Commit

Permalink
use math/rand/v2
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
  • Loading branch information
demmer committed Jul 11, 2024
1 parent f17861b commit b85fc90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions go/vt/vtgate/balancer/balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package balancer
import (
"encoding/json"
"fmt"
"math/rand"
"math/rand/v2"
"net/http"
"sync"

Expand Down Expand Up @@ -176,7 +176,7 @@ func (b *tabletBalancer) Pick(target *querypb.Target, tablets []*discovery.Table

allocationMap, totalAllocation := b.getAllocation(target, tablets)

r := rand.Intn(totalAllocation)
r := rand.IntN(totalAllocation)
for i := 0; i < numTablets; i++ {
flow := allocationMap[tablets[i].Tablet.Alias.Uid]
if r < flow {
Expand Down

0 comments on commit b85fc90

Please sign in to comment.