Merge remote-tracking branch 'couchbase/3.0.x' into sherlock 74/65574/2
authorDave Rigby <daver@couchbase.com>
Thu, 7 Jul 2016 12:59:10 +0000 (13:59 +0100)
committerDave Rigby <daver@couchbase.com>
Thu, 7 Jul 2016 13:18:46 +0000 (14:18 +0100)
* couchbase/3.0.x:
  MB-19636: Initialise failovers correctly from 2.5.x vbstate
  MB-19673: Log the actual last seqno sent before closing the stream.

Change-Id: If0aae515a9fb3232a390b8228cf92274fcc81456

1  2 
src/dcp-stream.cc

@@@ -439,7 -547,19 +439,19 @@@ DcpResponse* ActiveStream::takeoverWait
  }
  
  DcpResponse* ActiveStream::deadPhase() {
-     return nextQueuedItem();
+     DcpResponse* resp = nextQueuedItem();
+     if (!resp) {
+         LOG(EXTENSION_LOG_WARNING,
+             "(vb %" PRIu16 ") Stream closed, "
+             "%" PRIu64 " items sent from backfill phase, "
+             "%" PRIu64 " items sent from memory phase, "
+             "%" PRIu64 " was last seqno sent",
+             vb_,
 -            uint64_t(itemsFromBackfill),
 -            uint64_t(itemsFromMemory),
++            uint64_t(backfillItems.sent.load()),
++            uint64_t(itemsFromMemoryPhase),
+             lastSentSeqno.load());
+     }
+     return resp;
  }
  
  void ActiveStream::addStats(ADD_STAT add_stat, const void *c) {