Product: Couchbase Server Component: Query-Service Issue Link: MB-67996 Affects Version: 7.6 Fix Version: 7.6.8
Summary
They Query Service may panic while performing sequential scans.
Symptoms
- Query Service crashes/restarted.
- Query requests in progress may fail.
Triggers
- Performing queries that utilise sequential scans.
Verification
Look for a log message similar to the following in diag.log which indicates the Query Service crashed:
2025-07-23T18:34:51.109+08:00, ns_log:0:info:message(ns_1@<IP) - Service 'n1ql' exited with status 2. Restarting. Messages:
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1e4059e]
goroutine 74914303 [running]:
github.com/couchbase/query/primitives/couchbase.(*vbRangeScan).keyLen(...)
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/primitives/couchbase/memcached_scan.go:1150
github.com/couchbase/query/primitives/couchbase.(*vbRangeScan).readCurrent(0xc0077ae008?)
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/primitives/couchbase/memcached_scan.go:1124 +0x3e
github.com/couchbase/query/primitives/couchbase.(*vbRangeScan).seek(0xc0102ad3b0?, 0xc001c8a914?)
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/primitives/couchbase/memcached_scan.go:1120 +0x326
github.com/couchbase/query/primitives/couchbase.(*seqScan).coordinator(0xc0102ad320, 0xc00071e788, 0x8bb2c97000)
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/primitives/couchbase/memcached_scan.go:726 +0xe85
created by github.com/couchbase/query/primitives/couchbase.(*Bucket).StartKeyScan in goroutine 74912858
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/primitives/couchbase/memcached_scan.go:80 +0x29f
Look for the panic with the following stack in ns_server.query.log that references vbRangeScan:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1e4059e]
goroutine 74914303 [running]:
github.com/couchbase/query/primitives/couchbase.(*vbRangeScan).keyLen(...)
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/primitives/couchbase/memcached_scan.go:1150
github.com/couchbase/query/primitives/couchbase.(*vbRangeScan).readCurrent(0xc0077ae008?)
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/primitives/couchbase/memcached_scan.go:1124 +0x3e
github.com/couchbase/query/primitives/couchbase.(*vbRangeScan).seek(0xc0102ad3b0?, 0xc001c8a914?)
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/primitives/couchbase/memcached_scan.go:1120 +0x326
github.com/couchbase/query/primitives/couchbase.(*seqScan).coordinator(0xc0102ad320, 0xc00071e788, 0x8bb2c97000)
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/primitives/couchbase/memcached_scan.go:726 +0xe85
created by github.com/couchbase/query/primitives/couchbase.(*Bucket).StartKeyScan in goroutine 74912858
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/primitives/couchbase/memcached_scan.go:80 +0x29f
If the panic stack matches the above, this issue is highly likely to have been encountered.
Workarounds
The issue can be avoided by preventing the use of sequential scans.
The best way to do this is by creating either a Primary or secondary index (which will then be used instead of a sequential scan).
Comments
0 comments
Article is closed for comments.