[SERVER-83519] $search inside $lookup is failing with a SBE-related error Created: 21/Nov/23  Updated: 14/Dec/23  Resolved: 05/Dec/23

Status: Closed
Project: Core Server
Component/s: Query Execution
Affects Version/s: None
Fix Version/s: 7.3.0-rc0

Type: Bug Priority: Major - P3
Reporter: William Zhou Assignee: Zixuan Zhuang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Problem/Incident
causes SERVER-83764 [v7.2] Disable $search SBE pushdown i... Closed
Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.2
Participants:

 Description   

Mongot's nightly test runs against mongo-master are failing in certain pipelines with $search inside lookup with the following error - 

FAILURE: Command failed with error 4946301 (Location4946301): 'PlanExecutor error during aggregation :: caused by :: undefined slot accessor:6' on server localhost:37017. 

An example of a run can be found in this patch: https://evergreen.mongodb.com/test_log/mongot_master_ubuntu1804_mdb_master_large_e2e_tests_655872871e2d175fd4b51569_23_11_18_08_15_03/0?test_name=397256bf32667ff1348f15b9b536f3e2&group_id=#L1

 

Full patch run link (ignore "MQL" related failures, those are unrelated): https://spruce.mongodb.com/task/mongot_master_ubuntu1804_mdb_master_large_e2e_tests_patch_106d4d5fc0bdb55cff530f115023ec9de1cf5bea_655bf7381e2d17b422621953_23_11_21_00_18_24?execution=0&sortBy=STATUS&sortDir=ASC

Pipeline from these mongot tests are failing:

Each of these tests have the following structure:

[
{$lookup: {pipeline: [$search, ...]}},
{$sort}
]

 



 Comments   
Comment by Githook User [ 01/Dec/23 ]

Author:

{'name': 'Kevin Cherkauer', 'email': 'kevin.cherkauer@mongodb.com', 'username': 'kevin-cherkauer'}

Message: SERVER-83764 Disable $search SBE pushdown in 7.2 to avoid SERVER-83519
Branch: v7.2
https://github.com/mongodb/mongo/commit/7946a7738b28aa2fb963801b38259b163aaa8dff

Comment by Kevin Cherkauer [ 28/Nov/23 ]

The high-level problem is that a SlotId is referenced at execution time that cannot be found (may not exist, or may exist but not be visible).

As all the failing queries have a $sort stage, the problem may be related to the recent addition of a new slot for sorts in support of $search:

PlanStageMetadataSlots::sortKeySlot – sbe_stage_builder_plan_data.h

This was added 2023-10-23 by SERVER-78560.

Comment by William Zhou [ 27/Nov/23 ]

Hi kevin.cherkauer@mongodb.com,

I attached the full patch build link to the description of the ticket. We are able to reproduce the error by running a evergreen patch on mongot-master against the mongo nightly build. Full steps below:

  • clone mongot
  • modify `.evergreen.yml` inside mongot and add the following variant to the bottom:
    • - name: ubuntu1804-mdb-master-large
      display_name: Ubuntu1804-MDB-master-RAPID
      run_on:
      - ubuntu1804-large
      expansions:
      platform: linux
      docker_cluster_type: single-master
      tasks:
      - name: integration_tests_and_cleanup
      - name: e2e_tests_and_cleanup
      
      

       

  • run `evergreen patch -p mongot-master -u` and select the E2E test task on the above variant.

The JSON files provided are consumed by the mongot E2E test runner, which creates a collection of the documents specified in the test, creates a search index against that collection, then runs the specified aggregation pipeline against the collection. Let me know if any other information is needed.

Comment by William Zhou [ 21/Nov/23 ]

cc evan.nixon@mongodb.com 

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