Details
-
Bug
-
Resolution: Fixed
-
Critical
-
6.0.0
-
Untriaged
-
Unknown
Description
Issue can be reproduced using the following steps:
a. Setup a 2 node cluster: 1 kv+n1ql, 1 index
b. Load the below JSON document in bucket "default"
---------------------------------------
{ "a": "Hello", "b": "Test\u0000Unicode" }--------------------------------------
c. Create the following index:
CREATE INDEX `index_1` ON `default`(`b`,`a` DESC)
After the create index statement is issued, indexer crashes. The stack trace is as under:
panic: runtime error: slice bounds out of rangegoroutine 238 [running]: github.com/couchbase/indexing/secondary/collatejson.(*Codec).extractEncodedField(0xc0001bcae0, 0xc004022000, 0x0, 0x3902, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /Users/varunv/couchbase/mad-hatter/goproj/src/github.com/couchbase/indexing/secondary/collatejson/desc.go:157 +0x1be3 github.com/couchbase/indexing/secondary/collatejson.(*Codec).ReverseCollate(0xc0001bcae0, 0xc004022000, 0xb1, 0x3902, 0xc00014bc3c, 0x4, 0x4, 0x947bf8fa, 0xc004e7ba98, 0x487ae81) /Users/varunv/couchbase/mad-hatter/goproj/src/github.com/couchbase/indexing/secondary/collatejson/desc.go:14 +0x1ba github.com/couchbase/indexing/secondary/indexer.NewSecondaryIndexEntry2(0xc003f8ba40, 0xb1, 0xc0, 0xc007389110, 0x2a, 0x30, 0xbc85effeff00, 0x1, 0xc00014bc3c, 0x4, ...) /Users/varunv/couchbase/mad-hatter/goproj/src/github.com/couchbase/indexing/secondary/indexer/index_entry.go:171 +0x313 github.com/couchbase/indexing/secondary/indexer.NewSecondaryIndexEntry(0xc003f8ba40, 0xb1, 0xc0, 0xc007389110, 0x2a, 0x30, 0xcbb6600, 0x1, 0xc00014bc3c, 0x4, ...) /Users/varunv/couchbase/mad-hatter/goproj/src/github.com/couchbase/indexing/secondary/indexer/index_entry.go:123 +0xfa github.com/couchbase/indexing/secondary/indexer.(*memdbSlice).insertSecIndex(0xc003e44380, 0xc003f8ba40, 0xb1, 0xc0, 0xc007389110, 0x2a, 0x30, 0x3, 0xc008671920, 0x14a73b40) /Users/varunv/couchbase/mad-hatter/goproj/src/github.com/couchbase/indexing/secondary/indexer/memdb_slice_impl.go:450 +0x1c3 github.com/couchbase/indexing/secondary/indexer.(*memdbSlice).insert(0xc003e44380, 0xc003f8ba40, 0xb1, 0xc0, 0xc007389110, 0x2a, 0x30, 0x3, 0xc008671920, 0x1) /Users/varunv/couchbase/mad-hatter/goproj/src/github.com/couchbase/indexing/secondary/indexer/memdb_slice_impl.go:421 +0x151 github.com/couchbase/indexing/secondary/indexer.(*memdbSlice).handleCommandsWorker(0xc003e44380, 0x3) /Users/varunv/couchbase/mad-hatter/goproj/src/github.com/couchbase/indexing/secondary/indexer/memdb_slice_impl.go:380 +0x561 created by github.com/couchbase/indexing/secondary/indexer.NewMemDBSlice /Users/varunv/couchbase/mad-hatter/goproj/src/github.com/couchbase/indexing/secondary/indexer/memdb_slice_impl.go:252 +0x9fa |
Attachments
Issue Links
- backports to
-
MB-33497 [BP 6.0.2] Indexer crashes when using unicode special characters and index is created using DESC
- Closed