MB-9879: Do not dump detailed info in concurrency throttle

Today concurrency throttle dump detailed process info if a vb
replicator crashed. The info contains doc contents which is
pointless and could spam logs. This commit removes dumps it
in XDCR logs.

Change-Id: Iebc3610a487c431684586db7bbeaf611b495324b
Reviewed-on: http://review.couchbase.org/31790
Reviewed-by: Junyi Xie <junyi.couchbase@gmail.com>
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
MB-9876: sanitize config as part of dumping guts

And not by error-prone regexps

Change-Id: I692fa9b9e75f0d3cd392f100be792309c0860b12
Reviewed-on: http://review.couchbase.org/31798
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
allow _ for "certificate" parameter that doesn't need checking

I.e. so that things like testing latencies of proxied connections is
easier.

Change-Id: I81bb60458c7090cff9b3514d80a970c7a9021214
Reviewed-on: http://review.couchbase.org/31799
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-9880: use tcp_nodelay on ssl proxy sockets

Because segmentation is already taken care of by our peers.

Change-Id: Ifc5bf9cd4d32b1c49b47bf7ca8aa487a24e9b1bf
Reviewed-on: http://review.couchbase.org/31800
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-9880: improve packetization of xmem batches

Due to details of naggle's algorithm and due to each request being
it's own send call we had sub-optimal packetization of batches of xmem
commands.

I.e. for short request (find_missing_revs), first request is sent in
own separate packet (due to naggle), then second/third delayed
(waiting either full segment or ack to first packet). For large
requests batch last (e.g. doc bodies as part of set_metas), naggle
could cause last write (which tail is usually not full segment) to be
delayed for ack.

We're setting tcp_nodelay on our memcached sockets (or ssl proxy
upstream side). And using delay_send option of erlang to make those
bunches of sends to be sent as single syscall.

Verified using wireshark packet dump to have intended effect for batch
of 3 short find_missing_revs requests.

Change-Id: I31df9821056fa620aa8e2c9a636c4f6b066bac14
Reviewed-on: http://review.couchbase.org/31801
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-9815: refresh certificate when user enters the tab

Change-Id: I24212da591e79391561a84251310de641c1f23e6
Reviewed-on: http://review.couchbase.org/31774
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
reply /pools/default/certificate with raw certificate PEM

Rather than wrapping it in json which is less convenient

Change-Id: I98a418c2b4eb388f6841cf2807e99c4b64ead39a
Reviewed-on: http://review.couchbase.org/31802
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-9829: what's this tooltip

Change-Id: I67662a1d7ea014ba4840e3c0218f2f8a4f921319
Reviewed-on: http://review.couchbase.org/31812
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-9882: do not send certificate if flag is disabled

Change-Id: Ia915de9f6642f2aff99634537335a412642ca9b1
Reviewed-on: http://review.couchbase.org/31813
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
phantomjs deps

Change-Id: I4b304de613a0d66efa74574a10f6b5967130af61
Reviewed-on: http://review.couchbase.org/30965
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
casperjs tests runner with phantomcss

Change-Id: I54df0f3ebd1293d5ceb493df8af398731fe1566a
Reviewed-on: http://review.couchbase.org/30696
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Don't suggest to enable encryption when cluster is not 2.5.

Change-Id: Ib37c6dc72f9ffec858de7b00159c2991558be64b
Reviewed-on: http://review.couchbase.org/31833
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Don't create cluster reference with SSL when cluster is not 2.5.

Change-Id: I5924fe23e14c130cb4e1b62ab5b918fb9a072dee
Reviewed-on: http://review.couchbase.org/31835
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-9887 Allow recursive calls to web cache from ComputeBody().

Change-Id: I17aa45c4208dbec6b72f46f92d8467d608d25eef
Reviewed-on: http://review.couchbase.org/32274
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-9887 Revert "MB-9812: cache enterprise-ness in ns_config"

This reverts commit 2cbe8cf1658bdb9f6b886a2825cee138a66302e8.

Conflicts:
	src/menelaus_web.erl

Change-Id: If31622274bbb15022612b5ebd9b2c2e4736062ed
Reviewed-on: http://review.couchbase.org/32275
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Collect diags even from nodes that are not in nodes_wanted.

To help diagnose cases like MB-9888 where node seems to have got stuck
while leaving the cluster. But diag doesn't contain its process
snapshot because it was removed from nodes_wanted.

Change-Id: I4ca92159c00cfc0195c6f3832cac613fad4fefaf
Reviewed-on: http://review.couchbase.org/32279
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-9745: allow xdcr to recover faster

supervisor2 is built in a way that keeps delaying restart (every time
by configured interfal) until restart can be "fit" into MaxR/MaxT
params of supervisor. With previous settings that only allowed 2
restarts per second.

New code bumps average rate a bit to 5 restarts per second (we might
want to experiment with more), and makes "window" over which restarts
are counted wider.

With our typically large restart intervals (30 seconds) that should
allow more restarts in batch. I.e. if a bunch of vbucket replicators
all failed at about same time, they would be attempted for restart at
about same time. And with larger batch we will be able to allow more
restarts before delaying rest of the "pack" again.

Change-Id: Ia0e5547588958ce9a7fa70f0bae10156deab8610
Reviewed-on: http://review.couchbase.org/31761
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-9745: added xdcr settings for supervisor restart frequency

Change-Id: I4a60e4bebaed069565a217f6919ad304a63298c8
Reviewed-on: http://review.couchbase.org/32281
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-9745: delay second restart as little as possible

Rather than full configured restart delay. Otherwise with default
setting of 30 seconds we will only attempt restarts at intervals that
are multiple of 30 seconds.

This is achieved via supervisor2 feature of restart delay 0. Which is
implemented to wait until oldest restart expires.

This is then used to pass 0 as delay for second restart attempt.

Change-Id: Ib046de2e76d9c3c6f2865ee85b5eb53f903f0150
Reviewed-on: http://review.couchbase.org/31762
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-9886 Correctly update certificate and private key file.

Change-Id: Icb010dda8571525ba4d9c99284b8a23201524c4f
Reviewed-on: http://review.couchbase.org/32339
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>