diff options
author | Randolph Tan <randolph@10gen.com> | 2019-05-03 15:47:19 -0400 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2019-05-07 13:05:27 -0400 |
commit | 042f4e1f2164f3a801acfd379fafc217817b392c (patch) | |
tree | a616206b4eb1bf55ab345b81dd23bb68959fa54f | |
parent | be5df1fab8bd151b5b5405ba4500462c1a1f8db9 (diff) | |
download | mongo-042f4e1f2164f3a801acfd379fafc217817b392c.tar.gz |
SERVER-41001 mongos map reduce cleaup aborts on first command failure
-rw-r--r-- | src/mongo/s/commands/cluster_map_reduce_cmd.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mongo/s/commands/cluster_map_reduce_cmd.cpp b/src/mongo/s/commands/cluster_map_reduce_cmd.cpp index 7bd951f4613..3a9cfddcdf6 100644 --- a/src/mongo/s/commands/cluster_map_reduce_cmd.cpp +++ b/src/mongo/s/commands/cluster_map_reduce_cmd.cpp @@ -732,21 +732,22 @@ private: auto dropCmd = dropCmdBuilder.obj(); - try { - // drop collections with tmp results on each shard - for (const auto& server : servers) { - BSONObj result; + // drop collections with tmp results on each shard + for (const auto& server : servers) { + BSONObj result; + + try { ScopedDbConnection conn(server); conn->runCommand(dbName, dropCmd, result); conn.done(); uassertStatusOK(getStatusFromCommandResult(result)); uassertStatusOK(getWriteConcernStatusFromCommandResult(result)); + } catch (const DBException& e) { + warning() << "Cleanup error on " << server << ": " << redact(e); + } catch (const std::exception& e) { + severe() << "Cleanup error on " << server << ": " << causedBy(redact(e.what())); } - } catch (const DBException& e) { - warning() << "Cannot cleanup shard results" << redact(e); - } catch (const std::exception& e) { - severe() << "Cannot cleanup shard results" << causedBy(redact(e.what())); } } |