[DOCS-12484] Docs for SERVER-38360: Disallow pipelines which read from the same namespace that they write to Created: 15/Feb/19  Updated: 13/Nov/23  Resolved: 13/Jun/19

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 4.1.9, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Kay Kim (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-38360 Disallow pipelines which read from th... Closed
Participants:
Days since reply: 4 years, 34 weeks, 6 days ago
Epic Link: DOCS: 4.2 Server/Tools

 Description   

Description

Description:

$out with the new modes "insertDocuments" and "replaceDocuments" cannot write to a collection which is being read to by the aggregation or any $lookup or $graphLookup within the aggregation.

Engineering Ticket Description:

SERVER-37378 tracked the work to prevent the new "insertDocuments" and "replaceDocuments" $out modes from writing to the same namespace as the source of the aggregation. The existing "replaceCollection" mode is exempted from this restriction because this mode will write results to a temporary collection first. This means the intermediate results are not readable, and so this mode doesn't risk a server-side infinite-loop.

We should go one step further and prevent $out (with these new modes) from writing to the same namespace as any namespace read from in the pipeline, specifically including with a $lookup or $graphLookup.

It's unclear how we'll want to go about doing this, but the information about which namespaces are involved in the aggregation is most easily accessible from the LiteParsedPipeline. Unfortunately we don't have access to a LiteParsedPipeline at the time we are parsing an $out stage, so this check might have to live outside of DocumentSourceOut itself.

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Githook User [ 13/Jun/19 ]

Edit: Wrong docs ticket listed in commit – should have been DOCS-12598

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-12484: 4.2 $out stage and read concern majority
Branch: master
https://github.com/mongodb/docs/commit/759c68c83a9cc24052bf6250b3478207cbb57e88

Comment by Githook User [ 04/Jun/19 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-12484: 4.2 $merge output collection and other stages
Branch: master
https://github.com/mongodb/docs/commit/57d07af713b74d31409eeb3e5e31aa1bffe84f4c

Generated at Thu Feb 08 08:05:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.