[SERVER-57654] Call Pipeline::dispose() if Pipeline::getNext() throws in ReshardingCollectionCloner Created: 11/Jun/21  Updated: 29/Oct/23  Resolved: 29/Jun/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 5.0.4, 5.1.0-rc0

Type: Task Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Luis Osta (Inactive)
Resolution: Fixed Votes: 0
Labels: PM-234-M3, PM-234-T-data-clone
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-56437 ReshardingDonorOplogIterator destroys... Closed
is related to SERVER-57653 ReshardingDonorOplogIterator must cal... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.0
Sprint: Sharding 2021-07-12
Participants:
Story Points: 1

 Description   

We should add a guard around the call to resharding::data_copy::fillBatchForInsert() to call Pipeline::dispose() if Pipeline::getNext() throws.

auto guard = makeGuard([&] { pipeline->dispose(opCtx); pipeline.reset() });
pipeline->reattachToOperationContext(opCtx);
auto doc = pipeline->getNext();
pipeline->detachFromOperationContext();
guard.dismiss();

Note that this other call to Pipeline::getNext() doesn't an explicit guard to call Pipeline::dispose() because PipelineDeleter::dismissDisposal() hasn't been called yet.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 22/Sep/21 ]

Author:

{'name': 'Luis Osta', 'email': 'luis.osta@mongodb.com', 'username': 'LuisOsta'}

Message: SERVER-57654 Call Pipeline::dispose() if Pipeline::getNext() throws in ReshardingCollectionCloner
Branch: v5.0
https://github.com/mongodb/mongo/commit/26c442fcfc60d2b14d1238bbf11fc6122d057e76

Comment by Githook User [ 29/Jun/21 ]

Author:

{'name': 'Luis Osta', 'email': 'luis.osta@mongodb.com', 'username': 'LuisOsta'}

Message: SERVER-57654 Call Pipeline::dispose() if Pipeline::getNext() throws in ReshardingCollectionCloner
Branch: master
https://github.com/mongodb/mongo/commit/de4fc40201d3a14a0725c9b280ded22f838a0479

Generated at Thu Feb 08 05:42:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.