Skip to content

Commit

Permalink
physicalplan: debugging for segfault in fakeSpanResolverIterator.Seek
Browse files Browse the repository at this point in the history
Break up a line that is segfaulting into several lines, so that we can tell
which part is to blame if it happens again.

Informs: #100051
Informs: #100108

Epic: None

Release note: None
  • Loading branch information
michae2 committed Mar 30, 2023
1 parent 671f0c2 commit fba8539
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 fba8539

Please sign in to comment.