[SERVER-47422] Use NamespaceSerializer when taking distributed locks for refineCollectionShardKey and migrations Created: 08/Apr/20  Updated: 29/Oct/23  Resolved: 04/May/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.4.0-rc6, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Jack Mulrow Assignee: Matthew Saltz (Inactive)
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-49145 Prevent distributed lock timeouts in ... Closed
is related to SERVER-36322 NamespaceSerializer lock should be us... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Sharding 2020-04-20, Sharding 2020-05-04, Sharding 2020-05-18
Participants:
Linked BF Score: 35

 Description   

Before executing, _configsvrRefineCollectionShardKey takes distributed locks on both a sharded collection's database and full namespace, the latter of which conflicts with the distributed lock a migration takes on a sharded collection namespace. By default, taking a distributed lock times out after 20 seconds and has no fairness policy, so in the presence of many concurrent migrations, a shard key refine can time out waiting for a distributed lock and fail with LockBusy. To handle a similar problem, some config server DDL commands take a NamespaceSerializer lock before taking the distributed lock (e.g. _configsvrDropCollection). We should also be able to use the NamespaceSerializer here to avoid dist lock timeouts.

If these changes are too invasive, we should instead modify the refineCollectionShardKey concurrency jstests ("random_moveChunk_refine_collection_*.js") to retry refines that fail with a LockBusy error.



 Comments   
Comment by Githook User [ 11/May/20 ]

Author:

{'name': 'Matthew Saltz', 'email': 'matthew.saltz@mongodb.com', 'username': 'saltzm'}

Message: SERVER-47422 Allow LockBusy errors in random_moveChunk_refine_collection_shard_key.js

(cherry picked from commit 0350dc8d34a54e44cc600d35da06a0af59736f3b)
Branch: v4.4
https://github.com/mongodb/mongo/commit/ffe1b8f80a00996f10cc098082bfb1a4be0c1e2f

Comment by Githook User [ 01/May/20 ]

Author:

{'name': 'Matthew Saltz', 'email': 'matthew.saltz@mongodb.com', 'username': 'saltzm'}

Message: SERVER-47422 Allow LockBusy errors in random_moveChunk_refine_collection_shard_key.js
Branch: master
https://github.com/mongodb/mongo/commit/0350dc8d34a54e44cc600d35da06a0af59736f3b

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