MB-100 Correct the tap notification task name

Change-Id: I809783bfa1f6a060faaf5bd95c2c6b4622356d71
Reviewed-on: http://review.couchbase.org/28382
Reviewed-by: abhinav dangeti <abhinav.dangeti@gmail.com>
Tested-by: abhinav dangeti <abhinav.dangeti@gmail.com>
MB-8861 Increase the number of vbucket / tap producer map locks

Change-Id: I858029642f69a8e6dae8349f8cd2a169396bcdb4
Reviewed-on: http://review.couchbase.org/28383
Reviewed-by: abhinav dangeti <abhinav.dangeti@gmail.com>
Tested-by: abhinav dangeti <abhinav.dangeti@gmail.com>
MB-8825 Use seq num and cas only for delete conflict resolution

Recently, we decided to use an expiration field for tombstone
purging, which can break the conflict resolution for the case
where the source and destination have the same seq number and
cas value. To resolve this issue, the change allow us to use
seq number and cas value only for delete conflict resolutions.

Change-Id: I51ac6eecc7e9f4499bd0ac7285f9021381fdaacd
Reviewed-on: http://review.couchbase.org/28398
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
Reviewed-by: Junyi Xie <junyi.couchbase@gmail.com>
MB-8890: Remove assertion for deleted/non-existent tmp item

This assertion is invalid since it is possible that a background
fetch for an item is updated through a front end operation and
then evicted from memory before the background fetch completes.

Change-Id: I3d7638c10bd88721f3a30c7aa4e143fa476b0a14
Reviewed-on: http://review.couchbase.org/28403
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
MB-8530 Set TAP paused flag upon returning TAP_PAUSE response.

We should set the TAP paused flag to true only if there are no
items to be sent to the destination. Otherwise, we invoke
too many unnecessary notify_io_complete calls.

Change-Id: Icc1da864b4202406ff84f29172ade09fe395cce4
Reviewed-on: http://review.couchbase.org/28424
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
MB-8890 Fix to the incorrect check for deleted/non-existent items

Change-Id: I3669419ba83b6624e58d9feebc0f695ca6212824
Reviewed-on: http://review.couchbase.org/28428
Reviewed-by: Sundararaman Sridharan <sundar.sridharan@gmail.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
MB-8869 Use atomic queue to push notifications for TAP producers

We saw the frontend ops/sec performance regression from the
previous fix to the OBSERVE replication latency issue. To address
this issue, this change uses the atomic queue to push
notification events for TAP producers, and schedules the
daemon task to grab those events and notify them to the
corresponding TAP producers.

Change-Id: I4bda29d50d446c338cff78014f20f2cef9f7bd64
Reviewed-on: http://review.couchbase.org/28464
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
MB-8930 Stat for max number of bg fetches in the queue seen so far

Change-Id: Ice13a5cccf538b01350ef538d5d09fc6215d1760
Reviewed-on: http://review.couchbase.org/28490
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
MB-100 Fix compilation on gcc 4.8.

Here's the error it produces:

src/atomic.hh: In instantiation of 'void ThreadLocalPtr<T>::operator=(T*) [with T = AtomicPtr<std::queue<SingleThreadedRCPtr<TapConnection>, std::deque<SingleThreadedRCPtr<TapConnection>, std::allocator<SingleThreadedRCPtr<TapConnection> > > > >]':
src/atomic.hh:606:21:   required from 'AtomicPtr<std::queue<T> >* AtomicQueue<T>::initialize() [with T = SingleThreadedRCPtr<TapConnection>]'
src/atomic.hh:613:31:   required from 'std::queue<T>* AtomicQueue<T>::swapQueue(std::queue<T>*) [with T = SingleThreadedRCPtr<TapConnection>]'
src/atomic.hh:514:38:   required from 'void AtomicQueue<T>::push(T&) [with T = SingleThreadedRCPtr<TapConnection>]'
src/tapconnmap.cc:286:45:   required from here
src/atomic.hh:91:21: error: 'set' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
         set(newValue);
                     ^
src/atomic.hh:91:21: note: declarations in dependent base 'ThreadLocal<AtomicPtr<std::queue<SingleThreadedRCPtr<TapConnection>, std::deque<SingleThreadedRCPtr<TapConnection>, std::allocator<SingleThreadedRCPtr<TapConnection> > > > >*>' are not found by unqualified lookup
src/atomic.hh:91:21: note: use 'this->set' instead

Change-Id: Ia4dbc0026f954c7f5d799903261abc239b8da6e4
Reviewed-on: http://review.couchbase.org/28523
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Merge remote-tracking branch 'gerrit/2.1.1'

Change-Id: Ia46412ddc5738cbdbad155dd1d5310befafeccc1