[SERVER-62332] RefineCollectionShardKeyCoordinator doesn't disallow migrations while it's executing Created: 02/Jan/22  Updated: 29/Oct/23  Resolved: 21/Jan/22

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 5.2.0, 5.1.0
Fix Version/s: 5.3.0

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-61755 Migration recovery should handle refi... Closed
is related to SERVER-62849 Drain recoverable RefineCollectionSha... Closed
is related to SERVER-62850 Delete RefineCollectionShardKeyCoordi... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding EMEA 2022-01-10, Sharding EMEA 2022-01-24
Participants:
Linked BF Score: 5

 Description   

The operation of refining a collection's shard key changes the epoch of a collection and because of this it is not safe to run concurrently with move/split/merge. The current way that this synchronisation is happening is through the dist lock.

Prior to the introduction of the BalancerCommandsScheduler utility, the dist locks held by the balancer (on behalf of moveChunk) were being recovered when the config server was in drain mode. This meant that on step-down/step-up, it wasn't possible that another operation could sneak-in and take the dist lock from underneath chunk migration. However, now this recovery is happening outside of drain mode and because of this we can have refine and moveChunk running concurrently.

Instead of fixing the BalancerCommandsScheduler's recovery, we should move forward in the direction of getting rid of the dist lock and should just make the RefineCollectionShardKeyCoordinator disallow migrations.



 Comments   
Comment by Githook User [ 21/Jan/22 ]

Author:

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

Message: SERVER-62332 Make RefineCollectionShardKeyCoordinator disallow migrations while it's executing
Branch: master
https://github.com/mongodb/mongo/commit/0527f6a2d024a0b0b6ac6706dc82820c405dad9d

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