[SERVER-82197] Incorrect query results in SBE if $group spills in presence of collation Created: 13/Oct/23 Updated: 24/Jan/24 Resolved: 08/Jan/24 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.2.1, 7.3.0-rc0, 7.0.5, 6.0.13 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Irina Yatsenko (Inactive) | Assignee: | Foteini Alvanaki |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | auto-reverted, bkp | ||
| 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.2, v7.0, v6.0
|
||||||||||||||||
| Steps To Reproduce: |
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 35 | ||||||||||||||||
| Description |
|
When processing the inputs from the child in HashAggStage, it's possible that equivalent per the collation but not identical keys would come in separated by another key (like "A" and "a" in the repro are separated by "B"). As a result, the recordStore with spilled records might not have "a" and "A" next to each other, but HashAggStage::getNextSpilled() assumes they are... This bug causes |
| Comments |
| Comment by Githook User [ 08/Jan/24 ] | |||||||||||||
|
Author: {'name': 'Foteini Alvanaki', 'email': 'foteini.alvanaki@mongodb.com', 'username': ''}Message: (cherry picked from commit 9af9ff389e464faa970d89b07c2d3da8e5992a63) | |||||||||||||
| Comment by Githook User [ 19/Dec/23 ] | |||||||||||||
|
Author: {'name': 'Foteini Alvanaki', 'email': 'foteini.alvanaki@mongodb.com', 'username': ''}Message: (cherry picked from commit 9af9ff389e464faa970d89b07c2d3da8e5992a63) GitOrigin-RevId: 1044821cf7cf6c1fe6892293c50fdc1de89e749b | |||||||||||||
| Comment by Githook User [ 19/Dec/23 ] | |||||||||||||
|
Author: {'name': 'Foteini Alvanaki', 'email': 'foteini.alvanaki@mongodb.com', 'username': ''}Message: (cherry picked from commit 9af9ff389e464faa970d89b07c2d3da8e5992a63) GitOrigin-RevId: 53b69e94d8c7f905ce797c81a027c7808835799a | |||||||||||||
| Comment by Githook User [ 18/Dec/23 ] | |||||||||||||
|
Author: {'name': 'Foteini Alvanaki', 'email': 'foteini.alvanaki@mongodb.com', 'username': ''}Message: GitOrigin-RevId: 9af9ff389e464faa970d89b07c2d3da8e5992a63 | |||||||||||||
| Comment by Githook User [ 22/Nov/23 ] | |||||||||||||
|
Author: {'name': 'auto-revert-processor', 'email': 'dev-prod-dag@mongodb.com', 'username': ''}Message: Revert " This reverts commit 96841a6a6c2ebe78b01cf8c6a919b3e34838095f. | |||||||||||||
| Comment by Githook User [ 22/Nov/23 ] | |||||||||||||
|
Author: {'name': 'Foteini Alvanaki', 'email': 'foteini.alvanaki@mongodb.com', 'username': ''}Message: | |||||||||||||
| Comment by Foteini Alvanaki [ 13/Nov/23 ] | |||||||||||||
|
I looked at the code. The problem is that the collator is not used when we serialize an array or object key.
| |||||||||||||
| Comment by Irina Yatsenko (Inactive) [ 11/Nov/23 ] | |||||||||||||
|
The problem still repro if the key is an array or object: For example, for arrays have:
| |||||||||||||
| Comment by Foteini Alvanaki [ 16/Oct/23 ] | |||||||||||||
|
Yes, this is a duplicate of | |||||||||||||
| Comment by David Storch [ 16/Oct/23 ] | |||||||||||||
|
At a glance this looks like a duplicate of |