MB-12197: dump all backtraces on slow bucket shutdown

To diagnose the issue in MB.

Change-Id: I5d33cc815ceba43bf5ca898bbdaeca3fc2842f3a
Reviewed-on: http://review.couchbase.org/41463
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-12197: made terminate_and_wait work even for normal reason

When exit is send with reason normal, it gets ignored if child is not
trapping exits.

Recent change of dcp_replicator childs to not trap exits caused
condition where terminate with reason normal got stuck because of
normal exit being ignored.

This commit maps normal to shutdown and fixes MB.

Change-Id: I913814746f24446532fc0462b208f527993f9900
Reviewed-on: http://review.couchbase.org/41474
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
spawn cbq-engine if ENABLE_QUERY environment variable is defined

This is initial and simplistic integration of query engine into
couchbase. It does nothing else but spawns cbq-engine on every
node. cluster_run case is taken care of as well.

Change-Id: I9ae49132e86859986e2f813f0906374159b9e078
Reviewed-on: http://review.couchbase.org/41573
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
advertise n1ql service port in terse bucket info

Change-Id: I0f8c5b23efb51a01a9a691cda32fbacd261064a3
Reviewed-on: http://review.couchbase.org/41574
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
added initial impl. of /pools/default/nodeServices endpoint

nodeServices allows clients to figure out all services of all nodes
without having to specify any bucket. This might be particularly
useful for niql.

Change-Id: I79bf9dfd82023c7cdd462dbf6c5110f7c0cbb24a
Reviewed-on: http://review.couchbase.org/41575
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
AngularJS: servers section

Change-Id: I49d6f9840fb8e16c8e1dd83d54b2319ce9a79f9f
Reviewed-on: http://review.couchbase.org/41019
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
remove mccouch notification constant definitions

because mccouch is gone

Change-Id: I7374c10dee313d4c7fddf0dfedfc53289851db4b
Reviewed-on: http://review.couchbase.org/41586
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
dropped mccouch_port config

Change-Id: I597ad153d54771dec2d8a20b0fff0e37786f0362
Reviewed-on: http://review.couchbase.org/41587
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
MB-12238: set timeout of 10 minutes on xmem requests

As another measure against possible issues when NAT between DCs
forgets about our connections. With this patch, if this happens, xdcr
will still get stuck, but it won't last too long due to timeout. When
timeout hits, affected xdcr replicators will crash and be restarted
have a decent chance of working.

Change-Id: I30e07c1ab8e73a79d5aa0502c3e39e2bb59c7ce0
Reviewed-on: http://review.couchbase.org/41588
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
MB-12238: set SO_KEEPALIVE on xmem and ssl proxy sockets

As another guard against possible issues when NAT forgets about
connections between datacenters.

Change-Id: Ia221bf5ff53fc564ccac1df8edcb02adf8f50084
Reviewed-on: http://review.couchbase.org/41589
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
MB-12050: set C locale for cbcollect_info

Change-Id: Ib189822f56ea2dc52095d5e9535785cd1e9b562b
Reviewed-on: http://review.couchbase.org/41803
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
MB-12288:only allow xdcr-over-ssl proxying to memcached data port

Change-Id: Ied0f2c8e9d01959ca5be34b15b2b47d91d89cac8
Reviewed-on: http://review.couchbase.org/41804
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
added ns_config_default:latest_config_marker()

To have dialyzer-verified way of getting latest-config-marker.

Change-Id: Ibed27dca669abf48e9418e79ee2fcb060ba0aa7a
Reviewed-on: http://review.couchbase.org/42008
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-11924: moved memcached conns. limits to separate config fields

This commit also makes it global config key which appears to be more
practical, while still allowing per-node settings.

We also move memcached.json path to config.

Change-Id: I5133269dc6f433762002d3c87f662ab28e8ac139
Reviewed-on: http://review.couchbase.org/42009
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-11924: added rest api for memcached settings

Change-Id: Ie9c87480682899c6ae0d824f37525814e6f3f518
Reviewed-on: http://review.couchbase.org/42010
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-11924: added ns_memcached api for CMD_CONFIG_{VALIDATE,RELOAD}

Change-Id: Iaf2ed5c81dab5aec216e67e02707a8ee77599e06
Reviewed-on: http://review.couchbase.org/42011
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-11924: moved ns_memcached_sockets_pool earlier in start order

Change-Id: Ie9cc7c0d9dfef893fa5b9c4b3537a9664c55be67
Reviewed-on: http://review.couchbase.org/42013
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-11924: added ns_ports_setup:sync

So that we can wait until current round of ports synchronizations is
complete.

Change-Id: Id9a41e32d8ab7edb1678e084a4b4869718c55880
Reviewed-on: http://review.couchbase.org/42014
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-11924: added feature to prevent auto-starting of child ports

We're going to use it for memcached to give memcached.json config
manager process to do it's magic prior to actually starting memcached.

Change-Id: Ifdba3d4d430604ad1f7f82c7d07a5027e21dbb9c
Reviewed-on: http://review.couchbase.org/42012
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-11924: added memcached_config_mgr

New process is responsible for writing memcached.json and actually
enabling startup of memcached. It also implements support for
reloading memcached config.

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