[SERVER-63259] Fix inaccurate comment relating to SEARCH_META handling in SBE stage builder Created: 03/Feb/22  Updated: 29/Oct/23  Resolved: 28/Feb/22

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

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: Mihai Andrei
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: QE 2022-03-07
Participants:

 Description   

This comment implies that the value of the SEARCH_META variable in the SBE RuntimeEnvironment can be set later on. That's not true. There is no downstream code to set the SEARCH_META value. And if there is a value for SEARCH_META inside ExpressionContext::variables, it will already have been set in the RuntimeEnvironment here.

After discussing with mihai.andrei, he explained that this code is actually a special case to handle non-$search queries which refer to SEARCH_META. We have an example test in the enterprise modules here. SEARCH_META is supposed to resolve to "missing" for non-$search queries. We currently deal with this in the SBE stage builder by establishing a missing value in the RuntimeEnvironment and then referring to this runtime environment slot later in the SBE plan. We should update the comment to correctly explain why this code exists.



 Comments   
Comment by Githook User [ 28/Feb/22 ]

Author:

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

Message: SERVER-63259 Generate 'Nothing' value for SEARCH_META in SBE stage builder
Branch: master
https://github.com/mongodb/mongo/commit/599f2e494d98dcf7cf0b619abdd3c8d582e43880

Comment by Githook User [ 25/Feb/22 ]

Author:

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

Message: SERVER-63259 Update SEARCH_META comment in SBE stage builder
Branch: master
https://github.com/mongodb/mongo/commit/6d26e96928ddc1e58f875b223612458c2466ca02

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