Skip to content

Commit

Permalink
MB-35631: Add HCS to "Sending disk snapshot" log
Browse files Browse the repository at this point in the history
Add the HCS to the ActiveStream::markDiskSnapshot logging to
make future debugging of HCS and snapshot related issues easier.

Change-Id: I7a0c090029c01861319aa50bba35af21eb42986e
Reviewed-on: http://review.couchbase.org/113755
Reviewed-by: James Harrison <[email protected]>
Tested-by: Build Bot <[email protected]>
  • Loading branch information
BenHuddleston committed Aug 23, 2019
1 parent f406696 commit dd410e5
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions engines/ep/src/dcp/active_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "ep_time.h"
#include "kv_bucket.h"
#include "statwriter.h"

#include <boost/optional/optional_io.hpp>
#include <memcached/protocol_binary.h>

ActiveStream::ActiveStream(EventuallyPersistentEngine* e,
Expand Down Expand Up @@ -287,23 +289,25 @@ void ActiveStream::markDiskSnapshot(
}
}

log(spdlog::level::level_enum::info,
"{} Sending disk snapshot with start seqno {} and end "
"seqno {}",
logPrefix,
startSeqno,
endSeqno);
// If the stream supports SyncRep then send the HCS in the
// SnapshotMarker if it is not 0
auto sendHCS = supportSyncReplication() && highCompletedSeqno &&
*highCompletedSeqno != 0;
auto hcsToSend = sendHCS ? highCompletedSeqno : boost::none;
log(spdlog::level::level_enum::info,
"{} Sending disk snapshot with start seqno {}, end seqno {}, and"
" high completed seqno {}",
logPrefix,
startSeqno,
endSeqno,
hcsToSend);
pushToReadyQ(std::make_unique<SnapshotMarker>(
opaque_,
vb_,
startSeqno,
endSeqno,
MARKER_FLAG_DISK | MARKER_FLAG_CHK,
sendHCS ? highCompletedSeqno : boost::none,
hcsToSend,
sid));
lastSentSnapEndSeqno.store(endSeqno, std::memory_order_relaxed);

Expand Down

0 comments on commit dd410e5

Please sign in to comment.