summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/pipeline.cpp
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@10gen.com>2018-03-19 10:19:05 -0400
committerMatthew Russotto <matthew.russotto@10gen.com>2018-03-19 13:45:22 -0400
commit4ce3eca38b5e8c786c33242c1a625728e1c1dcfe (patch)
tree7d6944ca8f913f07c17d74063f70dec7026bc9af /src/mongo/db/pipeline/pipeline.cpp
parentf7492502bfb24d1067e810ba9fd08e62f9a11c13 (diff)
downloadmongo-4ce3eca38b5e8c786c33242c1a625728e1c1dcfe.tar.gz
SERVER-33551 Switch Pipeline to use session interface to determine if in a transaction or snapshot read.
Diffstat (limited to 'src/mongo/db/pipeline/pipeline.cpp')
-rw-r--r--src/mongo/db/pipeline/pipeline.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/mongo/db/pipeline/pipeline.cpp b/src/mongo/db/pipeline/pipeline.cpp
index fafcd0d910f..2f6fce9e526 100644
--- a/src/mongo/db/pipeline/pipeline.cpp
+++ b/src/mongo/db/pipeline/pipeline.cpp
@@ -200,9 +200,6 @@ void Pipeline::validateFacetPipeline() const {
}
void Pipeline::validateCommon() const {
- // TODO SERVER-33551: Don't use presence of WUOW to decide whether we are in a snapshot read or
- // multi-doc transaction.
- const bool isSnapshotReadOrTxn = static_cast<bool>(pCtx->opCtx->getWriteUnitOfWork());
size_t i = 0;
for (auto&& stage : _sources) {
auto constraints = stage->constraints(_splitState);
@@ -231,7 +228,7 @@ void Pipeline::validateCommon() const {
str::stream() << stage->getSourceName() << " can only be run on mongoS",
!(constraints.hostRequirement == HostTypeRequirement::kMongoS && !pCtx->inMongos));
- if (isSnapshotReadOrTxn) {
+ if (pCtx->inSnapshotReadOrMultiDocumentTransaction) {
uassert(50742,
str::stream() << "Stage not supported with readConcern level \"snapshot\" "
"or inside of a multi-document transaction: "