[SERVER-59097] Expose $documents as external stage Created: 04/Aug/21  Updated: 29/Oct/23  Resolved: 04/Oct/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.1.0-rc0

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

Issue Links:
Depends
Documented
is documented by DOCS-14841 Investigate changes in SERVER-59097: ... Closed
Duplicate
Gantt Dependency
Related
related to SERVER-58582 Create $documents stage and implement... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

The $documents right now is an internal stage for searchMetadata. It doesn't work as expected in sharded environment (returns a copy of the resultset per shard). This is confusing and should be fixed before $documents is exposed



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 04/Oct/21 ]

Author:

{'name': 'Charlie Swanson', 'email': 'charlie.swanson@mongodb.com', 'username': 'cswanson310'}

Message: SERVER-59097 Expose $documents as an externally visible stage
Branch: master
https://github.com/mongodb/mongo/commit/e7563044ca02b1d889a57ed0cb35bfe6082210bc

Comment by Charlie Swanson [ 24/Aug/21 ]

I believe to fix the problem we saw with sharding we'll need to set this 'isIndependentOfAnyCollection' flag:
https://github.com/mongodb/mongo/blob/2132263cf6983b42f8494715a7e915cb66106be0/src/mongo/db/pipeline/stage_constraints.h#L316

Looks like we could add it here, and that might make everything work - hopefully does not break any assumption of $lookup or $unionWith: https://github.com/mongodb/mongo/blob/2132263cf6983b42f8494715a7e915cb66106be0/src/mongo/db/pipeline/document_source_queue.h#L69

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