MB-10057: implemented REST API for incoming xdcr checkpointing

Change-Id: Iacdb11fc021a73bb6e2f5ab92a2f88937fdfcfc0
Reviewed-on: http://review.couchbase.org/34039
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-10057: replaced outgoing xdcr checkpointing implementation

Change-Id: Ia540f770c2daebff386a3bcc6acc782f4a83eb07
Reviewed-on: http://review.couchbase.org/34040
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-10057: stop trying to report checkpoint error messages

Change-Id: If234128166d574573ef3df110c2f5fc098516163
Reviewed-on: http://review.couchbase.org/34041
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-10057: propagate checkpointing errors slightly better

Particularly, propagate real reason of failure rather than useless
generic error message.

Change-Id: I423496398c4315f30e4eca0deb14e9f4ac0b6d7d
Reviewed-on: http://review.couchbase.org/34042
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-10057: expose /diag/eval-able API for resetting vbucket uuids

I.e. for testing and diagnostics/troubleshooting.

Change-Id: I7eac55d4f84d8083fec6f68397e18ae3798d7cb8
Reviewed-on: http://review.couchbase.org/34070
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-10057: expose testrunner api that returns json of checkpoints

I.e. so that checkpoints can be verified from tests

Change-Id: I5011229de5c5e94d425fcab662a3bf4a9294fd51
Reviewed-on: http://review.couchbase.org/34071
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-10057: added bucket uuid to remote checkpointing payload

It's better if we can detect speaking to wrong bucket asap.

Change-Id: I39492992c97ac9b3b6c50a58fc8eeeb638fa3d49
Reviewed-on: http://review.couchbase.org/34072
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-10352: handle checkpointing against older nodes specially

Older nodes (>= 2.5.0) don't support new checkpointing protocol. And
because checkpointing code currently crashes replicator if for any
reason checkpointing fails and also because we actually need to detect
crashes of destination, we have to treat older node specially.

Current behavior is to react on 404 from _pre_replicate and grab
remote instance start time as special form of vbopaque.

When it's time to checkpoint we detect that special form of
vbopaque. And we compare previous instance start time and current
instance start time. If they don't match, then we crash replicator (as
per usual xdcr checkpointing behavior). If they do match we "fake"
checkpoint by doing nothing. Faking of checkpoint is necessary because
older nodes cannot reliably support checkpointing.

Change-Id: I531a0baddaa924cee8875a03002ef4cf6f3fe6cb
Reviewed-on: http://review.couchbase.org/34168
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Merge commit 'origin/for-rackaware^' into master

* commit 'origin/for-rackaware^':
  MB-10352: handle checkpointing against older nodes specially
  MB-10057: added bucket uuid to remote checkpointing payload
  MB-10057: expose testrunner api that returns json of checkpoints
  MB-10057: expose /diag/eval-able API for resetting vbucket uuids
  MB-10057: propagate checkpointing errors slightly better
  MB-10057: stop trying to report checkpoint error messages
  MB-10057: replaced outgoing xdcr checkpointing implementation
  MB-10057: implemented REST API for incoming xdcr checkpointing

Conflicts:
	src/ns_server_testrunner_api.erl
	src/xdc_vbucket_rep_ckpt.erl

This is near-trivial merge

Change-Id: I1cba93d5669b20f3f05607d421c2bea9ecbaddf8