MB-6841: [lhttpc] Un-urlencode credentials in urls

Comments in split_credentials correctly indicate that any special
chars need to be 'percent-encoded'. So in order to get their true
values we need to un-encode.

Otherwise there's simply no way to use usernames/passwords with
special characters when doing basic auth via urls.

NOTE: This is same patch as was recently accepted upstream except we don't
have lhttpc's tests. I.e. https://github.com/esl/lhttpc/pull/19

Change-Id: I1ea38d890d3b41e33e813c62deb52166ae7794fe
Reviewed-on: http://review.couchbase.org/21461
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Damien Katz <damien@couchbase.com>
Reviewed-by: Junyi Xie <junyi.couchbase@gmail.com>
MB-6868 Add couch_set_view:get_group_signature/2

So that other components, such as ns_server, can get the
signature of a view group in a very cheap way (get_group_info
is ex+ensive, meant only for debugging).

Change-Id: Ie000a25e2b828a0d9de042701808c15b7f9260ad
Reviewed-on: http://review.couchbase.org/21490
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Damien Katz <damien@couchbase.com>
Add missing file flush call to test 020-btree-basics.t

This caused intermitent failures on slower environments
(example, often in the buildbot).

Change-Id: I5a07bd4fe9115d2cfe37b5c048c43560db81e4fb
Reviewed-on: http://review.couchbase.org/21538
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Damien Katz <damien@couchbase.com>
MB-6866 Use different thresholds for kp and kv nodes

For views, since values are mostly raw JSON, compression
gains are high, therefore chunk threshold (uncompressed
size) can be raised, which decreases the number of kv nodes
in the trees. For kp nodes, because they all have a 1024
bits bitmask in their reductions, their branching factor was
a bit low, which made the trees deeper.

These changes made queries and compaction faster both for
generic btree tests and evperf lucky8 views (lucky8.conf and
lucky8-3d.conf). Inserts and updates also get a small speedup.

Change-Id: I2a94ec6005b881c81fd5295a2c89c7657cc6b19f
Reviewed-on: http://review.couchbase.org/21484
Reviewed-by: Damien Katz <damien@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Farshid Ghods <farshid@couchbase.com>
Tested-by: Farshid Ghods <farshid@couchbase.com>
MB-100 Change log level and unify messages

Ensure all errors are logged at error level and unify
the error and stacktrace messages so that it's easier to
link them when there are multiple requests in parallel
producing errors.

Change-Id: I6380d896ac36513e15cf0df5a2e949fc4ea94aa5
Reviewed-on: http://review.couchbase.org/21541
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Damien Katz <damien@couchbase.com>
MB-6629 Faster index compaction retries

Revert to initial approach where compactor keeps
reading log file until it reaches EOF, instead of
coordinating with the updater regarding where the
EOF is and stop once it reaches that EOF, which
very often no longer matches the real EOF.

Verified with evperf lucky8 test that with this
approach there's no more than 2 to 3 retries, as
opposed to up to ~20 retries with previous approach.
Total compaction time average, and 99% percentile,
is almost half of what it was before during the
lucky8 test run.

Change-Id: I3c893a780a7878080fb366ba72b15e544bb36834
Reviewed-on: http://review.couchbase.org/21516
Reviewed-by: Farshid Ghods <farshid@couchbase.com>
Tested-by: Farshid Ghods <farshid@couchbase.com>
Revert "MB-6629 Faster index compaction retries"

This reverts commit 719e315b3713a91fde0070ed5b2b552afc5aa44e.

Change-Id: I48a351f929d37121682d7303cdaaf530ede59221
Reviewed-on: http://review.couchbase.org/21582
Reviewed-by: Farshid Ghods <farshid@couchbase.com>
Tested-by: Farshid Ghods <farshid@couchbase.com>
MB-6799 Process group update

Before applying the pending transition, process the new
group received from the updater, which is clean. This
ensures we can apply the pending transition immediately.

Change-Id: I2962ae17bd15a7b8a2f13b38f0813632323067f5
Reviewed-on: http://review.couchbase.org/21551
Reviewed-by: Damien Katz <damien@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Debugging nifs: Turn of json parser nif, use pure elrang code

Change-Id: Iaf4594873ae53c014448cd9d34815b80689b3735
Debugging nifs: turn off json collation

Change-Id: Ia1961a150ba64541b9f935fa4c9645cc5503b429
Debugging nifs: turn off snappy compression nif

Change-Id: I277406873ed7299540ebcd08ad81da723f13217b
Debugging nifs: turn off couch_view_parser nif

Change-Id: Idcd1a245a2cea5469f021ba1d030103db4855b3e
Debugging nifs: allow ejson with struct tag for objects

Change-Id: I02e67fcc0129922078c272225eb44ee132860b03