diff --git a/pkg/sql/physicalplan/fake_span_resolver.go b/pkg/sql/physicalplan/fake_span_resolver.go index 08b1cbb36a3d..a27fc76047aa 100644 --- a/pkg/sql/physicalplan/fake_span_resolver.go +++ b/pkg/sql/physicalplan/fake_span_resolver.go @@ -168,10 +168,13 @@ func (fit *fakeSpanResolverIterator) Seek( // replicas. fit.ranges = make([]fakeRange, len(splits)-1) for i := range fit.ranges { + nodes := fit.fsr.nodes + n := len(nodes) + j := fit.rng.Intn(n) fit.ranges[i] = fakeRange{ startKey: splits[i], endKey: splits[i+1], - replica: fit.fsr.nodes[fit.rng.Intn(len(fit.fsr.nodes))], + replica: nodes[j], } }