Merge remote-tracking branch 'couchbase/2.0.1' into HEAD

* couchbase/2.0.1:
  MB-7193: Make Views work that contain slashes
  MB-7344: don't allow changing data path of provisioned nodes
  MB-7368 Ensure that db and index paths are normalized.
  MB-7367: try starting os_mon each time we need disk usage data

Change-Id: I52125cb20e905c6515a2511be7963a15c210897a
Merge remote-tracking branch 'origin/2.0.1'

* origin/2.0.1:
  MB-7390: Do not allow backslashes in Mochiweb serve_file
  MB-7224: Capture all .ini files

Change-Id: Id3e49a61b3820fab0aa321979568cba7945174b4
MB-7219: remove retired xdcr ns_config parameters

After we switch to priority checkpoint in ep_engine, the timeout
is totall controlled in hands of ep_engine and this parameter is
no longer needed.

Change-Id: Ib8ee03fa730195ec952c1d9ef3a51925ad27687d
Reviewed-on: http://review.couchbase.org/22659
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Ketaki Gangal <ketakigangal@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Merge remote-tracking branch 'origin/2.0.1'

* origin/2.0.1:
  MB-6726: added internal settings for vbucket scheduling variables
  MB-100: added scripts/reformat-master-events.rb
  MB-6726: added script to draw timeline of new-style rebalance
  MB-6726: added vbucket scheduling simultation/visualization tool
  MB-6726: added master activity events for in-rebalance compaction
  MB-6726: added rebalance_ignore_view_compactions setting
  MB-100: store just binaries in master activity events keeper
  MB-100: added master events support for new style rebalance
  MB-67{26,99}: implemented index aware vbucket move scheduling
  MB-6799: implemented api to pause/unpause view compaction
  MB-7311: Reimplement collecting memcached logs
  MB-7369 MB-7370 Add "instance" vclock to important per-node keys.
  MB-7428: Use right destructor for tempfile

Change-Id: I05355387c18c60d8755166212066d9b998fe4005
MB-7440: change stat name in "Incoming XDCR Operations" section

Per request from support engineer, we change the name of "gets per
second" to "metadata reads per sec".

Change-Id: Ib0b55f429f9bf3448edb67deb0e51ec15e4bc6f4
Reviewed-on: http://review.couchbase.org/23480
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Merge remote-tracking branch 'couchbase/2.0.1' into next

* couchbase/2.0.1:
  MB-7390: Prohibit arbitrary access to files on Windows
  CBD-708: Use possible hostname as node reference
  MB-7417: Do not pick up link local addresses

Change-Id: I1f9b4e7f365a040a1f0aeb48a529befffeb01904
MB-7464 Fix typo in error message.

Change-Id: I61b00f6324e536410c2259a41ab8b2fc25300987
Reviewed-on: http://review.couchbase.org/23558
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-6280 Stop rebalance only when important nodes go down.

Change-Id: I65547b31d454c8f8bbceccc66a8de0131eb69602
Reviewed-on: http://review.couchbase.org/23559
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Merge remote-tracking branch 'origin/2.0.1'

* origin/2.0.1:
  MB-7421: switch back to +A 16

Change-Id: I468da65466496944cb530f6ab3bd873cdc717c4e
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.

Change-Id: Ie541e2aa29642bd6fa68e72ce3536a738341a5d0
Reviewed-on: http://review.couchbase.org/23594
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-7282: wait autofailover service startup prior to calling it

When master node is ejected, there's normal period of about 10 seconds
when no master node is elected. In which case neither ns_orchestrator
nor autofailover services are alive.

We already had code to wait for ns_orchestrator startup, which is now
generalized to cover autofailover service too.

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

Change-Id: Ib8cb925065551cd990c8d4116726a0d98c3ca01e
Reviewed-on: http://review.couchbase.org/23592
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-7468 Stats for number of faults experienced by the server.

Change-Id: Iac687659902f95ca6d33152be99104ab321782a2
Reviewed-on: http://review.couchbase.org/23600
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-7468: support both V0 and V1 formats of portsigar replies

So that we're more flexible with advanding manifest of ns_server and
portsigar.

Change-Id: I472b572af7d6bc0cf7ecf4d65d7083dde97709a5
Reviewed-on: http://review.couchbase.org/23729
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Merge remote-tracking branch 'origin/2.0.1'

* origin/2.0.1:
  MB-7491: use 2.0.1 as master heartbeat version
  MB-7354: Use ep_meta_data_memory to monitor meta data usage
  Revert "MB-6726: decrease overhead of capi_set_view_manager"
  MB-6726: decrease overhead of capi_set_view_manager
  bp:MB-5307: use -Wno_improper_lists dialyzer options

Change-Id: I6ad4c4640a1341c30b87747b7ca6cbcb2424ecc9
MB-100: Made error message on bucket deletion more clear.

At the least this message should have "the bucket" instead of
bucket and end with a period to be more consistent.

I've made the response message a bit more clear overall though.

Change-Id: I7745e9a1ee8d3d0642176fa6a78ba39381dd2644
Reviewed-on: http://review.couchbase.org/23799
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-5307 Don't require argument for -i flag.

This flag just means "disable replica index". This got broken by
34d72ac4d4d6b6ecfb4f07c1eb183d043712a086 which introduced -S flag.

Change-Id: Ie5bab5aed1e18c841ef66406807620127fd5e465
Reviewed-on: http://review.couchbase.org/23921
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Merge remote-tracking branch 'origin/2.0.1'

* origin/2.0.1:
  MB-6595 Increase erlang mseg allocator cache size.
  MB-6595 Try to lock beam into a memory on start up.
  MB-7511 Handle pre-2.0.1 nodes when (un)inhibiting compaction.
  MB-7510 Computed stats of 'null' arguments are also 'null'.
  [bp] MB-7381: allow flush with bucket credentials

Change-Id: Ia1cfcbf5459da9526989236a55b310e67ef3f7a4
Merge remote-tracking branch 'couchbase/2.0.1' into merge

* couchbase/2.0.1:
  MB-6595 Install mlockall stub correctly.

Change-Id: Ie9539db6333b1f44c4cd2655320c7ae93368d4cd
MB-7275: fix XDCR aggregated stats issue

Today xdcr checkpoints when a new vb replicator starts but we did
not account the commit time into the stats. We also persist incorrect
number of docs checked/written and data replicated into checkpoint
doc. This change-set will fix the two issues above.

Change-Id: I62e4682871dcfb020dff5e04538be07b911d0a34
Reviewed-on: http://review.couchbase.org/22864
Reviewed-by: Junyi Xie <junyi.couchbase@gmail.com>
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>