Skip to content

Commit 14da968

Browse files
colexecerror: allow-list vecindex packages for panic catching
Previously, panics originating from the vecindex packages were not in the colexecerror allow-list, causing them to crash the server instead of being returned as SQL errors. For example, a dimension mismatch query against a vector index would bring down the node. The vecindex search path does not manipulate shared state or hold in-memory locks in production (it uses KV-layer locking via vecstore), so it is safe to catch these panics. Caught panics are returned as assertion errors with sentry reports, preserving bug visibility without crashing the server. Resolves: #146694 Epic: none Release note: None Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
1 parent 18eb14f commit 14da968

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

pkg/sql/colexecerror/error.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,13 @@ func CatchVectorizedRuntimeError(operation func()) (retErr error) {
170170
// Multiple actual packages can have the same prefix as a single constant string
171171
// defined below, but all of such packages are allowed to be caught from.
172172
const (
173-
colPackagesPrefix = "github.com/cockroachdb/cockroach/pkg/col"
174-
encodingPackagePrefix = "github.com/cockroachdb/cockroach/pkg/util/encoding"
175-
execinfraPackagePrefix = "github.com/cockroachdb/cockroach/pkg/sql/execinfra"
176-
sqlColPackagesPrefix = "github.com/cockroachdb/cockroach/pkg/sql/col"
177-
sqlRowPackagesPrefix = "github.com/cockroachdb/cockroach/pkg/sql/row"
178-
sqlSemPackagesPrefix = "github.com/cockroachdb/cockroach/pkg/sql/sem"
173+
colPackagesPrefix = "github.com/cockroachdb/cockroach/pkg/col"
174+
encodingPackagePrefix = "github.com/cockroachdb/cockroach/pkg/util/encoding"
175+
execinfraPackagePrefix = "github.com/cockroachdb/cockroach/pkg/sql/execinfra"
176+
sqlColPackagesPrefix = "github.com/cockroachdb/cockroach/pkg/sql/col"
177+
sqlRowPackagesPrefix = "github.com/cockroachdb/cockroach/pkg/sql/row"
178+
sqlSemPackagesPrefix = "github.com/cockroachdb/cockroach/pkg/sql/sem"
179+
sqlVecindexPackagePrefix = "github.com/cockroachdb/cockroach/pkg/sql/vecindex"
179180
// When running BenchmarkCatchVectorizedRuntimeError under bazel, the
180181
// repository prefix is missing.
181182
testSqlColPackagesPrefix = "pkg/sql/col"
@@ -217,6 +218,7 @@ func shouldCatchPanic(panicEmittedFrom string) bool {
217218
strings.HasPrefix(panicEmittedFrom, sqlColPackagesPrefix) ||
218219
strings.HasPrefix(panicEmittedFrom, sqlRowPackagesPrefix) ||
219220
strings.HasPrefix(panicEmittedFrom, sqlSemPackagesPrefix) ||
221+
strings.HasPrefix(panicEmittedFrom, sqlVecindexPackagePrefix) ||
220222
strings.HasPrefix(panicEmittedFrom, testSqlColPackagesPrefix)
221223
}
222224

0 commit comments

Comments
 (0)