MB-6217: avoid division by zero while finalizing indexing task

I don't know how, but it appears that sometimes total_changes can
indeed be 0.

I've hit this badarith a bit too often on my rebalance benchmark runs
before patch, and seen no problems after.

Change-Id: I181fafef5cc32d7b20ab48ef7fb08ceeefc9d5c6
Reviewed-on: http://review.couchbase.org/22120
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-5308: display index task with higher priority

On views UI when both compaction and indexing is running we have to
pick which progress to display. Our previous decision was to pick
compaction because it was supposed to be faster.

But what I saw in practice is that compaction runs quite often and
quite long when index updater is running. Moreover I've seen 100%
compaction progress for quite long time.

It appears that seeing indexing being X% done rather than compaction
being 100% done is more useful.

Change-Id: Ie5e34058af25e9235b88c7e2886780b07f87d508
Reviewed-on: http://review.couchbase.org/22121
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-5307: anticipate diag_failed while grabbing diags

In diags of other bug I've seen crash in this place where we clearly
expected per node diag result to be plist while it was diag_failed
atom.

Change-Id: I1be4cc5c75584337a16594e36b89d528bb112833
Reviewed-on: http://review.couchbase.org/22122
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-7057: log all vbucket state change mccouch events

So that we can understand MB-7057 better.

Change-Id: I357664e0ff7c63c313618789e66b35ac86f3cc2e
Reviewed-on: http://review.couchbase.org/22123
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-5307: added internal documentation of /internalSettings API

Change-Id: I8023ee62f6bd7be31feef34f5d921e82147f30f5
Reviewed-on: http://review.couchbase.org/22124
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-7067: Documents - limit on skip is 1000

Change-Id: I45e625b8dfb8f412b536a606d9b19634e7f1f1ec
Reviewed-on: http://review.couchbase.org/21256
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Farshid Ghods <farshid@couchbase.com>
Tested-by: Farshid Ghods <farshid@couchbase.com>
MB-6940: improved error handler for view results

Change-Id: I81b7ae1871da74f13b3d6d09f5c3fbc086b27eb8
Reviewed-on: http://review.couchbase.org/21741
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-6986: apply pop only when rows length is over limited

Change-Id: Iea2f55e3f626e9606e82a8ac23020b67a7e00743
Reviewed-on: http://review.couchbase.org/21925
Reviewed-by: Pavel Blagodov <stochmail@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-7011: back button support for page limit select box

Change-Id: Icbb6828a8a8a708f058c1c3ef9aa748a90f529da
Reviewed-on: http://review.couchbase.org/22002
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Pavel Blagodov <stochmail@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-6500: loading document in sample document pane

Change-Id: Ib931ce3df56cda0d7b6cacc027a818bad84f6161
Reviewed-on: http://review.couchbase.org/22083
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Pavel Blagodov <stochmail@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-7029: added error handler for spatial view saving

Change-Id: I93d89f28465d8f8a6c41920eb9ad19b134bb2c13
Reviewed-on: http://review.couchbase.org/22110
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Pavel Blagodov <stochmail@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-5308: fixed indentation in default spatial map function

Closing if brace was not properly indented.

Change-Id: Ifa7f78978d825a419f4ad91ad20b3c2f085c22ed
Reviewed-on: http://review.couchbase.org/22183
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-6973: set default memory quota to 60% of box's RAM

So that we have page cache space left for btree nodes and view files.

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