diff options
author | Dan Larkin-York <dan.larkin-york@mongodb.com> | 2022-08-18 18:35:51 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-08-18 20:21:52 +0000 |
commit | 65002ae2d4bacf9413383faa4b38d3480a2a8328 (patch) | |
tree | 01b4e46e18968a9ecaa6037db004761ba69a0f2e /src/mongo/db/commands | |
parent | 44c6926a700486de3c5f2c320f1d92c8c2cdbff9 (diff) | |
download | mongo-65002ae2d4bacf9413383faa4b38d3480a2a8328.tar.gz |
SERVER-67814 Fix detection of and report the number of time-series collections requiring extended range support in serverStatus
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r-- | src/mongo/db/commands/write_commands.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/mongo/db/commands/write_commands.cpp b/src/mongo/db/commands/write_commands.cpp index 1576d9e93c0..0ddf1c96316 100644 --- a/src/mongo/db/commands/write_commands.cpp +++ b/src/mongo/db/commands/write_commands.cpp @@ -1340,33 +1340,6 @@ public: curOp.debug().additiveMetrics.ninserted = 0; } - { - // Check if any of the measurements have dates outside the standard range. We need - // to do this before we start doing any inserts so we can mark the collection as - // requiring extended range support before the measurements land. (Other threads - // could potentially commit our inserts for us.) - // - // If our writes end up erroring out or getting rolled back, then this flag will - // stay set. This is okay though, as it only disables some query optimizations and - // won't result in any correctness issues if the flag is set when it doesn't need to - // be (as opposed to NOT being set when it DOES need to be -- that will cause - // correctness issues). Additionally, if the user tried to insert measurements with - // dates outside the standard range, chances are they will do so again, and we will - // have just set the flag a little early. - auto bucketsNs = makeTimeseriesBucketsNamespace(ns()); - auto bucketsColl = - CollectionCatalog::get(opCtx)->lookupCollectionByNamespaceForRead(opCtx, - bucketsNs); - auto timeSeriesOptions = *bucketsColl->getTimeseriesOptions(); - - if (auto currentSetting = bucketsColl->getRequiresTimeseriesExtendedRangeSupport(); - !currentSetting && - timeseries::measurementsHaveDateOutsideStandardRange( - timeSeriesOptions, request().getDocuments())) { - bucketsColl->setRequiresTimeseriesExtendedRangeSupport(opCtx); - } - } - std::vector<write_ops::WriteError> errors; boost::optional<repl::OpTime> opTime; boost::optional<OID> electionId; |