[SERVER-58603] ensureTempReshardingCollectionExistsWithIndexes may hit an invariant if collection was previously dropped Created: 15/Jul/21  Updated: 29/Oct/23  Resolved: 29/Jul/21

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

Type: Bug Priority: Major - P3
Reporter: Haley Connelly Assignee: Randolph Tan
Resolution: Fixed Votes: 0
Labels: PM-234-M3, PM-234-T-lifecycle
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Duplicate
is duplicated by SERVER-58298 Reconcile resharding collection drop ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Sprint: Sharding 2021-08-09
Participants:
Linked BF Score: 26
Story Points: 1

 Description   

A (albeit unlikely) crash could occur in the following scenario



 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 [ 20/Aug/21 ]

Author:

{'name': 'Randolph Tan', 'email': 'randolph@10gen.com', 'username': 'renctan'}

Message: SERVER-58603 ensureTempReshardingCollectionExistsWithIndexes may hit an invariant if collection was previously dropped

(cherry picked from commit 6bf3ad77bb5bcc9c07ef38110e687d3a55ef40f7)
Branch: v5.0
https://github.com/mongodb/mongo/commit/f2233a69550028c0a3dc4b15e040026cdba8bf1e

Comment by Githook User [ 29/Jul/21 ]

Author:

{'name': 'Randolph Tan', 'email': 'randolph@10gen.com', 'username': 'renctan'}

Message: SERVER-58603 ensureTempReshardingCollectionExistsWithIndexes may hit an invariant if collection was previously dropped
Branch: master
https://github.com/mongodb/mongo/commit/6bf3ad77bb5bcc9c07ef38110e687d3a55ef40f7

Comment by Max Hirschhorn [ 21/Jul/21 ]

I think a solution here could be for the RecipientStateMachine to throw an exception in the situation where a namespace with the reshardingUUID already exists and has a namespace string other than the temporary resharding collection. It is fine to drop and reacquire locks around this check because only the thread calling RecipientStateMachine::run() would ever create or drop the temporary resharding collection so there's no real concurrency for these operations.

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