summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/replication_info.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/replication_info.cpp')
-rw-r--r--src/mongo/db/repl/replication_info.cpp14
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 2172307d791..b9ed271ff77 100644
--- a/src/mongo/db/repl/replication_info.cpp
+++ b/src/mongo/db/repl/replication_info.cpp
@@ -248,11 +248,11 @@ public:
BSONObjBuilder result;
result.append("latestOptime", replCoord->getMyLastAppliedOpTime().getTimestamp());
- auto earliestOplogTimestampFetch = [&]() -> StatusWith<Timestamp> {
+ auto earliestOplogTimestampFetch = [&]() -> Timestamp {
auto oplog = CollectionCatalog::get(opCtx)->lookupCollectionByNamespaceForRead(
opCtx, NamespaceString::kRsOplogNamespace);
if (!oplog) {
- 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.
@@ -282,13 +282,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();
}