diff options
author | Benety Goh <benety@mongodb.com> | 2019-09-11 17:53:10 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-09-11 17:53:10 +0000 |
commit | 9fceba62efcb12da9fb7c5a9d88ee39569386d9a (patch) | |
tree | ffbaa632a0b891f8f2a10e159fecc2376a6aca90 | |
parent | 4bb229f58e4c16d95a44eeeaa9760aa468fb8227 (diff) | |
download | mongo-9fceba62efcb12da9fb7c5a9d88ee39569386d9a.tar.gz |
SERVER-42848 rename runCreateIndexes() with a mobile-specific name
-rw-r--r-- | src/mongo/db/commands/create_indexes.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/mongo/db/commands/create_indexes.cpp b/src/mongo/db/commands/create_indexes.cpp index 2d514d212e2..e7505ea41f6 100644 --- a/src/mongo/db/commands/create_indexes.cpp +++ b/src/mongo/db/commands/create_indexes.cpp @@ -397,12 +397,16 @@ Collection* getOrCreateCollection(OperationContext* opCtx, }); } -bool runCreateIndexes(OperationContext* opCtx, - const std::string& dbname, - const BSONObj& cmdObj, - std::string& errmsg, - BSONObjBuilder& result, - bool runTwoPhaseBuild) { +/** + * Creates indexes using the given specs for the mobile storage engine. + * TODO(SERVER-42513): Remove this function. + */ +bool runCreateIndexesForMobile(OperationContext* opCtx, + const std::string& dbname, + const BSONObj& cmdObj, + std::string& errmsg, + BSONObjBuilder& result, + bool runTwoPhaseBuild) { NamespaceString ns(CommandHelpers::parseNsCollectionRequired(dbname, cmdObj)); uassertStatusOK(userAllowedWriteNS(ns)); @@ -812,12 +816,13 @@ public: bool shouldLogMessageOnAlreadyBuildingError = true; while (true) { try { - // TODO: SERVER-42513 Re-enable on mobile. - if (storageGlobalParams.engine != "mobile") { - return runCreateIndexesWithCoordinator( + // TODO(SERVER-42513): Remove runCreateIndexesForMobile() when the mobile storage + // engine is supported by runCreateIndexesWithCoordinator(). + if (storageGlobalParams.engine == "mobile") { + return runCreateIndexesForMobile( opCtx, dbname, cmdObj, errmsg, result, false /*two phase build*/); } - return runCreateIndexes( + return runCreateIndexesWithCoordinator( opCtx, dbname, cmdObj, errmsg, result, false /*two phase build*/); } catch (const DBException& ex) { if (ex.toStatus() != ErrorCodes::IndexBuildAlreadyInProgress) { |