[SERVER-65259] Cursor leak in aggregation that requires merging on shard Created: 05/Apr/22 Updated: 29/Oct/23 Resolved: 21/Sep/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.19, 5.0.15, 6.0.4, 6.2.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jordi Serra Torrens | Assignee: | Mickey Winters |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v6.1, v6.0, v5.0, v4.4
|
||||||||
| Steps To Reproduce: | ./buildscripts/resmoke.py run --storageEngine=wiredTiger --storageEngineCacheSizeGB=.50 --suite=sharding jstests/sharding/repro-server-65259.js --log=file |
||||||||
| Sprint: | QE 2022-09-19, QE 2022-10-03 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 4 | ||||||||
| Description |
|
Consider an aggregation that requires merging on a shard. First, mongos opens the split cursors on the shards. Later, in order to establish the merge cursor, dispatchMergingPipeline is called and the split cursors ownership is transferred to it. There, sharded_agg_helpers::addMergeCursorsSource will transfer the split cursors ownership to the merge pipeline. Finally, the merge cursor will be established. However, if this fails (for instance if the shard is in the middle of a migration critical section), 'storePossibleCursor' will return here and then the split cursors ownership is dismissed from the mergePipeline. However, because the merge cursor was not really established, the shard did not take ownership of those cursors either, so they are leaked. |
| Comments |
| Comment by Githook User [ 16/Dec/22 ] |
|
Author: {'name': 'Mickey. J Winters', 'email': 'mickey.winters@mongodb.com', 'username': 'mjrb'}Message: (cherry-picked from commit 7f40c171562cb8de1dfae04368ca54e44a193f96) |
| Comment by Githook User [ 16/Dec/22 ] |
|
Author: {'name': 'Mickey. J Winters', 'email': 'mickey.winters@mongodb.com', 'username': 'mjrb'}Message: (cherry-picked from commit 7f40c171562cb8de1dfae04368ca54e44a193f96) |
| Comment by Githook User [ 15/Dec/22 ] |
|
Author: {'name': 'Mickey. J Winters', 'email': 'mickey.winters@mongodb.com', 'username': 'mjrb'}Message: (cherry-picked from commit 7f40c171562cb8de1dfae04368ca54e44a193f96) |
| Comment by Mickey Winters [ 20/Sep/22 ] |
|
Because |
| Comment by Githook User [ 16/Sep/22 ] |
|
Author: {'name': 'Mickey. J Winters', 'email': 'mickey.winters@mongodb.com', 'username': 'mjrb'}Message: |