The 3.1.3 (i.e. before the DCP churn) didn't ever notify from
streamRequest, so that is reverted and helps to bring
view_query latency down (view engine is constantly creating
streams).
A second tweak is to not call stream->next whilst holding
the streamMutex. This can block streamRequest again
affecting the view-engine's DCP stream requests.
Change-Id: I5b57fd7998003251fb32897f37c8a2f15f687a13
Reviewed-on: http://review.couchbase.org/60352
Reviewed-by: Manu Dhundi <manu@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
Well-Formed: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
static_cast<ActiveStream*>(streams[vbucket].get())->setActive();
}
- notifyStreamReady(vbucket, false/*unused for DCP*/);
+ ready.pushUnique(vbucket);
if (add_vb_conn_map) {
connection_t conn(this);
}
DcpResponse* op = NULL;
+ stream_t stream;
{
ReaderLockHolder rlh(streamsMutex);
std::map<uint16_t, stream_t>::iterator it = streams.find(vbucket);
if (it == streams.end()) {
continue;
}
- op = it->second->next();
+ stream.reset(it->second);
}
+ op = stream->next();
+
if (!op) {
// stream is empty, try another vbucket.
continue;