summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/collection_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/catalog/collection_impl.cpp')
-rw-r--r--src/mongo/db/catalog/collection_impl.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/catalog/collection_impl.cpp b/src/mongo/db/catalog/collection_impl.cpp
index c028252f3b1..34aee68aa0b 100644
--- a/src/mongo/db/catalog/collection_impl.cpp
+++ b/src/mongo/db/catalog/collection_impl.cpp
@@ -229,10 +229,14 @@ bool doesMinMaxHaveMixedSchemaData(const BSONObj& min, const BSONObj& max) {
return false;
}
-bool isIndexCompatible(std::shared_ptr<IndexCatalogEntry> index, Timestamp readTimestamp) {
+bool isIndexCompatible(std::shared_ptr<IndexCatalogEntry> index,
+ boost::optional<Timestamp> readTimestamp) {
if (!index) {
return false;
}
+ if (!readTimestamp) {
+ return true;
+ }
boost::optional<Timestamp> minVisibleSnapshot = index->getMinimumVisibleSnapshot();
if (!minVisibleSnapshot) {
@@ -381,7 +385,7 @@ void CollectionImpl::init(OperationContext* opCtx) {
Status CollectionImpl::initFromExisting(OperationContext* opCtx,
const std::shared_ptr<Collection>& collection,
- Timestamp readTimestamp) {
+ boost::optional<Timestamp> readTimestamp) {
LOGV2_DEBUG(
6825402, 1, "Initializing collection using shared state", logAttrs(collection->ns()));