mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
SERVER-44470 Use supportsReadConcern() for $out and $merge stages
This commit is contained in:
parent
0a1b503e3f
commit
a8b246e6ac
@ -373,11 +373,6 @@ boost::intrusive_ptr<DocumentSource> DocumentSourceMerge::create(
|
||||
"{} cannot be used in a transaction"_format(kStageName),
|
||||
!expCtx->inMultiDocumentTransaction);
|
||||
|
||||
auto readConcernLevel = repl::ReadConcernArgs::get(expCtx->opCtx).getLevel();
|
||||
uassert(ErrorCodes::InvalidOptions,
|
||||
"{} cannot be used with a 'linearizable' read concern level"_format(kStageName),
|
||||
readConcernLevel != repl::ReadConcernLevel::kLinearizableReadConcern);
|
||||
|
||||
uassert(31319,
|
||||
"Cannot {} to special collection: {}"_format(kStageName, outputNs.coll()),
|
||||
!outputNs.isSystem());
|
||||
|
@ -79,6 +79,14 @@ public:
|
||||
bool allowedToPassthroughFromMongos() const final {
|
||||
return false;
|
||||
}
|
||||
|
||||
ReadConcernSupportResult supportsReadConcern(repl::ReadConcernLevel level) const final {
|
||||
return {
|
||||
{level == repl::ReadConcernLevel::kLinearizableReadConcern,
|
||||
{ErrorCodes::InvalidOptions,
|
||||
"{} cannot be used with a 'linearizable' read concern level"_format(kStageName)}},
|
||||
Status::OK()};
|
||||
}
|
||||
};
|
||||
|
||||
virtual ~DocumentSourceMerge() = default;
|
||||
|
@ -207,11 +207,6 @@ boost::intrusive_ptr<DocumentSource> DocumentSourceOut::createAndAllowDifferentD
|
||||
"{} cannot be used in a transaction"_format(kStageName),
|
||||
!expCtx->inMultiDocumentTransaction);
|
||||
|
||||
auto readConcernLevel = repl::ReadConcernArgs::get(expCtx->opCtx).getLevel();
|
||||
uassert(ErrorCodes::InvalidOptions,
|
||||
"{} cannot be used with a 'linearizable' read concern level"_format(kStageName),
|
||||
readConcernLevel != repl::ReadConcernLevel::kLinearizableReadConcern);
|
||||
|
||||
uassert(ErrorCodes::InvalidNamespace,
|
||||
"Invalid {} target namespace, {}"_format(kStageName, outputNs.ns()),
|
||||
outputNs.isValid());
|
||||
|
@ -62,6 +62,14 @@ public:
|
||||
bool allowedToPassthroughFromMongos() const final {
|
||||
return false;
|
||||
}
|
||||
|
||||
ReadConcernSupportResult supportsReadConcern(repl::ReadConcernLevel level) const final {
|
||||
return {
|
||||
{level == repl::ReadConcernLevel::kLinearizableReadConcern,
|
||||
{ErrorCodes::InvalidOptions,
|
||||
"{} cannot be used with a 'linearizable' read concern level"_format(kStageName)}},
|
||||
Status::OK()};
|
||||
}
|
||||
};
|
||||
|
||||
~DocumentSourceOut() override;
|
||||
|
Loading…
Reference in New Issue
Block a user