[SERVER-56654] Do not use the collection distributed lock for chunk splits Created: 05/May/21  Updated: 29/Oct/23  Resolved: 14/Jun/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.2.15, 4.4.7, 4.0.26, 5.0.0-rc2, 5.1.0-rc0

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

Issue Links:
Backports
Depends
depends on SERVER-56779 Do not use the collection distributed... Closed
is depended on by SERVER-57032 Acquire only local distLock for Shard... Closed
Duplicate
is duplicated by SERVER-25359 Create collection-specific ResourceMu... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.0, v4.4, v4.2, v4.0
Sprint: Sharding EMEA 2021-06-14
Participants:

 Description   

Currently, chunk splits, whether manual or initiated by the auto-splitter, acquire the collection distributed lock. This is bad for 2 reasons:

  1. Even if there is a single imbalanced shard, which is performing balancing, the chunk splitter will not be able to acquire the distributed lock and will repeatedly fail
  2. With or without the presence of migrations, the dist lock acquisition still happens after we have performed the splitVector scan in order to determine the split-points, which means that good portion of these scans could end-up being wasted. This point is somewhat mitigated by the fact that the dist lock is taken with the default timeout of 5 seconds, but given that we try with 500 ms back-off there is still some chance that we waste scans on a sufficiently loaded system.

This ticket is to figure out how to remove the dist lock acquisition from splits without causing an impact in the reverse direction. I.e., splits causing the much more expensive moves to start failing, because the chunk being moved got split.

We could achieve this by having the split logic ignore size tracking and/or splitting chunks, which are currently being moved.



 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 [ 24/Jun/21 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-56654 Do not use the collection distributed lock for chunk splits

(cherry picked from commit d8401e342a8d273c1f8b466a93a9d002a8b363cb)
Branch: v4.0
https://github.com/mongodb/mongo/commit/465368486675f6b9a45b50fea17be47b6284df41

Comment by Githook User [ 24/Jun/21 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-56654 Do not use the collection distributed lock for chunk splits

(cherry picked from commit 92a8ceb94681642b438c20351f95c441498a29cf)
(cherry picked from commit 230067d0d9b084b619bda213b6af3b25db8b8aac)
Branch: v4.2
https://github.com/mongodb/mongo/commit/d8401e342a8d273c1f8b466a93a9d002a8b363cb

Comment by Githook User [ 14/Jun/21 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-56654 Do not use the collection distributed lock for chunk splits

(cherry picked from commit 92a8ceb94681642b438c20351f95c441498a29cf)
Branch: v4.4
https://github.com/mongodb/mongo/commit/230067d0d9b084b619bda213b6af3b25db8b8aac

Comment by Githook User [ 14/Jun/21 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-56654 Do not use the collection distributed lock for chunk splits

(cherry picked from commit 92a8ceb94681642b438c20351f95c441498a29cf)
Branch: v5.0
https://github.com/mongodb/mongo/commit/2bd00d62ed0112520620eb8ef7d9f37272231f38

Comment by Githook User [ 14/Jun/21 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-56654 Do not use the collection distributed lock for chunk splits
Branch: master
https://github.com/mongodb/mongo/commit/92a8ceb94681642b438c20351f95c441498a29cf

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