return node version from prepare_rebalance call

Change-Id: Id99731e69291d13950c2f10006cc3efafd80b169
Reviewed-on: http://review.couchbase.org/39222
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
rewire inhibit and uninhibit compaction calls via janitor_agent

...to have one single frontend for remote calls

Change-Id: I8936cb8ff4713ec867151162cf8d6444ac961423
Reviewed-on: http://review.couchbase.org/39223
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
frontend for compaction daemon

... abstracts the compaction daemon api from the inner structure of
the compaction daemon which will eliminate the need of backwards compat
code for potential future changes in compaction daemon

Change-Id: I59499d3a0e531b5fe328990d8bfe4e5ee41f8682
Reviewed-on: http://review.couchbase.org/39246
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
drop unused define

Change-Id: I2d7b181021563c82cf8c12ccf6d243ed0f026284
Reviewed-on: http://review.couchbase.org/39272
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
re-factoring: abstract compaction scheduler code into separate module

Change-Id: I694a8c51996053d930b3e2c494ec9ba186029487
Reviewed-on: http://review.couchbase.org/39309
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-10273 create copy of compaction_daemon as a base for further development

unfortunately we need to keep compaction_daemon fsm for backwards
compatibility with older nodes. so I have to copy the whole code under
different name and after the new compaction_new_daemon will be fully
functional I'll rewire all the requests to it and turn compaction_daemon
into the empty stab the whole purpose of which will be to reroute
old nodes requests to compaction_new_daemon

Change-Id: I0f03d489bc7c64a7809388ad2be3f41a56f4e3cb
Reviewed-on: http://review.couchbase.org/39312
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-10273 new compaction daemon that schedules kv and view compactions

... independently

not implemented:
1. view compaction inhibition
2. support of non-parallel view/kv compaction

Change-Id: Ibb8518d688a5a58312cdd589c2924358ac70cfca
Reviewed-on: http://review.couchbase.org/39310
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-10273 make sure that scheduled non-parallel view compaction doesn't

... happen during the kv compaction

Change-Id: Ie2a1dc82ceda8cac3cdb9e026645be1cb2c322e8
Reviewed-on: http://review.couchbase.org/39311
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-10273 inhibit and uninhibit views compaction

on inhibit:
- if views for given bucket are being compacted => abort the compaction
- don't let new compactors for this buckets views to start while the
  the bucket is being inhibited

on uninhibit:
- wait till currently running index compaction finishes
- then run compaction for all undexes of paused bucket
- block the call until the compaction is not finished

Change-Id: I7179428b6ee6304f9cb16f82065bd9387d217dba
Reviewed-on: http://review.couchbase.org/39324
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-10273 rewire compaction calls to use compaction_new_daemon

compaction_daemon fsm left for compatibility with pre 3.0 nodes
and simply rerouts calls to compaction_new_daemon

Change-Id: I38abd5a7895962900b2a1305ab4ed6239bfcfdf0
Reviewed-on: http://review.couchbase.org/39330
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>