diff options
author | Benety Goh <benety@mongodb.com> | 2018-02-17 11:40:24 -0500 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2018-08-03 12:55:16 -0400 |
commit | 2b5a3a10c1ddf159d35fe05a739f2b20416c249c (patch) | |
tree | 725e89b6c48bdc938ac6ec22e434ec440736fc92 | |
parent | 71d343f33c56cd11bab52062251a86a9b974d9b2 (diff) | |
download | mongo-2b5a3a10c1ddf159d35fe05a739f2b20416c249c.tar.gz |
SERVER-33245 remove unnecessary ScopeGuard for dropTempCollections() from mapReduce
(cherry picked from commit d4c4f81b7695c394dcb353be55d33a2c523518af)
-rw-r--r-- | src/mongo/db/commands/mr.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp index 18575045f92..6fb63e73c1c 100644 --- a/src/mongo/db/commands/mr.cpp +++ b/src/mongo/db/commands/mr.cpp @@ -1418,18 +1418,17 @@ public: BSONObjBuilder countsBuilder; BSONObjBuilder timingBuilder; - State state(opCtx, config); - if (!state.sourceExists()) { - return appendCommandStatus( - result, - Status(ErrorCodes::NamespaceNotFound, - str::stream() << "namespace does not exist: " << config.nss.ns())); - } - try { + State state(opCtx, config); + if (!state.sourceExists()) { + return appendCommandStatus( + result, + Status(ErrorCodes::NamespaceNotFound, + str::stream() << "namespace does not exist: " << config.nss.ns())); + } + state.init(); state.prepTempCollection(); - ON_BLOCK_EXIT_OBJ(state, &State::dropTempCollections); int progressTotal = 0; bool showTotal = true; @@ -1781,7 +1780,6 @@ public: } state.prepTempCollection(); - ON_BLOCK_EXIT_OBJ(state, &State::dropTempCollections); std::vector<std::shared_ptr<Chunk>> chunks; |