MB-10908 Hibernate error_logger.

Change-Id: I6499660fd053d5e5d84a656622f90b746e4e79eb
Reviewed-on: http://review.couchbase.org/36115
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-10908 Prevent error_logger from logging huge terms.

Change-Id: I1c376d3da74fd3ac526fe3c78bb38da7ea0aa01b
Reviewed-on: http://review.couchbase.org/36116
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-10721 attach ns_server-ui header to every request issued by ui

convenient for any ui specific customizations in rest api

Change-Id: I884b09eb7cb4ba4c8695ed5043c4c021b21d05a4
Reviewed-on: http://review.couchbase.org/36119
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-10721 ignore basic auth headers for ui issued xhrs

UI doesn't use basic auth, but the browser can still attach
basic auth header which will confuse token based auth

Change-Id: Iba2c256c51d8102593f0d882ae164bfa77a605d6
Reviewed-on: http://review.couchbase.org/36120
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-10721 don't use bucket auth for ui issued xhr's

UI doesn't use bucket auth, but the existence of the bucket without
password can allow the access to some url's even with expired token
which we want to prevent

Change-Id: I16d7635b3509a1da275272adad4289454710d4c5
Reviewed-on: http://review.couchbase.org/36121
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Revert "MB-10721 limit the UI to ro_admin or admin access to /pools/default"

This reverts commit 342aebf2e5eef2501b1457fe5e659cd8d0b16ae4.

not needed if http://review.couchbase.org/36121/ will be submitted

Change-Id: Iba4a4901a859a738266f07f6b16bf731fe1d3017
Reviewed-on: http://review.couchbase.org/36122
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-10869: fixed look of add server dialog

Change-Id: Ic94242cd7298fbb34cac891625313079f26768ae
Reviewed-on: http://review.couchbase.org/36097
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Handle absence of repl_type in bucket config during upr upgrade.

Change-Id: I5a388096c89ac10230b128c7eba563aaa3363571
Reviewed-on: http://review.couchbase.org/36155
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
Revert "Revert "Soft-delete all per-node keys from config when shunning a node.""

This reverts commit a1050356cf48a064cfeda2491e11f192952d22f2.

Change-Id: I2ef2dc0f6ea803677661be5fe9cf81fe1bd7b2e1
Reviewed-on: http://review.couchbase.org/36019
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
MB-10858 Start ns_server_sup via intermediate process.

The deletions of per node keys when node gets ejected can be
replicated to this node after comes back online. This may prevent some
of the ns_server_sup kids from starting normally. And because of the
way supervisor handles start up errors, it causes all the children of
both ns_server_sup and ns_server_cluster_sup to be shut down and then
restarted. This prevents ns_cluster from completing the leave because
it also gets stopped as a kid of ns_cluster_server_sup.

So the fix is to start ns_server_sup via a wrapper process which
pretends that ns_server_sup starts immediately. So supervisor doesn't
shutdown everything and ns_cluster can complete its job.

Change-Id: Ieb5ff0fc6318f8660b781cbeebad6a26563b7226
Reviewed-on: http://review.couchbase.org/36020
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
fix js error that happens if /node/controller/rename returns

...ERR_CONNECTION_REFUSED

Change-Id: I0fe1e0f0ff7cf01a1d553bc3e4964f69767d53d3
Reviewed-on: http://review.couchbase.org/36160
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Make ns_server:restart/0 ensure that ns_server_sup starts.

Change-Id: I15522279c50072cd28dbfbb23f8f8439eb5fe999
Reviewed-on: http://review.couchbase.org/36161
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
Collect our processes' environment variables.

Change-Id: I0e8876ba61324bec202c36ae8a0617fdf8ae5614
Reviewed-on: http://review.couchbase.org/36156
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
MB-10922 Don't use linux binaries on SunOS

Change-Id: Ide70ad7546d9824de4a28760f9160f3a8e7a2877
Reviewed-on: http://review.couchbase.org/36202
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Chris Hillery <ceej@couchbase.com>
MB-9977: fix a typo

Change-Id: I440ac24013320b88fe613326a74c84d904c69f07
Reviewed-on: http://review.couchbase.org/36233
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-10939 start_cluster doesn't return pid anymore.

So adapted its callers to not expect it. Also improved error handling
in start_cluster itself. Because in some places we assume that if
anything bad happens it just returns an error, but doesn't crash.

Change-Id: Ic36350bfa0e0fbe16f2e1bec376974a58daacd0f
Reviewed-on: http://review.couchbase.org/36237
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
fix a typo

Change-Id: I6bb09b51ebcc34df3062146935fdee378bc81bad
Reviewed-on: http://review.couchbase.org/36256
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Disable mlockall by default.

Because we switched to R16 and it's known to cause problems.

Change-Id: I7546e2122ab7427d494a8556aa54f604efb8c152
Reviewed-on: http://review.couchbase.org/36285
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
use estimate stat instead of backfillRemaining for waiting

... for data move. because backfillRemaining returns only
backfill items vs. all items

Change-Id: Ic10bb6e0893fd49c9019724bfad728855ce3300d
Reviewed-on: http://review.couchbase.org/36282
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Properly start ns_server_sup as part of ns_server:restart.

Change-Id: If289c95a45074aff98751ecec36956d652b09b7d
Reviewed-on: http://review.couchbase.org/36284
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>