[SERVER-65961] Copy only BSON types during yielding of SBE plans Created: 26/Apr/22 Updated: 29/Oct/23 Resolved: 29/Apr/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.0.0-rc4, 6.1.0-rc0 |
| Type: | Bug | Priority: | Blocker - P1 |
| Reporter: | Nikita Lapkov (Inactive) | Assignee: | Nikita Lapkov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Backport Requested: |
v6.0
|
||||||||||||
| Sprint: | QE 2022-05-02 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 155 | ||||||||||||
| Description |
|
Imagine we have the following SBE plan:
Basically, we are collecting some values into ArraySet in s12, make a reference to s12 with s13 and then unwind ArraySet from s13. Now imagine that after unwinding first N elements, yield happens. All values in the tree will be copied, including the value behind s13. Unwind will update its reference to ArraySet to point to the freshly copied value and skip first N elements. The problem is, we have no guarantee that these N elements are in fact the same elements produced before, since ArraySet does not have ordering guarantees. Since all non-BSON values are always owned by the SBE tree, it makes sense to copy only BSON values during yielding. This will also solve the problem outlined above. |
| Comments |
| Comment by Githook User [ 29/Apr/22 ] |
|
Author: {'name': 'Nikita Lapkov', 'email': 'nikita.lapkov@mongodb.com', 'username': 'laplab'}Message: (cherry picked from commit a88230980fbeefa27f3b7cc07776650c6dfdb49f) |
| Comment by Githook User [ 28/Apr/22 ] |
|
Author: {'name': 'Nikita Lapkov', 'email': 'nikita.lapkov@mongodb.com', 'username': 'laplab'}Message: |