Skip to content

Commit dd410e5

Browse files
committed
MB-35631: Add HCS to "Sending disk snapshot" log
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]>
1 parent f406696 commit dd410e5

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

engines/ep/src/dcp/active_stream.cc

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include "ep_time.h"
2525
#include "kv_bucket.h"
2626
#include "statwriter.h"
27+
28+
#include <boost/optional/optional_io.hpp>
2729
#include <memcached/protocol_binary.h>
2830

2931
ActiveStream::ActiveStream(EventuallyPersistentEngine* e,
@@ -287,23 +289,25 @@ void ActiveStream::markDiskSnapshot(
287289
}
288290
}
289291

290-
log(spdlog::level::level_enum::info,
291-
"{} Sending disk snapshot with start seqno {} and end "
292-
"seqno {}",
293-
logPrefix,
294-
startSeqno,
295-
endSeqno);
296292
// If the stream supports SyncRep then send the HCS in the
297293
// SnapshotMarker if it is not 0
298294
auto sendHCS = supportSyncReplication() && highCompletedSeqno &&
299295
*highCompletedSeqno != 0;
296+
auto hcsToSend = sendHCS ? highCompletedSeqno : boost::none;
297+
log(spdlog::level::level_enum::info,
298+
"{} Sending disk snapshot with start seqno {}, end seqno {}, and"
299+
" high completed seqno {}",
300+
logPrefix,
301+
startSeqno,
302+
endSeqno,
303+
hcsToSend);
300304
pushToReadyQ(std::make_unique<SnapshotMarker>(
301305
opaque_,
302306
vb_,
303307
startSeqno,
304308
endSeqno,
305309
MARKER_FLAG_DISK | MARKER_FLAG_CHK,
306-
sendHCS ? highCompletedSeqno : boost::none,
310+
hcsToSend,
307311
sid));
308312
lastSentSnapEndSeqno.store(endSeqno, std::memory_order_relaxed);
309313

0 commit comments

Comments
 (0)