diff options
author | Ian Boros <ian.boros@10gen.com> | 2019-01-03 16:02:22 -0500 |
---|---|---|
committer | Ian Boros <ian.boros@10gen.com> | 2019-01-29 12:20:53 -0500 |
commit | da3c2c2dfcf0fc680a4f49f8f29ab0671f345d61 (patch) | |
tree | 2fea8318b64d66fbd14847d01e94a3bc12886b01 /jstests/sharding/lookup_mongod_unaware.js | |
parent | cf47aee946c42c246a9176e1df1cd27b12dde685 (diff) | |
download | mongo-da3c2c2dfcf0fc680a4f49f8f29ab0671f345d61.tar.gz |
SERVER-38728 allow pipeline with lookup stage on sharded collection to run on mongod
Diffstat (limited to 'jstests/sharding/lookup_mongod_unaware.js')
-rw-r--r-- | jstests/sharding/lookup_mongod_unaware.js | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/jstests/sharding/lookup_mongod_unaware.js b/jstests/sharding/lookup_mongod_unaware.js index 0c6072f8095..a7dfd6bc38a 100644 --- a/jstests/sharding/lookup_mongod_unaware.js +++ b/jstests/sharding/lookup_mongod_unaware.js @@ -94,17 +94,11 @@ restartPrimaryShard(st.rs0, mongos0LocalColl, mongos0ForeignColl); assert.eq(mongos0LocalColl.aggregate(pipeline).toArray(), expectedResults); - // Verify $lookup results through mongos1, which is not aware that the local - // collection is sharded. The results are expected to be incorrect when both the mongos and - // primary shard incorrectly believe that a collection is unsharded. - // TODO: This should be fixed by SERVER-32629, likewise for the other aggregates in this file - // sent to the stale mongos. + // Verify $lookup results through mongos1, which is not aware that the foreign collection is + // sharded. In this case the results will be correct since the entire pipeline will be run on a + // shard, which will do a refresh before executing the foreign pipeline. restartPrimaryShard(st.rs0, mongos0LocalColl, mongos0ForeignColl); - assert.eq(mongos1LocalColl.aggregate(pipeline).toArray(), [ - {_id: 0, a: 1, "same": []}, - {_id: 1, a: null, "same": [{_id: 1, b: null}, {_id: 2}]}, - {_id: 2, "same": [{_id: 1, b: null}, {_id: 2}]} - ]); + assert.eq(mongos1LocalColl.aggregate(pipeline).toArray(), expectedResults); // // Test sharded local and sharded foreign collections, with the primary shard unaware that @@ -134,6 +128,8 @@ // Verify $lookup results through mongos1, which is not aware that the local // collection is sharded. The results are expected to be incorrect when both the mongos and // primary shard incorrectly believe that a collection is unsharded. + // TODO: This should be fixed by SERVER-32629, likewise for the other aggregates in this file + // sent to the stale mongos. restartPrimaryShard(st.rs0, mongos0LocalColl, mongos0ForeignColl); assert.eq(mongos1LocalColl.aggregate(pipeline).toArray(), [ {_id: 1, a: null, "same": [{_id: 1, b: null}, {_id: 2}]}, |