After APPEND/PREPEND to json, set datatype to binary

This is because appending or prepending anything
to a JSON document breaks the JSON structure.

Change-Id: I0acd99b0c43a54e0b34ce21f3a69c41709e3817e
Reviewed-on: http://review.couchbase.org/40390
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: abhinav dangeti <abhinav@couchbase.com>
MB-11887: Properly send the snapshot start and end seqnos

Currently we always set the snapshot start and end seqno to be the
same as the start seqno. This is incorrect if we recently were
disconnected and need to resume from a partial snapshot.

Change-Id: I7c9430e0b24ef01cc427cb03b518f4c41a55d875
Reviewed-on: http://review.couchbase.org/40276
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-11299: Use the snapshot start seqno when creating a failover entry

Change-Id: I7a2c0adf51a761a491d0f12720f2abef8127e5c3
Reviewed-on: http://review.couchbase.org/40341
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-11299: Don't let replica vbuckets send partial snapshots

Replica vbuckets cannot create their own snapshots and must
rely on the snapshots it received from the active vbucket
when forwarding the snapshots to a downstream consumer. In
order to make sure that this happens properly we will only
stream mutations from the closed checkpoint for non-active
vbuckets. This will guarantee that the above requirement is
met.

Change-Id: I58151ce96868e34083f87dca0ce1d18b6a12aedf