[SERVER-64722] Investigate and fix test failure at jstests/aggregation/sources/lookup/profile_lookup.js Created: 19/Mar/22  Updated: 29/Oct/23  Resolved: 13/Apr/22

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

Type: Task Priority: Major - P3
Reporter: Yoon Soo Kim Assignee: Mihai Andrei
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Sprint: QE 2022-04-04, QE 2022-04-18
Participants:
Linked BF Score: 35

 Description   

This issue happens when featureFlagSBELookupPushdown is turned on.

error message:

149 [js_test:profile_lookup] assert: [3] != [1] are not equal
150 [js_test:profile_lookup] doassert@src/mongo/shell/assert.js:20:14
151 [js_test:profile_lookup] assert.eq@src/mongo/shell/assert.js:179:17
152 [js_test:profile_lookup] @jstests/aggregation/sources/lookup/profile_lookup.js:37:8
153 [js_test:profile_lookup] @jstests/aggregation/sources/lookup/profile_lookup.js:40:2

We get a different failure for the following test.

buildscripts/resmoke.py run --suites=aggregation_facet_unwind_passthrough --mongodSetParameters="{featureFlagSBELookupPushdown: true}" jstests/aggregation/sources/lookup/profile_lookup.js
…
[js_test:profile_lookup] assert: [3] != [4] are not equal
[js_test:profile_lookup] doassert@src/mongo/shell/assert.js:20:14
[js_test:profile_lookup] assert.eq@src/mongo/shell/assert.js:179:17
[js_test:profile_lookup] @jstests/aggregation/sources/lookup/profile_lookup.js:37:8
[js_test:profile_lookup] @jstests/aggregation/sources/lookup/profile_lookup.js:40:2



 Comments   
Comment by Githook User [ 13/Apr/22 ]

Author:

{'name': 'Mihai Andrei', 'email': 'mihai.andrei@10gen.com', 'username': 'mtandrei'}

Message: SERVER-64722 Adjust expected top count in profile_lookup.js depending on status of pushed down $lookup
Branch: master
https://github.com/mongodb/mongo/commit/c106139f4d890a0d6e773570f813debf86b7031f

Comment by Kyle Suarez [ 07/Apr/22 ]

While important, this is not a release blocker so removing the "6.0 Required" fix version.

Comment by Eric Cox (Inactive) [ 21/Mar/22 ]

I think we need to update the test for this case when sbe is pushed down. Firstly, the local collection has three documents in it and the foreign has 1 document,

assert.commandWorked(localColl.insert([{a: 1}, {b: 1}, {a: 2}]));
assert.commandWorked(foreignColl.insert({a: 1}));

Then a simple lookup query is issued on field 'a',

localColl.aggregate(
      [{$lookup: {from: foreignColl.getName(), as: "res", localField: "a", foreignField: "a"}}]);

What I'm seeing is that the test is checking the "top" adminCommand to diff the number of commands issued against the foreignCollection. With featureFlagSBELookupPushdown off the top command result shows that three commands are issued against the foreign collection. One command per local document because of the recursive nature of DSLookup,

[js_test:profile_lookup] [jsTest] ----
[js_test:profile_lookup] [jsTest] XOXO newTop foreign commands =
[js_test:profile_lookup] [jsTest] ----
[js_test:profile_lookup]
[js_test:profile_lookup]
[js_test:profile_lookup]
[js_test:profile_lookup] [jsTest] ----
[js_test:profile_lookup] [jsTest] { "time" : 1416, "count" : 3 }
[js_test:profile_lookup] [jsTest] ----
[js_test:profile_lookup]
[js_test:profile_lookup]
[js_test:profile_lookup]
[js_test:profile_lookup] [jsTest] ----
[js_test:profile_lookup] [jsTest] XOXOX oldTop foreign commands =
[js_test:profile_lookup] [jsTest] ----
[js_test:profile_lookup]
[js_test:profile_lookup]
[js_test:profile_lookup]
[js_test:profile_lookup] [jsTest] ----
[js_test:profile_lookup] [jsTest] { "time" : 0, "count" : 0 }
[js_test:profile_lookup] [jsTest] ----

However we only see one command with sbe on because we only do 1 collscan on the foreign collection,

[js_test:profile_lookup] [jsTest] ----
[js_test:profile_lookup] [jsTest] XOXO newTop foreign commands =
[js_test:profile_lookup] [jsTest] ----
[js_test:profile_lookup]
[js_test:profile_lookup]
[js_test:profile_lookup]
[js_test:profile_lookup] [jsTest] ----
[js_test:profile_lookup] [jsTest] { "time" : 405, "count" : 1 }
[js_test:profile_lookup] [jsTest] ----
[js_test:profile_lookup]
[js_test:profile_lookup]
[js_test:profile_lookup]
[js_test:profile_lookup] [jsTest] ----
[js_test:profile_lookup] [jsTest] XOXOX oldTop foreign commands =
[js_test:profile_lookup] [jsTest] ----
[js_test:profile_lookup]
[js_test:profile_lookup]
[js_test:profile_lookup]
[js_test:profile_lookup] [jsTest] ----
[js_test:profile_lookup] [jsTest] { "time" : 0, "count" : 0 }
[js_test:profile_lookup] [jsTest] ----

My proposal is to accept this as a passing case and change the assertion if we have sbe $lookup pushdown on.

Generated at Thu Feb 08 06:00:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.