[SERVER-56259] shardCollection legacy should hold the distlocks while writing chunk metadata Created: 22/Apr/21  Updated: 29/Oct/23  Resolved: 23/Apr/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 5.0.0
Fix Version/s: 5.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Jordi Serra Torrens Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 0
Labels: PM-1965-Milestone-1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-55637 Create random_DDL_CRUD_setFCV_operati... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:
Linked BF Score: 25

 Description   

There is a bug where:
1. [th1] shardCollection releases distLocks (which were acquired here) here.
2. [th2] A dropCollection is now able to acquire the distlocks and proceed. Runs until here.
3. [th1] shardCollection writes chunks
4. [th2] dropCollection runs setShardVersion on all shards with requested version UNSHARDED. However, shardCollection has written chunks, so setShardVersion fails here

shardCollection needs to be still holding the distlocks when writing the chunks.



 Comments   
Comment by Githook User [ 23/Apr/21 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-56259: shardCollection legacy should hold the distlocks while writing chunk metadata
Branch: master
https://github.com/mongodb/mongo/commit/703d986d655e972bcc71fcccfe80c0f536c2328c

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