MB-17168: Log lastSentSeqno during takeover state change 17/58217/3
authorabhinavdangeti <abhinav@couchbase.com>
Mon, 4 Jan 2016 17:43:01 +0000 (09:43 -0800)
committerChiyoung Seo <chiyoung@couchbase.com>
Tue, 5 Jan 2016 00:35:04 +0000 (00:35 +0000)
When an active vbucket state is changed to dead as part
of takeover, log a message that would indicate the last
sent seqno for the vbucket on the particular stream and
the vbucket's high seqno.

Change-Id: I7097b79cf41b2c62688ddb9345bc529ac08b2223
Reviewed-on: http://review.couchbase.org/58217
Reviewed-by: Sriram Ganesan <sriram@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
src/dcp-stream.cc

index c9b6556..b6a467c 100644 (file)
@@ -443,16 +443,21 @@ void ActiveStream::setVBucketStateAckRecieved() {
     LockHolder lh(streamMutex);
     if (state_ == STREAM_TAKEOVER_WAIT) {
         if (takeoverState == vbucket_state_pending) {
+            LOG(EXTENSION_LOG_INFO, "%s (vb %" PRIu16 ") Receive ack for set "
+                "vbucket state to pending message", producer->logHeader(), vb_);
+
             RCPtr<VBucket> vbucket = engine->getVBucket(vb_);
             engine->getEpStore()->setVBucketState(vb_, vbucket_state_dead,
                                                   false, false);
+            LOG(EXTENSION_LOG_WARNING, "%s (vb %" PRIu16 ") Vbucket marked as "
+                "dead, last sent seqno: %" PRIu64 ", high seqno: %" PRIu64 "",
+                producer->logHeader(), vb_, lastSentSeqno,
+                vbucket->getHighSeqno());
             takeoverState = vbucket_state_active;
             transitionState(STREAM_TAKEOVER_SEND);
-            LOG(EXTENSION_LOG_INFO, "%s (vb %d) Receive ack for set vbucket "
-                "state to pending message", producer->logHeader(), vb_);
         } else {
-            LOG(EXTENSION_LOG_INFO, "%s (vb %d) Receive ack for set vbucket "
-                "state to active message", producer->logHeader(), vb_);
+            LOG(EXTENSION_LOG_INFO, "%s (vb %" PRIu16 ") Receive ack for set "
+                "vbucket state to active message", producer->logHeader(), vb_);
             endStream(END_STREAM_OK);
         }