bp:MB-5307: use -Wno_improper_lists dialyzer options

I.e. because we had to forker file_sorter from erlang that is not
dialyzer-clean without that option.

Orig-Reviewed-on: http://review.couchbase.org/23594

NOTE: we need to backport it, even if it's MB-5307, to keep ns_server
dialyzer clean.

Change-Id: Ifaaef60254ac751dd7cff1f2a179a0ec567ead48
Reviewed-on: http://review.couchbase.org/23670
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-6726: decrease overhead of capi_set_view_manager

Looks like logging of each call's args twice plus some excessive
calls, plus some duplicated checks were eating quite significant
amount of CPU.

In my swap rebalance 3-total-1-swap tests it was speedup from about 10
minutes down to 6. Most likely this is some fixed cost (independent
from size of data), but it's still a good win to have.

Change-Id: I1bf29e3859fa64d2c4180fd06f5b5738b06b5e5e
Reviewed-on: http://review.couchbase.org/23669
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Revert "MB-6726: decrease overhead of capi_set_view_manager"

This reverts commit c3e2d76b4360d2a50a4ca82f38bdf6afd6fca720.

Thinking about this more. I think not unly I bended stable branch
rules a bit too far, but I also forgot to update commit message.

Change-Id: I81e2585ed87a6242c461340aa509afe64cb42c4e
Reviewed-on: http://review.couchbase.org/23693
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-7354: Use ep_meta_data_memory to monitor meta data usage

This fixes the stats in the admin console and also makes sure the
alert is properly throw if meta data usage gets too high.

Change-Id: I47685928aacecf564c2b02e90da86bbae316886f
Reviewed-on: http://review.couchbase.org/23619
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-7491: use 2.0.1 as master heartbeat version

So that 2.0.1 will forcefully take mastership from 2.0.0 nodes.

Change-Id: I5bf0ddc6d27362646bc5e2694b6adf99e4165950
Reviewed-on: http://review.couchbase.org/23728
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
[bp] MB-7381: allow flush with bucket credentials

Change-Id: I535a86fe265dc3bea1881ab4de0b39336c3a0ea1
Original-Reviewed-on: http://review.couchbase.org/23592
Reviewed-on: http://review.couchbase.org/23930
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-7510 Computed stats of 'null' arguments are also 'null'.

It's possible to have a list of samples where the first sample
contains some stats that are missing from preceding stats. Those
missing stats in the older samples will be replaced by 'null'
values. But computed stats calculated from such samples will fail
because they expect normal values. So we'll just assume that computed
stat of 'null' argument (or arguments) is also 'null'.

This can happen if, for some reason, we were unable to grab couch
stats for some time. Or just during upgrade.

Change-Id: I6a842dc8cfe68d50c3614d0ab36a98a4a33693d6
Reviewed-on: http://review.couchbase.org/23961
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-7511 Handle pre-2.0.1 nodes when (un)inhibiting compaction.

We should not assume that there's previous compaction inhibition when
asked to compact a node. This is because this node may not support
compaction inhibition. And thus when we asked it to inhibit compaction
it replied with something that we treated as a 'nack'. And therefore,
compaction_inhibitions table doesn't have corresponding record.

Change-Id: I13505ab22717671ab631f8cc1e9d82820651c787
Reviewed-on: http://review.couchbase.org/23965
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-6595 Try to lock beam into a memory on start up.

This prevents major page faults and thus decreases chances of hitting
timeouts. Incurred memory overhead seems to be more or less constant,
though noticeable (about 200M for each node).

The user can disable this behavior by setting environment variable
COUCHBASE_ENABLE_MLOCKALL to 'false'.

The only supported platform currently is GNU/Linux.

Change-Id: I9405ac81d7e2a035bdfdd4805152e91a8ff7502f
Reviewed-on: http://review.couchbase.org/23922
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-6595 Increase erlang mseg allocator cache size.

Default cache size is 5. Our tests show that setting it to a larger
value decreases the number of minor page faults generated by
erlang and somewhat reduces the chances of hitting timeouts.

The value that is used can be overridden by setting COUCHBASE_MSEG_CACHE_SIZE
environment variable.

Change-Id: If32cce298523f184cb79e11742f68ff17fd4147b
Reviewed-on: http://review.couchbase.org/23923
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Merge branch '2.0.1' of git://github.com/couchbase/ns_server into 2.0.1