summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/collection_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/catalog/collection_impl.h')
-rw-r--r--src/mongo/db/catalog/collection_impl.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mongo/db/catalog/collection_impl.h b/src/mongo/db/catalog/collection_impl.h
index d3379568d22..a6f2043434f 100644
--- a/src/mongo/db/catalog/collection_impl.h
+++ b/src/mongo/db/catalog/collection_impl.h
@@ -331,6 +331,9 @@ public:
bool doesTimeseriesBucketsDocContainMixedSchemaData(const BSONObj& bucketsDoc) const final;
+ bool getRequiresTimeseriesExtendedRangeSupport() const final;
+ void setRequiresTimeseriesExtendedRangeSupport(OperationContext* opCtx) const final;
+
/**
* isClustered() relies on the object returned from getClusteredInfo(). If
* ClusteredCollectionInfo exists, the collection is clustered.
@@ -579,6 +582,18 @@ private:
AtomicWord<bool> _committed{true};
+ // Time-series collections are allowed to contain measurements with arbitrary dates;
+ // however, many of our query optimizations only work properly with dates that can be stored
+ // as an offset in seconds from the Unix epoch within 31 bits (roughly 1970-2038). When this
+ // flag is set to true, these optimizations will be disabled. It must be set to true if the
+ // collection contains any measurements with dates outside this normal range.
+ //
+ // This is set from the write path where we only hold an IX lock, so we want to be able to
+ // set it from a const method on the Collection. In order to do this, we need to make it
+ // mutable. Given that the value may only transition from false to true, but never back
+ // again, and that we store and retrieve it atomically, this should be safe.
+ mutable AtomicWord<bool> _requiresTimeseriesExtendedRangeSupport{false};
+
// Capped information.
const bool _isCapped;