[SERVER-80438] Refine collection shard key might try to release the critical section of a migration Created: 25/Aug/23  Updated: 29/Oct/23  Resolved: 30/Aug/23

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 7.2.0-rc0, 7.1.0-rc1

Type: Bug Priority: Major - P3
Reporter: Marcos José Grillo Ramirez Assignee: Marcos José Grillo Ramirez
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Assigned Teams:
Sharding EMEA
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.1
Sprint: Sharding EMEA 2023-09-04
Participants:
Linked BF Score: 135

 Description   

SERVER-76486 added a new implementation of refineCollectionShardKey that resumes migrations in the same phase of the release of the critical section. If there is a stepdown while trying to resume migrations, but the operation succeeds, then the balancer might start sending _shardsvrMoveRange commands to shards while the coordinator is retrying the phase, which causes a race for the critical section, if the migration wins this race, then the refineCollectionShardKey will fail because it will try to release a critical section with a different reason.

We should set the allowMigrations flag in a different phase than the release of the critical section.



 Comments   
Comment by Githook User [ 30/Aug/23 ]

Author:

{'name': 'Marcos José Grillo Ramirez', 'email': 'marcos.grillo@mongodb.com', 'username': 'm4nti5'}

Message: SERVER-80438 Move the resume migrations of the new refine collection shard key to its own phase

(cherry picked from commit 7063a3ca32d41a35d35ad5f98d99bfb7bfa6eee4)
Branch: v7.1
https://github.com/mongodb/mongo/commit/dae42999b591f752ac96667e8b67c4fef6a4cb38

Comment by Githook User [ 29/Aug/23 ]

Author:

{'name': 'Marcos José Grillo Ramirez', 'email': 'marcos.grillo@mongodb.com', 'username': 'm4nti5'}

Message: SERVER-80438 Move the resume migrations of the new refine collection shard key to its own phase
Branch: master
https://github.com/mongodb/mongo/commit/7063a3ca32d41a35d35ad5f98d99bfb7bfa6eee4

Generated at Thu Feb 08 06:43:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.