Skip to content

Commit a2d57ae

Browse files
manudhundidaverigby
authored andcommitted
[BP] MB-25798: Log when DcpProducer::Buffer log is full
Log when unable to notify a paused connection because the BufferLog is full. And log when space becomes available in the BufferLog allowing a paused connection to be notified. Also log when ignoring a request to notify that a stream is ready due to the associated vbucket already being in the ready queue. Change-Id: I75f2d25af5d0f11175beb7b23300486092aa86fa Reviewed-on: http://review.couchbase.org/83521 Well-Formed: Build Bot <[email protected]> Tested-by: Build Bot <[email protected]> Reviewed-by: Dave Rigby <[email protected]>
1 parent 0b5d8a3 commit a2d57ae

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/dcp/producer.cc

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,16 @@ bool DcpProducer::BufferLog::pauseIfFull() {
8181

8282
void DcpProducer::BufferLog::unpauseIfSpaceAvailable() {
8383
ReaderLockHolder rlh(logLock);
84-
if (getState_UNLOCKED() != Full) {
84+
if (getState_UNLOCKED() == Full) {
85+
LOG(EXTENSION_LOG_NOTICE, "%s Unable to notify paused connection "
86+
"because DcpProducer::BufferLog is full; "
87+
"ackedBytes:%" PRIu64 ", bytesSent:%" PRIu64 ", "
88+
"maxBytes:%" PRIu64 ,
89+
producer.logHeader(),
90+
uint64_t(ackedBytes),
91+
uint64_t(bytesSent),
92+
uint64_t(maxBytes));
93+
} else {
8594
producer.notifyPaused(true);
8695
}
8796
}
@@ -93,6 +102,14 @@ void DcpProducer::BufferLog::acknowledge(size_t bytes) {
93102
release_UNLOCKED(bytes);
94103
ackedBytes += bytes;
95104
if (state == Full) {
105+
LOG(EXTENSION_LOG_NOTICE, "%s Notifying paused connection now that "
106+
"DcpProducer::Bufferlog is no longer full; "
107+
"ackedBytes:%" PRIu64 ", bytesSent:%" PRIu64 ", "
108+
"maxBytes:%" PRIu64 ,
109+
producer.logHeader(),
110+
uint64_t(ackedBytes),
111+
uint64_t(bytesSent),
112+
uint64_t(maxBytes));
96113
producer.notifyPaused(true);
97114
}
98115
}

0 commit comments

Comments
 (0)