@siri @geraldss
We are facing issues with the default 10K size. How do you recommend to optimize/set the size based on following?
This is an index which is used
CREATE INDEX
ctx2-indexON
activity((-
createdAt),(distinct (array
tfor
twithin
ctx end)))
If I do a query which hitting given index, the response is: (it is quite nondeterministic)
[
{
"code": 5000,
"msg": "dial tcp 127.0.0.1:9101: connection refused from 127.0.0.1:9101 - cause: dial tcp 127.0.0.1:9101: connection refused from 127.0.0.1:9101",
"query_from_user": "SELECT RAW META().id FROM `activity` USE INDEX (`ctx2-index`)\nWHERE -createdAt IS NOT NULL AND ANY t WITHIN `ctx` SATISFIES t LIKE 'searchTerm' END \nLIMIT 100 OFFSET 0"
}
]
Indexer Log
panic: runtime error: slice bounds out of range
goroutine 161 [running]:
panic(0xf293a0, 0xc820016050)
/home/couchbase/.cbdepscache/exploded/x86_64/go-1.6/go/src/runtime/panic.go:464 +0x3e6 fp=0xc8200e1990 sp=0xc8200e1910
runtime.panicslice()
/home/couchbase/.cbdepscache/exploded/x86_64/go-1.6/go/src/runtime/panic.go:21 +0x49 fp=0xc8200e19b8 sp=0xc8200e1990
github.com/couchbase/indexing/secondary/collatejson.(*Codec).code2json(0xc8200bb6a0, 0xc824916018, 0x2fcf, 0x101a, 0xc8248e2000, 0x13, 0x4000, 0x0, 0x0, 0x0, ...)
/home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/indexing/secondary/collatejson/collate.go:361 +0x159a fp=0xc8200e1b80 sp=0xc8200e19b8
github.com/couchbase/indexing/secondary/collatejson.(*Codec).Decode(0xc8200bb6a0, 0xc824916004, 0x2fe3, 0x3ffc, 0xc8248e2000, 0x0, 0x4000, 0x0, 0x0, 0x0, ...)
/home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/indexing/secondary/collatejson/collate.go:169 +0xb7 fp=0xc8200e1c00 sp=0xc8200e1b80
github.com/couchbase/indexing/secondary/indexer.secondaryIndexEntry.ReadSecKey(0xc824916004, 0x2fec, 0x3ffc, 0xc8248e2000, 0x0, 0x4000, 0x0, 0x0, 0x0, 0x0, ...)
/home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/indexing/secondary/indexer/index_entry.go:217 +0x1fc fp=0xc8200e1cd8 sp=0xc8200e1c00
github.com/couchbase/indexing/secondary/indexer.siSplitEntry(0xc824916004, 0x2fec, 0x3ffc, 0xc8248e2000, 0x0, 0x4000, 0x0, 0x0, 0x0, 0x0, ...)
/home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/indexing/secondary/indexer/scan_pipeline.go:238 +0xbd fp=0xc8200e1da8 sp=0xc8200e1cd8
github.com/couchbase/indexing/secondary/indexer.(*IndexScanDecoder).Routine(0xc82015c870, 0x0, 0x0)
/home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/indexing/secondary/indexer/scan_pipeline.go:161 +0x466 fp=0xc8200e1ef8 sp=0xc8200e1da8
github.com/couchbase/indexing/secondary/pipeline.(*Pipeline).runIt.func1(0xc8232c5d20, 0xc8237f1580)
/home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/indexing/secondary/pipeline/pipeline.go:75 +0x5d fp=0xc8200e1f90 sp=0xc8200e1ef8
runtime.goexit()
/home/couchbase/.cbdepscache/exploded/x86_64/go-1.6/go/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc8200e1f98 sp=0xc8200e1f90
created by github.com/couchbase/indexing/secondary/pipeline.(*Pipeline).runIt
/home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/indexing/secondary/pipeline/pipeline.go:80 +0x62
goroutine 1 [select]:
runtime.gopark(0x1322e00, 0xc826409228, 0x10bbef8, 0x6, 0x18, 0x2)
/home/couchbase/.cbdepscache/exploded/x86_64/go-1.6/go/src/runtime/proc.go:262 +0x163 fp=0xc826408fc0 sp=0xc826408f98
runtime.selectgoImpl(0xc826409228, 0x0, 0x18)
/home/couchbase/.cbdepscache/exploded/x86_64/go-1.6/go/src/runtime/select.go:392 +0xa67 fp=0xc826409180 sp=0xc826408fc0
runtime.selectgo(0xc826409228)
/home/couchbase/.cbdepscache/exploded/x86_64/go-1.6/go/src/runtime/select.go:215 +0x12 fp=0xc8264091a0 sp=0xc826409180
github.com/couchbase/indexing/secondary/indexer.(*indexer).run(0xc8201078c0)
/home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/indexing/secondary/indexer/indexer.go:479 +0x292 fp=0xc8264092f8 sp=0xc8264091a0
github.com/couchbase/indexing/secondary/indexer.NewIndexer(0xc820114930, 0x0, 0x0, 0x0, 0x0)
/home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/indexing/secondary/indexer/indexer.go:365 +0x3c0e fp=0xc826409c20 sp=0xc8264092f8
main.main()
/home/couchbase/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/indexing/secondary/cmd/indexer/main.go:153 +0x15b5 fp=0xc826409f40 sp=0xc826409c20
runtime.main()
/home/couchbase/.cbdepscache/exploded/x86_64/go-1.6/go/src/runtime/proc.go:188 +0x2b0 fp=0xc826409f90 sp=0xc826409f40
runtime.goexit()
/home/couchbase/.cbdepscache/exploded/x86_64/go-1.6/go/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc826409f98 sp=0xc826409f90
goroutine 17 [syscall, locked to thread]:
These are an example of indexed docs:
ctx is an dynamic object. It needs to be indexed and search-able by values. Properties name can be ignored.
{
"ctx" : {
"randomKey" : "randomValue",
"randomKey2" : {
"innerKey" : "value",
"arrayKey" : ["A","B"]
}
}
},
{
"ctx" : {
"nexKey" : "val",
"num" : 123
}
}
I’ve changed the max_array_seckey_size to 20K - but some queries are still failing. (Using Couchbase 4.5 Community - the latest stable )
What do you recommend in this case? How should be calculated max_array_seckey_size ? A bucket contains ~2M documents. Just values needs to be search-able, keys can be ignored.