MB-5307: removed vb mover replication changes accumulation code

Because it's useless since we've started doing reliable replica
building.

Change-Id: I3d9bacb225a4c10b6dbda3c2af5c585dd9cafaef
Reviewed-on: http://review.couchbase.org/18210
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-5307: removed bogus 'support' of rebalancing memcached buckets

Vbucket mover accidently got code that depends on bucket type. We
don't really need that as memcached buckets are using consistent
hashing.

Change-Id: I115aa1cef2e0c4cedbaea666b099bb0f12f14ca9
Reviewed-on: http://review.couchbase.org/18211
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-5307: dont dialyze geocouch

Because it's failing anyways.

Change-Id: Ia55f0ea5d4ae58662617a906a1f7997bd3590032
Reviewed-on: http://review.couchbase.org/18212
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-5307: removed unused xdcr capi function

Change-Id: I41c61970cffe1802315a386f4b3fc4cca17a7cce
Reviewed-on: http://review.couchbase.org/18213
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-5307: prevent spamming of logs by useless empty xdcr stats

Change-Id: Ia0635b83728fc61debd453ada7a5af18a93c13ce
Reviewed-on: http://review.couchbase.org/18214
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-5689: rm-rf all bucket's files when deleting it

It's not enough to just delete databases, because there's also
access.log and other stuff, so we just rm-rf directory.

As part of this commit I've also changed error logging to be visible
in user-level logs.

Change-Id: I93de1162d0aa1353d502504bf1c438d31fa81738
Reviewed-on: http://review.couchbase.org/18215
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
CBD-399: remove unsupported replication in replication worker

In XDCR, all replications come with target #httpdb{} while all
sources are passed as #db{}. In function local_process_batch,
the source and target must be #db{} and #httpdb{} respectively.
This change-set will remove unused code and add log in function
find_missing().

Change-Id: I256024c5e97fdded0aac5ea8265ba317362c4207
Reviewed-on: http://review.couchbase.org/18185
Reviewed-by: Junyi Xie <junyi.couchbase@gmail.com>
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
CBD-399: simplify conflict resolution in capi_replication

Today conflict resolution code in capi_replication is confusing and
unnecessarily complex. This change-set uses plain comparison to
simplify winner picking and removes unused code.

Change-Id: Iad96a2b95acbf47ff124b725926f59ff4c47ebec
Reviewed-on: http://review.couchbase.org/18201
Reviewed-by: Junyi Xie <junyi.couchbase@gmail.com>
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
CBD-399: remove unused function clause in replication worker

Change-Id: Id4166996e9fde3444c4b91c6390f5432c1fd889c
Reviewed-on: http://review.couchbase.org/18309
Reviewed-by: Junyi Xie <junyi.couchbase@gmail.com>
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
MB-5307 Improve ns_pubsub logging.

Old messages where mostly of no use because it was very hard (if not
impossible) to understand to whom they belonged.

Change-Id: I706d49956d5776cd610d84f45d7940f00c8dafb3
Reviewed-on: http://review.couchbase.org/18330
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-5877 Don't leave hanging ns_port_server processes.

ns_port_server traps exits and it's cushioned by
supervisor_cushion. This means that if ns_port_server hangs somewhere
in terminate function, it won't be killed by supervisor even after
timeout specified in the child spec exceeded. Only EXIT message from
supervisor_cushion will be delivered to it but it won't be handled. To
avoid such situations from now supervisor_cushion processes must be
started with timeout of infinity. But supervisor_cushion:start_link
now has additional parameter specifying how long to wait for sane
termination of the cushioned process.

Change-Id: I8462a0d5b1de2608b1e4c56461f1070e586d97ef
Reviewed-on: http://review.couchbase.org/18331
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
CBD-425: Add logger for errors during the MapReduce

Change-Id: I062679e3cf7a2e0fbf5658a1daaeacbecfd60dc4
Reviewed-on: http://review.couchbase.org/18292
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Revert "MB-5877 Don't leave hanging ns_port_server processes."

This reverts commit aa93b64eb5ae19a1ee424109d09d7be281bc3438.

Server crashes in startup due to:

=========================CRASH REPORT=========================
  crasher:
    initial call: supervisor:ns_server_sup/1
    pid: <0.367.0>
    registered_name: []
    exception exit: {start_spec,{invalid_shutdown,infinity}}
      in function  gen_server:init_it/6
    ancestors: [ns_server_cluster_sup,<0.63.0>]
    messages: []
    links: [<0.185.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 233
    stack_size: 24
    reductions: 1443
  neighbours:

Change-Id: I0fb77c7acd78ec593868b59cb6b9197226e8b0e5
Reviewed-on: http://review.couchbase.org/18343
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
mark

Change-Id: Ibdff80e7fcb12c21ee86fce6d9f731441ff4c923
amend

Change-Id: Iea5a44397277d6dc9a6bed6ff6ff7d665f34d089
mark

Change-Id: Ic416a3065a346b998a0f2743f0bb95798c3b059b
mark

Change-Id: I1caea2fcb896984a0099722646f6bf5d5dabd4e2
mark

Change-Id: If3f9db29bb64a892c98b507d5cd62674302413b0
mark

Change-Id: I6316b6a0d08b160d40169ba73e8896266794c3f6
amend

Change-Id: Ieac67f5eb201df24ce1ef9ef35d0632da7fd6a8a