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: cockroachdb#100051
Informs: cockroachdb#100108

Epic: None

Release note: None
  • Loading branch information
michae2 committed Mar 30, 2023
1 parent 3de803f commit 3985b7b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/sql/physicalplan/fake_span_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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],
}
}

Expand Down

0 comments on commit 3985b7b

Please sign in to comment.