[SERVER-45972] Test that $out can write to the same collection it is reading from Created: 04/Feb/20  Updated: 29/Oct/23  Resolved: 06/Mar/20

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 4.4.0-rc0, 4.7.0

Type: Task Priority: Major - P3
Reporter: David Storch Assignee: David Storch
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on SERVER-46077 Create aggregation_secondary_reads pa... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.4
Sprint: Query 2020-03-23
Participants:

 Description   

This test coverage is apparently missing. By adding this coverage in the jstests/aggregation/ directory, we also get the benefit of it running in various passthrough suites. In particular, this will run in the new aggregation_secondary_reads passthrough suite which was recently added under SERVER-46077.



 Comments   
Comment by Githook User [ 19/Mar/20 ]

Author:

{'name': 'David Storch', 'username': 'dstorch', 'email': 'david.storch@mongodb.com'}

Message: SERVER-45972 Test that $out can read from and write to the same collection

(cherry picked from commit a0ea828db65d96d8c49ca998b9a9aa4c5f1671e7)
Branch: v4.4
https://github.com/mongodb/mongo/commit/a82803ef831c1e9ddd1518ec781df23c1edc7fda

Comment by Githook User [ 06/Mar/20 ]

Author:

{'name': 'David Storch', 'username': 'dstorch', 'email': 'david.storch@mongodb.com'}

Message: SERVER-45972 Test that $out can read from and write to the same collection
Branch: master
https://github.com/mongodb/mongo/commit/a0ea828db65d96d8c49ca998b9a9aa4c5f1671e7

Comment by David Storch [ 05/Mar/20 ]

mihai.andrei yeah, I also couldn't find a test in jstests/aggregation/ proving that the source and target collections for $out can be the same. Let's repurpose this ticket to be about adding basic test coverage for this.

Comment by Mihai Andrei [ 03/Mar/20 ]

It looks we have coverage for this through https://github.com/mongodb/mongo/blob/master/jstests/aggregation/sources/merge/merge_to_referenced_collection.js for $merge, but we might need to write a test for $out. The closest thing I could find to coverage was this test, but this test verifies that $out can't write to a system collection.

Comment by David Storch [ 02/Mar/20 ]

ian.boros I'm returning this to the backlog. We hope to get test coverage of this with a new aggregation_secondary_reads passthrough in SERVER-46077. mihai.andrei will confirm.

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