Distributed lock manager: Difference between revisions

Content deleted Content added
WikiCleanerBot (talk | contribs)
m v2.04b - Bot T19 CW#83 - Fix errors for CW project (Heading start with three "=" and later with level two)
Bender the Bot (talk | contribs)
m References: HTTP to HTTPS for SourceForge
 
(10 intermediate revisions by 9 users not shown)
Line 1:
{{refimprovemore citations needed|date=October 2010}}
 
[[Operating system]]s use lock managers to organise and serialise the access to resources. A '''distributed lock manager''' ('''DLM''') runs in every machine in a cluster, with an identical copy of a cluster-wide lock database. [[Operating system]]s use lock managers to organise and serialise the access to resources. In this way a DLM provides [[software application]]s which are [[distributed programming|distributed]] across a cluster on multiple machines with a means to synchronize their accesses to [[shared resource]]s.
 
DLMs have been used as the foundation for several successful [[clustered file system]]s, in which the machines in a [[computer cluster|cluster]] can use each other's storage via a unified [[file system]], with significant advantages for performance and [[high-availability|availability]]. The main performance benefit comes from solving the problem of [[cache coherency|disk cache coherency]] between participating computers. The DLM is used not only for [[file locking]] but also for coordination of all [[disk (storage device)|disk]] access. [[VMScluster]], the first clustering system to come into widespread use, relied on the [[OpenVMS]] DLM in just this way.
Line 7:
== Resources ==
 
The DLM uses a generalized concept of a '''resource''', which is some entity to which shared access must be controlled. This can relate to a file, a record, an area of [[shared memory]], or anything else that the [[application software|application]] designer chooses. A hierarchy of resources may be defined, so that a number of levels of locking can be implemented. For instance, a hypothetical [[database]] might define a resource hierarchy as follows:
* Database
* Table
Line 64:
== Deadlock detection ==
 
When one or more processes have obtained locks on resources, it is possible to produce a situation where each is preventing another from obtaining a lock, and none of them can proceed. This is known as a [[Deadlock (computer science)|deadlock]] ([[E. W. Dijkstra]] originally called it a [[Deadlock (computer science)|deadly embrace]]).<ref>{{cite book|page=105|url=https://books.google.com/books?id=E6wOK8OYBG4C&pg=PA105|title=Ada: Concurrent Programming|isbn=9780929306087|author1last1=Gehani|first1=Narain|year=1991| publisher=Silicon Press }}</ref>
 
A simple example is when Process 1 has obtained an exclusive lock on Resource A, and Process 2 has obtained an exclusive lock on Resource B. If Process 1 then tries to lock Resource B, it will have to wait for Process 2 to release it. But if Process 2 then tries to lock Resource A, both processes will wait forever for each other.
Line 76:
[[OCFS2]], the Oracle Cluster File System was added<ref>[https://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=29552b1462799afbe02af035b243e97579d63350 kernel/git/torvalds/linux.git - Linux kernel source tree]{{Dead link|date=July 2019 |bot=InternetArchiveBot |fix-attempted=yes }}. Kernel.org. Retrieved on 2013-09-18.</ref> to the official [[Linux kernel]] with version 2.6.16, in January 2006. The alpha-quality code warning on OCFS2 was removed in 2.6.19.
 
Red Hat's cluster software, including their DLM and [[GFS2]] was officially added to the Linux kernel <ref>[https://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1c1afa3c053d4ccdf44e5a4e159005cdfd48bfc6 kernel/git/torvalds/linux.git - Linux kernel source tree] {{Webarchive|url=https://archive.istoday/20120718045424/http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1c1afa3c053d4ccdf44e5a4e159005cdfd48bfc6 |date=2012-07-18 }}. Git.kernel.org (2006-12-07). Retrieved on 2013-09-18.</ref> with version 2.6.19, in November 2006.
 
Both systems use a DLM modeled on the venerable VMS DLM.<ref>[https://lwn.net/Articles/137278/ The OCFS2 filesystem]. Lwn.net (2005-05-24). Retrieved on 2013-09-18.</ref> Oracle's DLM has a simpler API. (the core function, <code>dlmlock()</code>, has eight parameters, whereas the VMS <small><code>SYS$ENQ</code></small> service and Red Hat's <code>dlm_lock</code> both have 11.)
Line 85:
 
* [[Google]] has developed ''Chubby'', a lock service for loosely coupled distributed systems.<ref name="chubby">[http://research.google.com/archive/chubby.html Google Research Publication: Chubby Distributed Lock Service]. Research.google.com. Retrieved on 2013-09-18.</ref> It is designed for coarse-grained locking and also provides a limited but reliable distributed file system. Key parts of Google's infrastructure, including [[Google File System]], [[Bigtable]], and [[MapReduce]], use Chubby to synchronize accesses to shared resources. Though Chubby was designed as a lock service, it is now heavily used inside Google as a [[name server]], supplanting [[Domain name system|DNS]].<ref name="chubby" />
* [[Apache ZooKeeper]], which was created at [[Yahoo]], is [[open-source software]] and can be used to perform distributed locks<ref name="zookeeper">[https://zookeeper.apache.org/doc/r3.1.2/recipes.html]. Zookeeper.apache.org. Retrieved on 2013-09-18.</ref> as well.
* [[Etcd]] is open-source software, developed at [[CoreOS]] under the [[Apache License]].<ref name="CoreOS">{{cite web|url=https://coreos.com/|title=CoreOS|website=coreos.com}}</ref> It can be used to perform distributed locks as well.<ref name="etcd">{{Citation|title=etcd: Distributed reliable key-value store for the most critical data of a distributed system|date=2018-01-16|url=https://github.com/coreos/etcd|publisher=CoreOS|accessdate=2016-09-20}}</ref>
* [[Redis]] is an open source, BSDRedis Source Available License licensed, advanced key-value cache and store.<ref name="redis">{{cite web |url=http://redis.io/ Retrieved|title= on|website=redis.io |access-date=2015-04-14}}{{title missing|date=May 2022}}</ref> Redis can be used to implement the Redlock Algorithm for distributed lock management.<ref name="redlock">{{Cite web|url=http://redis.io/topics/distlock|title=Distributed locks with Redis – Redis|website=redis.io|access-date=2015-04-14}}</ref>
* HashiCorp's [[Consul (software)|Consul]],<ref name="consul">[https://consul.io/ Consul Overview]. Retrieved on 2015-02-19.</ref> which was created by [[HashiCorp]], is open-source software and can be used to perform distributed locks as well.
* Taooka distributed lock manager<ref name="taooka">[http://taooka.com/ Taooka Description] {{Webarchive|url=https://web.archive.org/web/20170503112902/http://taooka.com/ |date=2017-05-03 }} Retrieved on 2017-05-04.</ref> uses the "try lock" methods to avoid [[Deadlock (computer science)|deadlock]]s. It can also specify a TTL for each lock with nanosecond precision.
* A DLM is also a key component of more ambitious [[single system image]] (SSI) projects such as [[OpenSSI]].
 
Line 98:
* [https://web.archive.org/web/20101219074254/http://h71000.www7.hp.com/doc/82final/4527/4527pro_044.html#jun_227 HP OpenVMS Systems Services Reference Manual – $ENQ]
* [https://github.com/chadrem/officer Officer - A simple distributed lock manager written in Ruby]
* [httphttps://sourceforge.net/projects/flom/ FLoM - A free open source distributed lock manager that can be used to synchronize shell commands, scripts and custom developed C, C++, Java, PHP and Python software]
{{Refend}}