From 3985b7ba91cf457fd8bb928422eaeb5317d3b2f8 Mon Sep 17 00:00:00 2001 From: Michael Erickson Date: Thu, 30 Mar 2023 12:52:00 -0700 Subject: [PATCH] physicalplan: debugging for segfault in fakeSpanResolverIterator.Seek 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 --- pkg/sql/physicalplan/fake_span_resolver.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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], } }