[SERVER-65891] Make all distLock acquisitions local-only Created: 22/Apr/22  Updated: 29/Oct/23  Resolved: 09/Aug/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Task Priority: Major - P3
Reporter: Tommaso Tocci Assignee: Tommaso Tocci
Resolution: Fixed Votes: 0
Labels: Distlock-removal
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-61759 Unsetting the AllowMigrations flag sh... Closed
depends on SERVER-68553 Add local DDL lock acquisition reason Closed
is depended on by SERVER-68551 Remove leftover code after distlocks ... Closed
is depended on by SERVER-68592 Rename DistLockManager to DDLLockManager Closed
is depended on by SERVER-68630 Review serialization mechanisms of cl... Closed
is depended on by SERVER-68708 Stop acquiring dist locks for chunk m... Closed
is depended on by SERVER-69356 Stop locking config db in unittest fi... Closed
Documented
is documented by DOCS-16340 [SERVER] Remove documentation referen... Closed
Gantt Dependency
Problem/Incident
causes SERVER-70167 Resumed create coordinator may incorr... Closed
Related
related to SERVER-78895 Re-enable kill_aggregation.js and kil... Backlog
is related to SERVER-57032 Acquire only local distLock for Shard... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

The goal of this ticket is to convert DistLocks to simpler local-only in-memory locks.

  • Remove all API related to distributed locking from the DistLockManager.
  • Remove ReplicaSetDistLockManager.
  • Remove DistLockCatalog.
  • Delete TypeLocks and TypeLockpings basic type.
  • Drop config.lockpings and config.lock collections when upgrading to FCV version > 6.0.
  • Fix all the affected js/unit tests.

Rationale

DistLocks were used to serialized DDL operations in sharded cluster, in PM-1965 we made that all DDL operations are coordianted by the database primary shard. This means that we don't really need anymore the distributed guarantee of the distlocks since we can simply serialize all the DDL operations for a specific database on a single node.

There was another reson that prevented us to deprecate the distlocks until now. In the past the distlocks were used also to serialize DDL operations with chunk migrations. As of today all DDL operations that needs guarantees around data placement stability use another serialization mechanism based on setting/unsetting allowMigration flag in config.collections that became fully effective after SERVER-61759.

This means that starting from 6.0 the distributed guarantees of the distlocks are not required anymore and that all the associated code can be removed.



 Comments   
Comment by Tommaso Tocci [ 09/Aug/22 ]

Commit: 9f8caddfcefb517993b531d74689b2d98192ef96

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