bp: MB-8422: enable XDCR parameters to immediately effective

Today several key XDCR parameters are read once when replication
starts from ns_config or env parameters. These values will be used
all through XDCR, even users change the parameter in the middle of
replication. To make new parameter effective, users need to stop
and restart replication, which is expensive since new replication
will have to start from the last persisted checkpoint or the very
beginning to scan all the data that have been replicated. This is
also inconvenient for users including QE and performance team to
test and tune system performance by using different parameters.

This commit will make updating following XDC parameters effective
immediately:

- xdcr_optimistic_replication_threshold
- xdcr_worker_batch_size
- xdcr_connection_timeout
- xdcr_num_worker_process
- xdcr_num_http_connections
- xdcr_num_retries_per_request

The changed parameter  will be dumped to log and to avoid query the
ns_config too often, the new value will be read and effective when
the next vb replicator is scheduled.

Change-Id: I75bbc8f3c9a017b4218cf3aec8fd89d2586d652a
Reviewed-on: http://review.couchbase.org/27074
Reviewed-by: Junyi Xie <junyi.couchbase@gmail.com>
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
MB-8444: enable adjusting concurrent replicators at run-time

This commit will enable dynamicly setting number of concurrent
vb replicators at runtime, without stopping/restarting ongoing
replication. Active replicators will check during the ongoing
replication if user has changed number of tokens or not, and
adjust concurrency throttle accordingly.

If user increases tokens during XDCR, these new tokens will be
immediately available and the throttle will schedule corresponding
waiting replicators to be active. However, if user decreases the
number of tokens, the concurrency throttle will allow active vb
replicator to continue, until it is done and return the token to
throttle. The throttle will not schedule new vb replicators before
enough tokens have been returned.

Users can change number of tokens by ns_config parameter:

xdcr_max_concurrent_reps

or via env parameter

MAX_CONCURRENT_REPS_PER_DOC

Change-Id: Ie267c9fee7afa4e87414ee0e696e235c523e2e3b
Reviewed-on: http://review.couchbase.org/27089
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
Reviewed-by: Jin Lim <jin@couchbase.com>
MB-100: using dict:update_counter to update load stats table

Change-Id: Ibdc29ef246b471dfcdb29b7c4720df4c2c568fb5
Reviewed-on: http://review.couchbase.org/27090
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
MB-4786 only show anonymous pages as "used"

It can be argued that it's still imperfect, but at least it can be
argued that it's better than what we had before

Change-Id: I9b698a714b11e4afce29cfb0a8fc2ec9cf026a83
Reviewed-on: http://review.couchbase.org/27227
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Merge commit '626da2328ba8679282ee5dafe320a44444971ca0'

* commit '626da2328ba8679282ee5dafe320a44444971ca0':
  bp: MB-8422: enable XDCR parameters to immediately effective

this empty merge handles "backport"

Change-Id: Ib52db867fa7cdbe2f0e66c03e96dcb00a68f33f5
Merge remote-tracking branch 'origin/2.1.1'

* origin/2.1.1:
  MB-4786 only show anonymous pages as "used"
  MB-100: using dict:update_counter to update load stats table
  MB-8444: enable adjusting concurrent replicators at run-time

this merge is trivial

Change-Id: I64ce55ca0c40365b392157128245f6aeea09e82a