MB-9532 Find a new compacted file upon receiving a temp failure

When the flusher receives a temp failure from the mccouch, it
should check if a new compacted file exists or not before
re-writing dirty items. This is required especially when the
deletion of the old file fails due to some external issues.
Otherwise, the flusher will keep writing dirty items into the
old file and receiving a temp failure over and over.

Change-Id: Ifd91eea1acfe82f5ea43ff93ca650b7928844b33
Reviewed-on: http://review.couchbase.org/30301
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Reviewed-by: Sundararaman Sridharan <sundar.sridharan@gmail.com>
Tested-by: Sundararaman Sridharan <sundar.sridharan@gmail.com>
MB-9203 Always reset the open checkpoint upon resetting a vbucket

When a replica vbucket is reset, its open checkpoint id is not
reset to zero when the vbucket has zero items. This causes a bug
in updating the persisted checkpoint id, which consequently
incurs the rebalance to be stuck.

This fix always resets the open checkpoint id of a replica
vbucket to zero upon resetting the vbucket.

Change-Id: If6b5e2ca9b37dd533818e8d3397ec2c695345295
Reviewed-on: http://review.couchbase.org/30302
Reviewed-by: Sundararaman Sridharan <sundar.sridharan@gmail.com>
Tested-by: Sundararaman Sridharan <sundar.sridharan@gmail.com>
MB-9549 Fix to the memory leak in GetAndUpdateTTL

This is a regression from 2.2.0, which causes a memory leak
when we update the TTL for a non-resident item.

Change-Id: I3dfd9dcd09a0acfdcd2cd6623f75ca54916d1116
Reviewed-on: http://review.couchbase.org/30303
Reviewed-by: Sundararaman Sridharan <sundar.sridharan@gmail.com>
Tested-by: Sundararaman Sridharan <sundar.sridharan@gmail.com>
MB-9311: Notify all the pending connections on vbucket delete

If a given vbucket is deleted, we should notify it to all of its
pending connections, so that the connections are released
immediately and the error messages should be sent to the clients.

Change-Id: Ic230a803f0b26944f98e84ed4d21f8d834e3a561
Reviewed-on: http://review.couchbase.org/30353
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-9618 Release engine handle before CCCP callback

As the memcached CCCP callback can allocate more memory for the
sending buffer, we should release the engine handle before
calling the callback function, so that we can maintain the
memory accounting correctly.
Change-Id: I2899f65acf3b40db9cd3cf7602e5bb4b874750bf
Reviewed-on: http://review.couchbase.org/30492
Reviewed-by: Sundararaman Sridharan <sundar.sridharan@gmail.com>
Tested-by: Sundararaman Sridharan <sundar.sridharan@gmail.com>
Merge remote-tracking branch 'couchbase/2.5.0'

Conflicts:
	src/ep.cc

Change-Id: I7dba83b535f62a13a519881559ec73d0982f0e85