MB-11755 Receive memcached messages in bulk

Receive worker in DCP client handled memcached messages
individually, reading header first and any extra bytes
as indicated in header. This resulted in making several
thousands of tcp receive calls per design doc and
resulted in timeouts while handling stat responses from
memcached. This behavior is modified to receive all the
available data for memcached from socket and process each
individual response from the stored binary, which results
in far few tcp receive calls. Socket connection is made
active and buffer size is set to 64K, same as TCP window
size. More than 2x increase in speed is observed for
accesses to stat responses from memcached.

Change-Id: I5b25f3ed15b6825b8e88fac6e1eb4d1e5dbe3c5f
Reviewed-on: http://review.couchbase.org/40570
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
Tested-by: Harsha H S <hhs.couchbase@gmail.com>
Make test logging more verbose

With the `--verbose` set the test logging output is more verbose.
The output on the screen is still the same it only changes what
gets written to the log file.

Change-Id: Iedaf4612d406450a2fc25e6066e325aa137915cf
Reviewed-on: http://review.couchbase.org/42893
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
MB-12048: Add test for upgrading header from 2.x to 3.x

There was a unit test missing that the upgrading from a Couchbase 2.x
to a 3.x view file really works.

Change-Id: I819f7a1594e73765223871da5f1652826f1b926c
Reviewed-on: http://review.couchbase.org/42933
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Nimish Gupta <nimish@couchbase.com>
Tested-by: Volker Mische <volker.mische@gmail.com>
MB-12572 Sync the view group after upgrade

During offline upgrade of couchbase, if seqs are empty([]) in the
group, initial build will happen after upgrade and that will set
partition version list to nil.We should sync the group after upgrading
the header, so that partition version list will not be nil after
initial build.

Change-Id: I3eb5114d69dc2c8087310b59d28ff3e01e6ef5e2
Reviewed-on: http://review.couchbase.org/43048
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: buildbot <build@couchbase.com>
MB-11917 Async couch_view_parser implementation

Scheduler collapse in Erlang R16 is observed due to changes made
in R16 version with regard to erlang thread scheduler in general
and to scheduling NIF threads in particular. couch_view_parser is
a json stream parser NIF and takes variable amount of time to parse
incoming data depending on the incoming stream length. This resulted
in reporting improper reduction count to erlang scheduler, which in
turn caused scheduler collapse. This NIF is now implemented in
asynchronous fashion, where NIF queues the incoming tasks and returns
to erlang world immediately.

Change-Id: I9e87fe63b78b10a31aba70aba31913d60331b5d7
Reviewed-on: http://review.couchbase.org/42821
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
Tested-by: Harsha H S <hhs.couchbase@gmail.com>
do not return url in the "from" field of view_merger error record

because it can contain user:pasword@ and overall contains too much
internal info for user to know

return host:port instead so the user knows which node had a problem

Change-Id: Ia7d401ba70161cf79afabe899b0e24e6331c30a2
Reviewed-on: http://review.couchbase.org/43382
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
MB-12697 Serialize parse_json requests chunks per query context

The order of processing json parsing request chunks
was assigned randomly to an execution thread which
resulted in lexical error while processing json
parsing request during view querying. It is now
serialized, such that the request chunks per query
is processed in the same order of their arrival by
queueing every chunk to same execution thread.
However different query requests are assigned
randomly to a thread in the thread pool.

Change-Id: I16c89f7d4d422e9521ffc2a98d1d035b40e9b0fa