Skip to content

Commit

Permalink
Merge pull request #100495 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-23.1-100204

release-23.1: physicalplan: debugging for segfault in fakeSpanResolverIterator.Seek
  • Loading branch information
michae2 authored Apr 3, 2023
2 parents 3cf0a22 + fba8539 commit f7befb7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/sql/physicalplan/fake_span_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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],
}
}

Expand Down

0 comments on commit f7befb7

Please sign in to comment.