Details
-
Bug
-
Resolution: Won't Fix
-
Major - P3
-
None
-
3.2.12
-
None
-
Replication
-
ALL
-
0
Description
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 |
|
837
|
void BackgroundSync::consume() { |
838
|
// this is just to get the op off the queue, it's been peeked at |
839
|
// and queued for application already |
840
|
BSONObj op = _buffer.blockingPop();
|
841
|
bufferCountGauge.decrement(1);
|
842
|
bufferSizeGauge.decrement(getSize(op));
|
843
|
}
|
|
queue.h |
|
165
|
T blockingPop() {
|
166
|
stdx::unique_lock<stdx::mutex> lk(_lock);
|
167
|
_clearing = false; |
168
|
while (_queue.empty() && !_clearing) |
169
|
_cvNoLongerEmpty.wait(lk);
|
170
|
if (_clearing) { |
171
|
return T{}; |
172
|
}
|
173
|
|
174
|
T t = _queue.front();
|
175
|
_queue.pop();
|
176
|
_currentSize -= _getSize(t);
|
177
|
_cvNoLongerFull.notify_one();
|
178
|
|
179
|
return t; |
180
|
}
|