[SERVER-77185] Bug with implementation of $lookup in SBE Created: 16/May/23 Updated: 29/Oct/23 Resolved: 31/May/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 6.0.6 |
| Fix Version/s: | 7.1.0-rc0, 6.0.7, 7.0.0-rc4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Felipe Gasper | Assignee: | Ivan Fefer |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Backport Requested: |
v7.0, v6.3, v6.0
|
||||||||||||
| Steps To Reproduce: | Unknown; this was a BF from mongosync. These can be hard to reproduce, unfortunately. |
||||||||||||
| Sprint: | QE 2023-05-29, QE 2023-06-12 | ||||||||||||
| Participants: | |||||||||||||
| Description |
Sending to Query Execution per mihai.andrei@mongodb.com. |
| Comments |
| Comment by Githook User [ 12/Jun/23 ] |
|
Author: {'name': 'Ivan Fefer', 'email': 'ivan.fefer@mongodb.com', 'username': 'Fefer-Ivan'}Message: |
| Comment by Githook User [ 12/Jun/23 ] |
|
Author: {'name': 'Ivan Fefer', 'email': 'ivan.fefer@mongodb.com', 'username': 'Fefer-Ivan'}Message: |
| Comment by Githook User [ 30/May/23 ] |
|
Author: {'name': 'Ivan Fefer', 'email': 'ivan.fefer@mongodb.com', 'username': 'Fefer-Ivan'}Message: |
| Comment by Ivan Fefer [ 24/May/23 ] |
|
The bug is in buffered value spilling condition: https://github.com/mongodb/mongo/blob/ecf5b575b936f7bbf6d9b3a581a18760e6450ab3/src/mongo/db/exec/sbe/stages/hash_lookup.cpp#L343 HashLookup has _buffer vector in-memory and spilled RecordStore for the rest of the values. When we start spilling, we should always spill. Otherwise there is this bug: There are actually two bugs:
I will fix the bug, add a regression test.
|
| Comment by Ivan Fefer [ 24/May/23 ] |
|
I was able to reproduce the issue. |