[SERVER-74245] $group queries stored in SBE plan cache should encode 'needsMerge' into plan cache key Created: 21/Feb/23  Updated: 29/Oct/23  Resolved: 22/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0, 6.3.0-rc2

Type: Bug Priority: Blocker - P1
Reporter: Jennifer Peshansky (Inactive) Assignee: Mihai Andrei
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Problem/Incident
causes SERVER-75239 [v6.3] Remove accidentally added test... Closed
Related
is related to SERVER-49979 Support expression $dateToString in SBE Closed
Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.3
Sprint: QE 2023-03-06, QE 2023-03-20, QE 2023-04-03
Participants:
Linked BF Score: 168

 Description   

This bug was exposed when dateToString was implemented in SBE.
jstests/sharding/query/merge_use_cases.js began failing on the last assertion with the message:

2788 uncaught exception: Error: [{
2789         "_id" : "2018-08-15T06",
2790         "ticks" : [
2791                 1,
2792                 550,
2793                 0
2794         ],
2795         "avgTemp" : {
2796                 "count" : NumberLong(10),
2797                 "ps" : [
2798                         1,
2799                         403,
2800                         0
2801                 ]
2802         }
2803 }] != [{ "_id" : "2018-08-15T06", "ticks" : 550, "avgTemp" : 40.3 }] are not equal 

The bug occurs whether featureFlagSbeFull is on or not. However, it does not occur when forceClassicEngine is on. I suspect it's a bug that is now exposed by the entire prefix of the pipeline being supported in SBE and therefore eligible for pushdown.

I've commented out the failing line for now, until this can be further investigated.



 Comments   
Comment by Githook User [ 22/Mar/23 ]

Author:

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

Message: SERVER-74245 Encode 'ExpressionContext::needsMerge' in SBE plan cache keys

(cherry picked from commit 6ad0ba2141f14bdbd71d064b9aab04bb967617f2)
Branch: v6.3
https://github.com/mongodb/mongo/commit/ea7276ff7a715ac6e6f2a42797ca57aa6de3572a

Comment by Githook User [ 22/Mar/23 ]

Author:

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

Message: SERVER-74245 Encode 'ExpressionContext::needsMerge' in SBE plan cache keys
Branch: master
https://github.com/mongodb/mongo/commit/6ad0ba2141f14bdbd71d064b9aab04bb967617f2

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