MB-6799: implemented api to pause/unpause view compaction

I.e. so that during vbucket movement we don't attempt any view
compaction on affected nodes and so that after movement is done we can
wait until compaction is started.

Change-Id: I54cbb63e19bed767e85523f9b10aba466defa40f
Reviewed-on: http://review.couchbase.org/23316
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-67{26,99}: implemented index aware vbucket move scheduling

We figured out that MB-6726 is because of not good enough vbucket move
scheduling and insufficient parallelism of index updates.

Particularly if there's rebalance out 4->3 without replicas all
vbucket movements are from rebalanced out node to one of remaining
nodes and old approach would do that one by one. Where vbucket
movement would be complete (and unblock next movement) only after
indexing is complete for entire vbucket.

Another problem was view compaction happening at unpredictable times
competing with view building of moved vbuckets.

New approach features the following:

a) we limit both incoming and outgoing backfills (compared to just
outgoing before). We planned to have that feature but now we could do
it as necessary part of this work

b) we limit only backfill phase of vbucket move, allowing
parallelization of rest (indexing, actual takeover)

c) we disable view compaction on source and destination of vbucket
move and we explicitly schedule and spawn view compaction as part of
overall rebalance process. So that we prevent concurrent bulk indexing
of moved vbuckets and compaction. Making disk usage more predictable
and understandable and improving overall efficiency.

As part of this work we separate entire aspect of rebalance actions
scheduling into it's own module. That new module is purely functional
(except some logging of course) and is covered by it's own set of unit
tests.

Also as part of this work we attempt round of vbucket move scheduling
improvements that was requested multiple times in past for which we
have some MB- or CBD- which as usual are impossible to find :)

Particularly we attempt to prioritize movements into new node in
rebalance in so that cluster's balance on active vbuckets is equalized
sooner. Previous code tended to start with building new replicas
without actually moving active vbuckets first.

Change-Id: Iad6da3be018e9e6dd66e1698b358dbd04515fbaa
Reviewed-on: http://review.couchbase.org/23317
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-100: added master events support for new style rebalance

Change-Id: Ia535497968d0dbbdddb8cc23fef531616d358171
Reviewed-on: http://review.couchbase.org/23318
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-100: store just binaries in master activity events keeper

So that it doesn't eat too much ram. We also hibernate for same
purpose.

Change-Id: I5bb4cd6582f72958b136d9d0be84b32e83bed482
Reviewed-on: http://review.couchbase.org/23319
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-6726: added rebalance_ignore_view_compactions setting

By setting this to true people may disable compaction during rebalance
essentially completely.

Some people may be willing to trade disk space for rebalance time.

Change-Id: Ib44338769fe7b5a51f9efcfff140274cc99a2b52
Reviewed-on: http://review.couchbase.org/23320
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-6726: added master activity events for in-rebalance compaction

I.e. so that we can keep track of forced index compactions during
rebalance.

Change-Id: Iac06bb3bf0e833cb8e85e881bae01d8c48de616a
Reviewed-on: http://review.couchbase.org/23321
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-6726: added vbucket scheduling simultation/visualization tool

That's not a fully featured tool but still a useful thing.

By manually running
vbucket_move_scheduler_validation:simulate_that_rebalance/0 it's
possible to save events log of simulated rebalance which can then be
turned into SVG timeline visualization.

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