diff --git a/pkg/sql/physicalplan/fake_span_resolver.go b/pkg/sql/physicalplan/fake_span_resolver.go index 08b1cbb36a3d..dca93c2592e2 100644 --- a/pkg/sql/physicalplan/fake_span_resolver.go +++ b/pkg/sql/physicalplan/fake_span_resolver.go @@ -167,11 +167,15 @@ func (fit *fakeSpanResolverIterator) Seek( // Build ranges corresponding to the fake splits and assign them random // replicas. fit.ranges = make([]fakeRange, len(splits)-1) + // TODO(michae2): Condense this logic when #100051 is fixed. + nodes := fit.fsr.nodes + n := len(nodes) for i := range fit.ranges { + 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], } }