-
Type:
Bug
-
Resolution: Won't Fix
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
ALL
-
Query 2018-09-24
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When creating or modifying a view, the ViewCatalog will parse the view pipeline for validation. Doing so requires a MongoProcessInterface, and the ViewCatalog uses the stub implementation:
view_catalog.cpp
boost::intrusive_ptr<ExpressionContext> expCtx =
new ExpressionContext(opCtx,
request,
CollatorInterface::cloneCollator(viewDef.defaultCollator()),
// We can use a stub MongoProcessInterface because we are only parsing
// the Pipeline for validation here. We won't do anything with the
// pipeline that will require a real implementation.
std::make_shared<StubMongoProcessInterface>(),
std::move(resolvedNamespaces),
boost::none);
// Save this to a variable to avoid reading the atomic variable multiple times.
auto currentFCV = serverGlobalParams.featureCompatibility.getVersion();
// If the feature compatibility version is not 4.2, and we are validating features as master,
// ban the use of new agg features introduced in 4.2 to prevent them from being persisted in the
// catalog.
if (serverGlobalParams.validateFeaturesAsMaster.load() &&
currentFCV != ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo42) {
expCtx->maxFeatureCompatibilityVersion = currentFCV;
}
auto pipelineStatus = Pipeline::parse(viewDef.pipeline(), std::move(expCtx));
if (!pipelineStatus.isOK()) {
return pipelineStatus.getStatus();
}
But with the new $out improvements in 4.1 to output to a sharded collection, $out parsing requires a valid implementation of MongoProcessInterface::isSharded(). We should revisit this code to prepare for a world where $out and $lookup might require a real MongoProcessInterface for parsing.
- is related to
-
SERVER-36123 Reject $out with mode: "replaceCollection" if the output collection is sharded
-
- Closed
-