Reputation:
As part of an ETL process, I am attempting to read all document key ids from a Couchbase bucket (Couchbase Enterprise 4.5). This bucket may have tens of millions of documents. To test this (at this stage I'm just trying to see if this approach will be quick enough for our needs), I am setting a large serverSideTimeout value using code like this:
final N1qlParams n1qlParams = N1qlParams.build().serverSideTimeout(1L, TimeUnit.DAYS);
aBucket.query(N1qlQuery.simple("select meta(b).id from `my_bucket` as b", n1qlParams))
This starts to execute, and my subscriber starts getting ids back from the query, but then I get this error:
{"msg":"Index scan timed out - cause: Index scan timed out","code":12015}
I'm not surprised that it's needing to do an index scan, as I am in fact trying to read out everything in the primary index. The obvious related question here about "Index scan timed out" mentions in the comments that there is a setting to adjust the index scan timeout value, but I can't find where this setting is. I've looked in the N1qlParams object, the CouchbaseEnvironment, and on the Index Settings section of the Cluster settings in the Couchbase Admin UI, and I can't find this setting anywhere. How do I set the index scan timeout to a longer value for queries where I'm expecting to do a full index scan?
Upvotes: 1
Views: 1706
Reputation:
As found in a Couchbase forum post, one needs to send an HTTP POST to http://<server>:9102/settings
with content {"indexer.settings.scan_timeout": <new_timeout_in_milliseconds>}
.
It appears that there are many of these low-level index service settings that can be configured using this /settings
page; sending a GET
will retrieve them all with their current values.
Upvotes: 3