summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/pipeline_command.cpp
diff options
context:
space:
mode:
authorCharlie Swanson <charlie.swanson@mongodb.com>2019-01-16 20:15:37 -0500
committerCharlie Swanson <charlie.swanson@mongodb.com>2019-01-16 20:15:37 -0500
commit97821dfa13cccb5acad6faef0f536e3d5d77d678 (patch)
tree80c13b3e04fbe9a759d48d4252bda1f70fd7197a /src/mongo/db/commands/pipeline_command.cpp
parent781be1ad38c79b755d28414c842527ff049c9d5d (diff)
downloadmongo-97821dfa13cccb5acad6faef0f536e3d5d77d678.tar.gz
Revert " SERVER-38311 Adjust $out merging strategy"
This reverts commit 0cb2195939494660334db8e9d0a52509caeb621c.
Diffstat (limited to 'src/mongo/db/commands/pipeline_command.cpp')
-rw-r--r--src/mongo/db/commands/pipeline_command.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp
index 9d023d1cd45..edcd4af42b1 100644
--- a/src/mongo/db/commands/pipeline_command.cpp
+++ b/src/mongo/db/commands/pipeline_command.cpp
@@ -65,23 +65,16 @@ public:
private:
bool supportsWriteConcern() const override {
- // For an aggregate command that specifies a writeConcern, we check on mongoS whether
- // there's an $out in the pipeline, and reject the command if there isn't. Otherwise,
- // we forward the writeConcern to any and all aggregates sent to the shards, even for an
- // aggregate which represents a part of the global pipeline that does not contain the
- // $out. So if the command is from mongos we can trust that the write concern makes
- // sense. Otherwise we validate that writeConcern is only passed when there's an $out
- // stage.
- return this->_request.body["fromMongos"].trueValue() ||
- Pipeline::aggSupportsWriteConcern(this->_request.body);
+ return Pipeline::aggSupportsWriteConcern(this->_request.body);
}
bool supportsReadConcern(repl::ReadConcernLevel level) const override {
// Aggregations that are run directly against a collection allow any read concern.
// Otherwise, if the aggregate is collectionless then the read concern must be 'local'
// (e.g. $currentOp). The exception to this is a $changeStream on a whole database,
- // which is considered collectionless but must be read concern 'majority'. Further read
- // concern validation is done once the pipeline is parsed.
+ // which is
+ // considered collectionless but must be read concern 'majority'. Further read concern
+ // validation is done one the pipeline is parsed.
return level == repl::ReadConcernLevel::kLocalReadConcern ||
level == repl::ReadConcernLevel::kMajorityReadConcern ||
!AggregationRequest::parseNs(_dbName, _request.body).isCollectionlessAggregateNS();