[SERVER-61769] Attempting to run an aggregation with $out or $merge in a transaction on a sharded cluster leaves idle cursors open Created: 29/Nov/21 Updated: 29/Oct/23 Resolved: 25/Feb/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.14, 5.0.7, 5.3.0-rc2, 5.3.0-rc3 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jordi Serra Torrens | Assignee: | Jennifer Peshansky (Inactive) |
| 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: |
v5.3, v5.2, v5.1, v5.0, v4.4, v4.2
|
||||||||||||
| Steps To Reproduce: | server-61769-repro.patch |
||||||||||||
| Sprint: | QE 2021-12-27, QE 2022-01-10, QE 2022-02-07, QE 2022-02-21, QE 2022-03-07, QE 2022-01-24 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
The $out and $merge aggregation pipeline stages are not allowed in transaction. Attempting to do so will fail with OperationNotSupportedInTransaction. On sharded collections, when the client attempts to run $out or $merge in a transaction, it will fail with OperationNotSupportedInTransaction as expected, but it is leaving idle cursors open. Repro test attached. |
| Comments |
| Comment by Githook User [ 01/Mar/22 ] | ||||||||
|
Author: {'name': 'Jennifer Peshansky', 'email': 'jennifer.peshansky@mongodb.com', 'username': 'jenniferpeshansky'}Message: (cherry picked from commit 9b4519e5436a970b90a966cdc16dd8129833a9ae) | ||||||||
| Comment by Githook User [ 01/Mar/22 ] | ||||||||
|
Author: {'name': 'Jennifer Peshansky', 'email': 'jennifer.peshansky@mongodb.com', 'username': 'jenniferpeshansky'}Message: (cherry picked from commit 3952be624b21927373df31df4f0d9dad793abedd) | ||||||||
| Comment by Githook User [ 01/Mar/22 ] | ||||||||
|
Author: {'name': 'Jennifer Peshansky', 'email': 'jennifer.peshansky@mongodb.com', 'username': 'jenniferpeshansky'}Message: (cherry picked from commit 9b4519e5436a970b90a966cdc16dd8129833a9ae) | ||||||||
| Comment by Githook User [ 01/Mar/22 ] | ||||||||
|
Author: {'name': 'Jennifer Peshansky', 'email': 'jennifer.peshansky@mongodb.com', 'username': 'jenniferpeshansky'}Message: (cherry picked from commit 9b4519e5436a970b90a966cdc16dd8129833a9ae) | ||||||||
| Comment by Githook User [ 01/Mar/22 ] | ||||||||
|
Author: {'name': 'Jennifer Peshansky', 'email': 'jennifer.peshansky@mongodb.com', 'username': 'jenniferpeshansky'}Message: (cherry picked from commit 3952be624b21927373df31df4f0d9dad793abedd) | ||||||||
| Comment by Githook User [ 01/Mar/22 ] | ||||||||
|
Author: {'name': 'Jennifer Peshansky', 'email': 'jennifer.peshansky@mongodb.com', 'username': 'jenniferpeshansky'}Message: (cherry picked from commit 3952be624b21927373df31df4f0d9dad793abedd) | ||||||||
| Comment by Githook User [ 25/Feb/22 ] | ||||||||
|
Author: {'name': 'Jennifer Peshansky', 'email': 'jennifer.peshansky@mongodb.com', 'username': 'jenniferpeshansky'}Message: | ||||||||
| Comment by Githook User [ 25/Feb/22 ] | ||||||||
|
Author: {'name': 'Jennifer Peshansky', 'email': 'jennifer.peshansky@mongodb.com', 'username': 'jenniferpeshansky'}Message: | ||||||||
| Comment by Jennifer Peshansky (Inactive) [ 17/Feb/22 ] | ||||||||
|
Looking at the logs, the only difference between the passing and failing case, between when the session starts and when the idle cursors are found or not found, are these two lines in the passing case:
| ||||||||
| Comment by Jennifer Peshansky (Inactive) [ 17/Feb/22 ] | ||||||||
| ||||||||
| Comment by Jennifer Peshansky (Inactive) [ 17/Feb/22 ] | ||||||||
|
Some notes:
So it seems this only repros when the uassert condition it fails is, specifically, !expCtx->inMultiDocumentTransaction. | ||||||||
| Comment by Jordi Serra Torrens [ 30/Nov/21 ] | ||||||||
|
Thanks kyle.suarez. I filed this ticket because it is preventing us to make the concurrency_sharded_*_with_balancer suites actually do some moveChunks again ( | ||||||||
| Comment by Kyle Suarez [ 30/Nov/21 ] | ||||||||
|
jordi.serra-torrens, we're scheduling this fix, but how high is the priority to get this over the line? We have Skunkworks and then the holidays coming up, so this may slip. |