bp:MB-100 use sockets pool for long blocking memcached calls

so far it is just wait_for_checkpoint_persistence but there
will be more of them

Change-Id: Iaeca8739de6358e2309d07c04d2a9a18dca63be6
Orig-Reviewed-on: http://review.couchbase.org/32748
Reviewed-on: http://review.couchbase.org/34029
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
bp:MB-100 allow free form Destination in ns_connection_pool

there's no need to require it to be {Host, Port, Ssl}

Change-Id: Icee603aeab20a5199a640abb2c2ce89dd00b6a8b
Orig-Reviewed-on: http://review.couchbase.org/32747
Reviewed-on: http://review.couchbase.org/34030
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
bp:MB-100 dialyzer fix

Change-Id: Id738748957f12da4accd5a03174dfb18d3531f53
Orig-Reviewed-on: http://review.couchbase.org/32828
Reviewed-on: http://review.couchbase.org/34031
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-10057: don't keep checkpoint status error message

Because it's not used anywhere

Change-Id: I840885e3e2152d05fdf23adef5c7ecc85a936024
Reviewed-on: http://review.couchbase.org/34032
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-10057: killed unused source_seq field

Change-Id: I6ac2110f3f91634cc51f7bffe0e4dd24332c8d34
Reviewed-on: http://review.couchbase.org/34033
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-10057: removed useless misc:flush(checkpoint) calls

Because checkpoint is not plain message but a gen_server:cast

Change-Id: Iba726f68f6bcb0eede22df820be8dd22ca0aa88f
Reviewed-on: http://review.couchbase.org/34034
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-10057: made pre-2.5.1 incoming xdcr checkpointing ineffective

2.5.0 and previous releases have buggy checkpointing. We're
implementing new checkpointing protocol. Which is incompatible with
previous releases.

For previous release we have to pretend that their's checkpointing
protocol "works". Without actually saving checkpoints. Otherwise
previous releases would fail to replicate to 2.5.1+ at all.

Our approach is to simply do nothing on ensure_full_commit and to drop
_local/ docs update on the floor, pretending that it actually
succeeded.

Change-Id: Ib495d3862c810b95c90c585dc7c1c5e79985200d
Reviewed-on: http://review.couchbase.org/34035
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-10057: extracted capi_frontend:verify_bucket_auth

In order to make auth checks from other parts of capi layer.

Change-Id: Icd91a0e394d5e114ee52bbd6dbae1fa8beee13c6
Reviewed-on: http://review.couchbase.org/34036
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-10057: added ns_memcached api for xdcr checkpointing ops

Notably we're adding new implementation of
wait_for_checkpoint_persistence which is using pool of "very long
call" memcached sockets and not usual path via ns_memcached workers.

It's different than plain wait_for_checkpoint_persistence because we
expect greater concurrency of xdcr wait_for_checkpoint_persistence
requests. Also xdcr variant handles retries and externally specified
timeout which normal variant does not. And for 2.5.1 I want to avoid
changing "normal" code.

Change-Id: I5c05b3214fd1ec661bbecaee1bbe45fcdc712fa7
Reviewed-on: http://review.couchbase.org/34037
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Merge commit '2ddb54cfbaaa7...' into merge

* commit '2ddb54cfbaaa7754d00b84be32f3ad1fd6c1a589':
  bp:MB-100 dialyzer fix
  bp:MB-100 allow free form Destination in ns_connection_pool
  bp:MB-100 use sockets pool for long blocking memcached calls

Conflicts:
	src/ns_memcached.erl

This is merge of backports and therefore diff is empty

Change-Id: I7fe7771a3d3ad504f722e30f1c722c3992652825
Merge commit '23a9db4293c078ec57933aaf3e99fb06212bc627' into merge

* commit '23a9db4293c078ec57933aaf3e99fb06212bc627':
  MB-10057: added ns_memcached api for xdcr checkpointing ops
  MB-10057: extracted capi_frontend:verify_bucket_auth
  MB-10057: made pre-2.5.1 incoming xdcr checkpointing ineffective
  MB-10057: removed useless misc:flush(checkpoint) calls
  MB-10057: killed unused source_seq field
  MB-10057: don't keep checkpoint status error message

Conflicts:
	src/capi_frontend.erl
	src/ns_memcached.erl

This merges preparatory xdcr checkpointing work.

Change-Id: Ic1e0002c0000347adf9d2249cd48641eb3a040e0
Merge "Merge commit '2ddb54cfbaaa7...' into merge"
Merge "Merge commit '23a9db4293c078ec57933aaf3e99fb06212bc627' into merge"