-
Type:
Bug
-
Resolution: Won't Fix
-
Priority:
Major - P3
-
None
-
Affects Version/s: 3.2.12
-
Component/s: Replication
-
None
-
Replication
-
ALL
-
0
-
None
-
None
-
None
-
None
-
None
-
None
-
None
In 3.2, BackgroundSync::consume may erroneously decrement the following server status metrics when BlockingQueue::blockingPop() returns an empty document:
"repl.buffer.count"
"repl.buffer.sizeBytes"
bgsync.cpp
void BackgroundSync::consume() { // this is just to get the op off the queue, it's been peeked at // and queued for application already BSONObj op = _buffer.blockingPop(); bufferCountGauge.decrement(1); bufferSizeGauge.decrement(getSize(op)); }
queue.h
T blockingPop() {
stdx::unique_lock<stdx::mutex> lk(_lock);
_clearing = false;
while (_queue.empty() && !_clearing)
_cvNoLongerEmpty.wait(lk);
if (_clearing) {
return T{};
}
T t = _queue.front();
_queue.pop();
_currentSize -= _getSize(t);
_cvNoLongerFull.notify_one();
return t;
}