[SERVER-38728] Allow pipeline with $lookup into a sharded collection to run on mongod Created: 20/Dec/18  Updated: 29/Oct/23  Resolved: 29/Jan/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.1.8

Type: Bug Priority: Major - P3
Reporter: Brigitte Lamarche (Inactive) Assignee: Ian Boros
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-32308 Add the ability for a $lookup stage t... Closed
is depended on by SERVER-38995 Allow geoNear within a lookup pipelin... Closed
is depended on by SERVER-38996 Allow $text within a lookup pipeline ... Closed
is depended on by SERVER-32536 Add collation support for sharded $lo... Closed
is depended on by SERVER-32548 Add $lookup support for sharded views Closed
is depended on by SERVER-38825 Gate sharded $lookup / $graphLookup w... Closed
is depended on by SERVER-38830 Support sharded $lookup 'let' variabl... Closed
is depended on by SERVER-27533 Allow "from" collection of $graphLook... Closed
is depended on by SERVER-38758 Avoid restarting $lookup from the top... Closed
is depended on by SERVER-39015 Make local reads for $lookup/$graphLo... Closed
is depended on by SERVER-39016 Make sharded $lookup queries run on n... Closed
is depended on by SERVER-39048 Ban $lookup on sharded collections wh... Closed
Related
related to SERVER-74102 Hedging options should only be availa... Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Go to jstests/noPassthrough/lookup_max_nested_pipeline.js, remove the if(0){...} wrapping sharded test, and run this test. 

Sprint: Query 2019-01-14, Query 2019-01-28, Query 2019-02-11
Participants:

 Description   

Currently, running a nested $lookup pipeline on a sharded cluster will fail: 

 
[js_test:lookup_max_nested_pipeline] 2018-12-20T13:33:59.473-0500 2018-12-20T13:33:59.472-0500 E QUERY    [js] Error: command failed: {
 
[js_test:lookup_max_nested_pipeline] 2018-12-20T13:33:59.473-0500 "ok" : 0,
 
[js_test:lookup_max_nested_pipeline] 2018-12-20T13:33:59.473-0500 "errmsg" : "$lookup must run on mongoS, but cannot :: caused by :: $lookup must run on a shard",
 
[js_test:lookup_max_nested_pipeline] 2018-12-20T13:33:59.473-0500 "code" : 20,
 
[js_test:lookup_max_nested_pipeline] 2018-12-20T13:33:59.473-0500 "codeName" : "IllegalOperation",
 
[js_test:lookup_max_nested_pipeline] 2018-12-20T13:33:59.473-0500 "operationTime" : Timestamp(1545330839, 14),
 
[js_test:lookup_max_nested_pipeline] 2018-12-20T13:33:59.473-0500 "$clusterTime" : {
 
[js_test:lookup_max_nested_pipeline] 2018-12-20T13:33:59.473-0500 "clusterTime" : Timestamp(1545330839, 16),
 
[js_test:lookup_max_nested_pipeline] 2018-12-20T13:33:59.473-0500 "signature" : {
 
[js_test:lookup_max_nested_pipeline] 2018-12-20T13:33:59.474-0500 "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
 
[js_test:lookup_max_nested_pipeline] 2018-12-20T13:33:59.474-0500 "keyId" : NumberLong(0)
 
[js_test:lookup_max_nested_pipeline] 2018-12-20T13:33:59.474-0500 }
 
[js_test:lookup_max_nested_pipeline] 2018-12-20T13:33:59.474-0500 }
 
[js_test:lookup_max_nested_pipeline] 2018-12-20T13:33:59.474-0500 } :

 Part of this ticket is changing jstests/noPassthrough/lookup_max_nested_pipeline.js to also run in the sharded case. 



 Comments   
Comment by Githook User [ 30/Jan/19 ]

Author:

{'email': 'ian.boros@10gen.com', 'name': 'Ian Boros'}

Message: SERVER-38728 allow pipeline with lookup stage on sharded collection to run on mongod
Branch: master
https://github.com/mongodb/mongo/commit/da3c2c2dfcf0fc680a4f49f8f29ab0671f345d61

Comment by Ian Boros [ 29/Jan/19 ]

https://github.com/mongodb/mongo/commit/da3c2c2dfcf0fc680a4f49f8f29ab0671f345d61

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