diff options
Diffstat (limited to 'src/mongo/db/repl/replication_info.cpp')
-rw-r--r-- | src/mongo/db/repl/replication_info.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mongo/db/repl/replication_info.cpp b/src/mongo/db/repl/replication_info.cpp index 8d994dd93b2..0e827661882 100644 --- a/src/mongo/db/repl/replication_info.cpp +++ b/src/mongo/db/repl/replication_info.cpp @@ -275,10 +275,10 @@ public: BSONObjBuilder result; result.append("latestOptime", replCoord->getMyLastAppliedOpTime().getTimestamp()); - auto earliestOplogTimestampFetch = [&]() -> StatusWith<Timestamp> { + auto earliestOplogTimestampFetch = [&]() -> Timestamp { AutoGetOplog oplogRead(opCtx, OplogAccessMode::kRead); if (!oplogRead.getCollection()) { - return StatusWith<Timestamp>(ErrorCodes::NamespaceNotFound, "oplog doesn't exist"); + return Timestamp(); } // Try to get the lock. If it's already locked, immediately return null timestamp. @@ -305,13 +305,13 @@ public: return o["ts"].timestamp(); } } - - return swEarliestOplogTimestamp; + if (!swEarliestOplogTimestamp.isOK()) { + return Timestamp(); + } + return swEarliestOplogTimestamp.getValue(); }(); - uassert( - 17347, "Problem reading earliest entry from oplog", earliestOplogTimestampFetch.isOK()); - result.append("earliestOptime", earliestOplogTimestampFetch.getValue()); + result.append("earliestOptime", earliestOplogTimestampFetch); return result.obj(); } |