diff options
author | Rushan Chen <rushan.chen@mongodb.com> | 2023-01-11 11:58:28 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-01-11 12:33:37 +0000 |
commit | 37bbca32d5adc3654dff73b94816a7bd56cd9d42 (patch) | |
tree | f8f7bcb6b6f2e2d70a07b545363a75f62a2b47b1 /src/mongo/db/commands/write_commands.cpp | |
parent | 6cf2a3f731b730a5562a507ed064edc4f86c67e2 (diff) | |
download | mongo-37bbca32d5adc3654dff73b94816a7bd56cd9d42.tar.gz |
SERVER-70445 check existence of TimeseriesOptions before using the time series bucket collection name space
Diffstat (limited to 'src/mongo/db/commands/write_commands.cpp')
-rw-r--r-- | src/mongo/db/commands/write_commands.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mongo/db/commands/write_commands.cpp b/src/mongo/db/commands/write_commands.cpp index 15dfa5a7b4c..f1068f91a34 100644 --- a/src/mongo/db/commands/write_commands.cpp +++ b/src/mongo/db/commands/write_commands.cpp @@ -146,9 +146,8 @@ bool isTimeseries(OperationContext* opCtx, const Request& request) { // collection does not yet exist, this check may return false unnecessarily. As a result, an // insert attempt into the time-series namespace will either succeed or fail, depending on who // wins the race. - return CollectionCatalog::get(opCtx) - ->lookupCollectionByNamespaceForRead(opCtx, bucketNss) - .get(); + auto coll = CollectionCatalog::get(opCtx)->lookupCollectionByNamespaceForRead(opCtx, bucketNss); + return (coll && coll->getTimeseriesOptions()); } NamespaceString makeTimeseriesBucketsNamespace(const NamespaceString& nss) { |