Release 'view op' on results close

Description

GoCB Query changes are as follows:
GoCBv1 - Query is made when we execute the query, all the results are pulled down and stored in memory and a results iterator is returned so we can work with the results. The query connection is closed as soon as we have all the results in memory.
GoCBv2 - Query is established when we execute the query but rather than storing all results in memory the data is streamed over as we iterate over the results. The connection is only closed when we call Close() on the results.

Currently we have implemented a throttle to limit the number of concurrent view ops / query ops by applying the limit to the Query function(s). However, due to the above changes in V2 this is not adequate as it is only limiting that initial establish. We should instead cover the full window from opening the connection to closing the connection.

Therefore proposed change:

Rather than running releaseViewOp() as part of the Query operation this should be called in the Close() function. This should just mean that we can store the operation (whether in channel form or some sort of function) on gocbRawIterator so we can call that as part of Close().

Should ensure that we still release that view op in the event of some sort of query error too. ie - ensuring in an error we still call Close() and don't just quit out.

 

Activity

Show:

CB robot October 1, 2021 at 11:01 PM

Build sync_gateway-3.0.0-436 contains sync_gateway commit dcbd378 with commit message:
: Release query ops on Close() (#5259)

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Components

Sprint

Fix versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created September 21, 2021 at 4:57 PM
Updated October 5, 2021 at 6:02 PM
Resolved October 1, 2021 at 11:18 PM
Instabug