|
DataReplicator::_onOplogFetchFinish has this code:
BSONElement tsElem(doc->getField("ts"));
|
while(tsElem.eoo() || doc != docs.rend()) {
|
tsElem = (doc++)->getField("ts");
|
}
|
|
if (!tsElem.eoo()) {
|
_lastTimestampFetched = tsElem.timestamp();
|
} else {
|
warning() <<
|
"Did not find a 'ts' timestamp field in any of the fetched documents";
|
}
|
1 - It seems like the while(tsElem.eoo()) condition would prevent the else/warning block from ever being executed because the code can't advance until tsElem.eoo() == false.
2 - The or condition in while() seems like it could allow doc to advance past docs.rend() when no docs have a 'ts' field. (Should it just be an && condition instead?)
|