diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2022-08-15 14:26:44 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-08-15 15:34:24 +0000 |
commit | dab5cd5899ce6760ec5176b79821fcc45812624a (patch) | |
tree | e7abd3c22ea84da8bdb05f5790a3c86058cad92e /src/mongo/db/commands | |
parent | abca3f700aa1da45ea14c8f2dc6ab52f952e3945 (diff) | |
download | mongo-dab5cd5899ce6760ec5176b79821fcc45812624a.tar.gz |
SERVER-68635 Move the whole insert path out of CollectionImpl
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r-- | src/mongo/db/commands/getmore_cmd.cpp | 7 | ||||
-rw-r--r-- | src/mongo/db/commands/test_commands.cpp | 14 |
2 files changed, 8 insertions, 13 deletions
diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp index 2bc6b7d9471..c7750690cb5 100644 --- a/src/mongo/db/commands/getmore_cmd.cpp +++ b/src/mongo/db/commands/getmore_cmd.cpp @@ -27,11 +27,7 @@ * it in the license file. */ - -#include "mongo/platform/basic.h" - #include <fmt/format.h> - #include <memory> #include <string> @@ -66,16 +62,13 @@ #include "mongo/db/stats/top.h" #include "mongo/logv2/log.h" #include "mongo/rpc/rewrite_state_change_errors.h" -#include "mongo/s/chunk_version.h" #include "mongo/util/fail_point.h" #include "mongo/util/scopeguard.h" #include "mongo/util/time_support.h" #define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kQuery - namespace mongo { - namespace { using namespace fmt::literals; diff --git a/src/mongo/db/commands/test_commands.cpp b/src/mongo/db/commands/test_commands.cpp index d40430c7143..4b3e63cc9dc 100644 --- a/src/mongo/db/commands/test_commands.cpp +++ b/src/mongo/db/commands/test_commands.cpp @@ -34,7 +34,7 @@ #include "mongo/base/init.h" #include "mongo/db/catalog/capped_collection_maintenance.h" #include "mongo/db/catalog/capped_utils.h" -#include "mongo/db/catalog/collection.h" +#include "mongo/db/catalog/collection_write_path.h" #include "mongo/db/client.h" #include "mongo/db/commands.h" #include "mongo/db/commands/test_commands_enabled.h" @@ -50,11 +50,10 @@ #define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kCommand namespace mongo { - namespace { + const NamespaceString kDurableHistoryTestNss("mdb_testing.pinned_timestamp"); const std::string kTestingDurableHistoryPinName = "_testing"; -} // namespace using repl::UnreplicatedWritesBlock; using std::endl; @@ -111,7 +110,8 @@ public: } } OpDebug* const nullOpDebug = nullptr; - Status status = collection->insertDocument(opCtx, InsertStatement(obj), nullOpDebug, false); + Status status = collection_internal::insertDocument( + opCtx, collection, InsertStatement(obj), nullOpDebug, false); if (status.isOK()) { wunit.commit(); } @@ -283,8 +283,9 @@ public: uassertStatusOK(opCtx->getServiceContext()->getStorageEngine()->pinOldestTimestamp( opCtx, kTestingDurableHistoryPinName, requestedPinTs, round)); - uassertStatusOK(autoColl->insertDocument( + uassertStatusOK(collection_internal::insertDocument( opCtx, + *autoColl, InsertStatement(fixDocumentForInsert(opCtx, BSON("pinTs" << pinTs)).getValue()), nullptr)); wuow.commit(); @@ -297,6 +298,8 @@ public: MONGO_REGISTER_TEST_COMMAND(DurableHistoryReplicatedTestCmd); +} // namespace + std::string TestingDurableHistoryPin::getName() { return kTestingDurableHistoryPinName; } @@ -322,5 +325,4 @@ boost::optional<Timestamp> TestingDurableHistoryPin::calculatePin(OperationConte return ret; } - } // namespace mongo |