HK1129751A - Anticipatory changes to resources managed by locks - Google Patents
Anticipatory changes to resources managed by locks Download PDFInfo
- Publication number
- HK1129751A HK1129751A HK09107740.9A HK09107740A HK1129751A HK 1129751 A HK1129751 A HK 1129751A HK 09107740 A HK09107740 A HK 09107740A HK 1129751 A HK1129751 A HK 1129751A
- Authority
- HK
- Hong Kong
- Prior art keywords
- resource
- lock
- change
- request
- permission
- Prior art date
Links
Description
Technical Field
The present invention relates to mechanisms for controlling access to resources within a computer system.
Background
Computers use resources such as memory, modems, and printers during execution of computer programs. Many of these resources are simply used periodically by any given computer program. For example, the amount of time a word processing application requires a printer to print a document is typically less than the amount of time the word processing application is used to create the document. If the process accessing the printer has only one word processing application, the printer will remain idle most of the time.
To fully utilize resources, computer networks have been developed in which processes running on many computer devices or "nodes" can share resources. Thus, a user can purchase a printer that can be connected to a network having many computers without having to purchase a printer for each computer. A process on each computer on the network accesses the printer only when the process requires the printer.
Even though resources may be shared in the manner described above, many resources may not be used by more than one process at any given time. For example, many printers are not capable of printing more than one document at a time. Other resources (e.g., data blocks in a storage medium or tables stored on a storage medium) may be accessed (e.g., read) in some manner by multiple processes at the same time, but accessed (e.g., written to) in other manners by only one process at a time. Accordingly, mechanisms have been developed to control access to resources.
One such mechanism is known as a lock. A lock is a data structure that indicates that a particular process has been granted certain rights to a resource. There are many types of locks. Some types of locks may be shared by many processes, while other types of locks prevent any other lock from being granted the same resource.
For example, ownership of a NULL mode lock to a table does not allow a process to access the table in any way. Ownership of the concurrent read lock allows a process to read a table, but does not guarantee that no other process is writing to the table at the same time. Ownership of the protected read lock allows a process to read a table and ensures that no other processes are writing to the table at the same time. Ownership of the concurrent write lock allows a process to write to a table, but does not guarantee that no other process is also writing to the table. Ownership of the protected write lock allows a process to write to a table and ensures that no other process is also writing to the table. Ownership of the exclusive mode lock allows a process to do anything with the table and ensures that no other process is performing any operation on the table.
Certain lock combinations are not allowed due to the various permissions and guarantees associated with these locks. For example, if one process owns an exclusive mode lock on a resource, the other processes cannot be granted any lock other than a NULL mode lock. If one process owns a protected write lock, then other processes cannot be granted an exclusive mode lock, a protected write lock, a protected read lock, or a concurrent write lock. If one process owns a protected read lock, then the other process cannot be granted an exclusive mode lock, a protected write lock, or a concurrent write lock. If one process owns a simultaneous write lock, then the other process cannot be granted an exclusive mode lock, a protected write lock, or a protected read lock. If one process owns a simultaneous read lock, the other process cannot be granted an exclusive mode lock.
A lock that may be held by more than one process at a time is called a shared lock. For example, two processes may simultaneously hold simultaneous read locks on the same resource, so the simultaneous read locks are shared locks. For purposes of illustration, the following description will refer to exclusive mode locks, shared locks, and NULL mode locks.
Before a process can perform an operation on a resource, the process is required to obtain a lock that gives the process the right to perform the desired operation on the resource. To obtain a lock, a process sends a request for the lock to a lock manager. The lock manager is a process responsible for granting, queuing, and tracking locks to one or more resources. To manage the use of resources in a network system, a lock manager is executed on one or more nodes in the network.
According to one prior art implementation, the lock manager implements two objects: resource objects and locks. A resource object is a data structure corresponding to an actual resource. An application using the lock manager establishes a mapping between actual resources and resource objects. Each resource object has two queues: is assigned a queue (granted queue) and a convert queue. The granted queue is an unordered list of locks that have been granted. The convert queue is a partially ordered table of locks that have been requested but not yet granted. Typically, a request for a lock is actually a convert request, where the process holding the lock requests that the lock it holds be converted from one mode of lock to a different mode of lock.
A lock is a data structure that identifies a process and a lock mode. The lock manager appends a lock to the grant queue of the resource object to indicate that the process identified in the lock has been granted a lock of the type indicated in the lock for the resource corresponding to the resource object to which the lock was appended.
FIG. 1 is a block diagram illustrating a typical lock manager 106. The lock manager 106 is a process configured to manage resource objects 100 stored in memory 108. The resource objects include an attributed queue 102 and a converted queue 104. The lock manager 106 has attached three locks 110, 112, and 114 to the granted queue 102 and one convert request 130 to the convert queue 104.
All locks and convert requests have a process ID portion and a lock mode portion. The process ID portion 116 of lock 110 indicates that a process PROC _1 owns lock 110, and the lock mode portion 118 of lock 110 indicates that lock 110 is an exclusive lock. The process ID portion 120 of the lock 112 indicates that the lock 112 is owned by the process PROC _2, and the lock mode portion 122 of the lock 112 indicates that the lock 112 is a NULL mode lock. The process ID portion 124 of the lock 114 indicates that the lock 114 is owned by the process PROC _3, and the lock mode portion 126 of the lock 114 indicates that the lock 114 is a NULL lock. The process ID portion 132 of convert request 130 indicates that convert request 130 is associated with process PROC _4, and the lock mode portion 136 of convert request 130 indicates that PROC _4 currently holds a NULL mode lock on the resource. In addition to lock mode portion 136, convert request 130 also has requested mode portion 134 indicating that PROC _4 is requesting an exclusive mode lock.
Lock manager 106 has attached locks 110, 112, and 114 to granted queue 102, indicating that PROC _1 currently has exclusive ownership of the resource corresponding to resource object 100. Lock manager 106 has appended translation request 130 to translation queue 104 indicating that PROC _4 has requested, but has not yet been granted, an exclusive mode lock on the resource associated with resource object 100.
Information about any given resource may be stored in a resource object corresponding to the resource. Each resource object is stored in the memory of a single node. The node on which the resource object is stored is referred to as the management node for the resource object.
According to one lock management approach, a process first establishes a NULL mode lock on all resources that the process will likely use. Then, when a process actually needs to access a resource, the process requests that its NULL mode lock be converted to a lock that gives the process the right to perform the desired operation.
For example, to delete a table, a process must get an exclusive mode lock on the resource object corresponding to the table. To get an exclusive mode lock, a process sends a message to the lock manager that controls the resource object corresponding to the table. In this message, the process requests that its current NULL mode lock be converted to an exclusive mode lock. If no other process requests a translation, and if no currently granted lock would prevent the granting of an exclusive mode lock, then the current lock held by the requesting process is translated to an exclusive mode lock. Once the lock manager has performed the requested translation, the lock manager sends a message to the requesting process indicating that the requested translation operation has been performed.
If a process needs access to read data from a table, the process must get a shared lock. To obtain the shared lock, the process requests the lock manager that controls the resource object corresponding to the table to convert its current lock to a shared lock. If no other process requests a translation, and if no currently granted lock prevents the granting of the shared lock, then the current lock held by the requesting process is translated to a shared lock.
If the exclusive mode lock has been granted to the table, then the shared lock cannot be granted. In these cases, the lock translation request is placed in the translation queue of the resource object. When a blocking process is ready to release its exclusive lock, the blocking process may send a lock downgrade request to the lock manager. The lock manager responds by converting the exclusive mode lock to an assigned secondary lock (lesserlock) that allows the shared lock. The shared lock is then granted by moving the shared lock request from the requested queue to the granted queue and sending a message to the requesting process to notify the requesting process that the shared lock has been granted.
The convert queue of a resource object is a partially ordered table that holds all pending (unassigned) lock requests. If none of the pending lock requests are granted, one of the lock requests that is not granted will be at the "head" of the convert queue. Even if the lock currently granted does not prevent the lock manager from granting a particular lock request, the lock request is placed on the translate queue if the translate queue is not empty. This strategy prevents "livelock", i.e., one process cannot be done in the system, while other processes can.
It is common for many processes to hold shared locks on resources at the same time. The set of processes that hold a shared lock on a particular resource is collectively referred to herein as a "shared lock holder".
If one of the share lock holders ("requester") wants to convert to an exclusive mode lock, the requester must first send a conversion request to the resource's management node. When a share-to-exclusive request reaches the head of the convert queue in the resource's management node, the management node sends a convert-down request message to all share lock holders, asking them to convert down or close their locks. The master node can grant an exclusive lock to a requester only after all share lock holders acknowledge to the master node that they have downconverted their locks. Between the time the requester sends the upgrade request and the time the exclusive lock is granted, the requester has to wait and cannot begin updating the resource or performing any subsequent work even if the requester already has a current copy of the resource in its cache.
The approaches described in this section are approaches that could be pursued, not necessarily approaches that have been previously conceived or pursued. Accordingly, any method described in this section should not be taken as prior art merely because such methods are included in this section, unless otherwise specified.
Drawings
The present invention is illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings. In the drawings, like numbering represents like elements, and wherein:
FIG. 1 is a block diagram of a lock manager and object resources for managing locks on the resources;
FIG. 2 is a flowchart illustrating the steps performed by a process that wants to modify a resource, according to an embodiment of the invention;
FIG. 3 is a flowchart illustrating steps performed by a lock manager according to an embodiment of the present invention; and
FIG. 4 is a block diagram of a computer system upon which embodiments of the present invention may be implemented.
Detailed Description
In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention. However, it is understood that the invention may be practiced without these specific details. In other instances, well-known structures and devices are shown in block diagram form in order to avoid unnecessarily obscuring the present invention.
Overview
Techniques for reducing the delay between the time a process requests permission to modify a resource and the time the process is allowed to begin modifying the resource are described below. For illustrative purposes, an example will be given in which the resource is a disk block, where a copy of the disk block is stored in a cache. However, this is just one example of a resource to which these techniques may be applied. The techniques of this disclosure are not limited to any particular type of resource.
When a process holds a shared lock on a disk block, the current copy of the disk block typically already exists in the cache of the node in which the process is executing. The techniques described below allow processes that want to modify resources ("requesters") to update their private resource backups without waiting for the administrator of the resource to allow them to modify the resource. Thus, the delay between the time the requestor requests an update of the resource and the time the resource is updated is reduced.
Shared to exclusive upgrade
For purposes of illustration, assume that a requester holds a shared lock on a resource and wants an exclusive lock on the resource. Techniques are provided for: this technique allows a shared-to-exclusive requester to begin modifying the current copy of the private block (that the requester already owns) even before the requester is granted an exclusive lock.
According to one embodiment, whenever a share-to-exclusive request for a resource occurs, the administrator of the resource treats the request differently than other types of translation requests. Specifically, upon receiving such a request, the administrator determines whether the request can be granted immediately. If the request cannot be granted immediately, the master determines (1) whether there is only a share lock holder on the grant queue (no exclusive holder) and (2) whether there is an exclusive request pending on the translation queue, rather than simply placing the request on the translation queue.
If there is only a share lock holder on the grant queue and there are no pending exclusive requests on the convert queue, the master places the convert request at the head of the convert queue and sends a "proceed" message to the requestor. The master also issues a down-conversion request message to all current share lock holders.
Significantly, the proceed message is sent even if one or more currently granted locks are incompatible with the requested permissions, thus preventing permissions from being granted currently. Thus, the proceed message indicates that the requested permission may be granted, but that the requested permission has not yet been granted.
When the requester receives the proceed message, the requester may begin updating the blocks in the private memory. (1) Changes made to the block after the proceed message and (2) before the requested permission is granted are referred to herein as "anticipatory change". Only processes that have made anticipatory changes are allowed access to the backup that includes the anticipatory changed resource. A redo record may be generated for the anticipatory change, but neither the changed tile nor the redo record may be committed ("become permanent") while the change is still an anticipatory change.
When all share lock holders downconvert their locks and send an acknowledge message to the master, the master sends a lock grant message to the requester granting the requester an exclusive lock. Once the requester receives the lock grant message, the change is no longer an "anticipatory change," but instead becomes a "permitted change. Once a change becomes permitted, the change may be committed.
Affairs
In some systems, such as database systems, a series of operations may be performed as one "transaction". Changes made by a transaction must be committed in atomic units. Thus, changes made by a transaction cannot be committed as long as the transaction has any pending anticipatory changes.
According to one embodiment, anticipatory changes made by a transaction are tracked. A wide variety of mechanisms may be used to track anticipatory changes to transactions. The present invention is not limited to any particular type of tracking mechanism. Information used to track anticipatory changes will be referred to herein collectively as "tracking information".
When a transaction receives permission to modify a particular resource, the tracking information is updated to indicate that any anticipatory changes made by the transaction to the particular resource have been permitted. As long as the tracking information indicates that any anticipatory changes made by the transaction have not been permitted, the transaction is not allowed to commit (even though all operations of the transaction may have been successfully completed by other means).
Once all the anticipatory changes have become permitted changes, the transaction may commit. When a transaction commits, a commit time (typically in the form of a system commit number) is assigned to the transaction. The lead time is added to the redo record generated for the transaction as needed. Redo records are then linked to a checkpoint queue to be written in groups (flush) to disk to make the changes permanent. After a change becomes permanent, the change may be accessed by other processes or instances (instances).
Modifying a request
In the previous section, a scenario is described in which a requester upgrades from a shared lock to an exclusive lock. However, the techniques described herein may be applied in any scenario involving a request to modify a resource managed with a lock. Thus, the technique may be applied equally as well, for example, when the request is for an upgrade to a "write while simultaneously" lock or a "protected write" lock. A request for permission to modify a resource is referred to herein as a "modification request".
Requester action
FIG. 2 is a flow diagram illustrating steps performed by a transaction that wants to modify a resource in a system that supports anticipatory changes according to one embodiment of the invention. Specifically, in step 202, a requestor that wants to modify a resource sends a modification request to a lock manager that controls the resource. In a system that supports anticipatory changes, the requester may receive a proceed message. If a proceed message is not received, control passes from step 204 to step 208, where the requester will eventually receive a lock grant message. After the requester receives the lock grant message, the requester may modify the resource (step 210).
If the requester receives a proceed message, control passes from step 204 to step 206. In step 206, the requestor makes an anticipatory change by modifying a private backup of the resource without having been given permission to make the modification. If the requestor is a transaction, the requestor also updates the tracking information to reflect the anticipatory changes. Significantly, after making the anticipatory changes, the requestor can proceed with other work. The other work may include making additional anticipatory changes. Thus, the tracking information for a given transaction may indicate any amount of pending not yet permitted changes.
The fact that the requestor can continue to do other work before receiving permission to make the anticipatory change can lead to significant performance benefits. The longer the delay between requesting a grant and receiving a grant, the greater the benefit of being able to proceed without waiting for a grant. Thus, anticipatory changes are particularly useful in systems that include many nodes that typically share access to the same resources. Without the ability to make anticipatory changes, a process that wants to modify a shared resource must wait for all other nodes to do the down-conversion. The larger the number of nodes, the more likely it is to wait for a long time.
Changes are not "made permanent" until an anticipatory change is permitted. The actual process of making a change permanent may vary from system to system. For example, in some systems, changes are made permanent by writing "redo records" identifying the changes to disk in groups. Some systems may make changes permanent by writing a copy of the changed blocks to disk in groups. Other systems may have other mechanisms for making changes permanent. The techniques described herein are not limited to any particular mechanism for making changes permanent.
In step 212, the requestor receives permission to modify the resource. As noted above, the receipt of the permission is asynchronous with respect to any other work the requestor is performing, with the only exception that the receipt of the permission must occur before the change is made permanent.
If the requestor is a transaction, the requestor updates the tracking information to reflect that the anticipatory changes have been permitted. If there are no pending anticipatory changes and the requestor has been successfully completed by other means (step 214), the changes made by the requestor are made permanent and visible to other processes (step 216). If the requestor is a transaction, and not all operations were successful and permitted, then the transaction is rolled back (step 218).
Lock manager operations
FIG. 3 is a flowchart showing steps performed by a lock manager in a system supporting anticipatory requests. At step 302, an administrator of a resource receives a modification request from a requestor. At steps 304 and 306, the administrator determines whether there are any modification requests that have been granted (step 304) and whether there are any pending modification requests (step 306).
In embodiments that use resource objects to track locks, the administrator may perform step 304 by examining the granted queues of lock objects to determine if there are locks on the granted queues that grant modification privileges. Similarly, the administrator may perform step 306 by checking the convert queue of the lock object to determine if there is a request for permission to modify the resource among the convert requests on the convert queue.
If there are any pending or granted modification requests, control passes to step 320, where the modification requests are placed on the translation queue. However, if there are no pending and granted modification requests, control proceeds to step 308 where the master sends a proceed message to the requester, places the modification request at the head of the convert queue, and sends a convert-down request to all incompatible lock holders.
When the master finally receives the down-conversion acknowledgements from all incompatible lock holders, the master sends a lock grant message to the requester and moves the modification request from the head of the request queue onto the granted queue.
Modification requests for requestors not currently holding a shared lock
In the example given above, the modification request comes from a requestor that already holds a shared lock on a resource. Because the requestor already holds the shared lock, the requestor will typically already have a copy of the current version of the resource. However, the anticipatory modification techniques described herein may also be applied in situations where the modification request is from a requester that does not currently hold a shared lock.
According to one embodiment, when the requester is not currently holding a shared lock, the administrator causes a current copy of the block to be sent to the requester. Once the requester receives a backup of the block, the requester may begin making anticipatory changes to the block.
In one embodiment, if the administrator has a current copy of the block, the administrator sends the current copy of the block to the requestor itself. In this case, the manager may use the same message to both send the block and transmit a "proceed" message.
If the master does not have a current copy of the block, the master may send a message to one of the share lock holders to cause the share lock holder to send the current copy of the block to the requester. In this case, the administrator may send a "proceed message" to the requester separately. Alternatively, the master may simply instruct the share lock holder to send a "proceed" message to the requester with the current copy of the block.
In the example given above, the lock granted to prevent the administrator from granting the modification request is a shared lock. However, there is a possibility that: because there is an exclusive lock currently granted, the modification request cannot be granted. In the event that the currently granted exclusive lock prevents the modification request from being granted, the requester may begin making anticipatory changes to the "proxy" buffer. In one embodiment, if a past image of the tile is available, the requestor uses the "past image" of the tile as a proxy buffer. The past image of the block is a copy of the block that reflects the past state of the block. Thus, the current copy of the block may contain some changes that were not in the past image. When the current version of the resource arrives, the requestor may merge the changes in the proxy buffer into the current version of the resource.
In this case, the requester would typically receive the current version of the resource from the owner of the exclusive lock. Along with the current version, the owner of the exclusive lock may include a lock grant message granting the requestor permission to make changes to the resource. Thus, changes are permitted while the requestor is able to merge the changes into the current version of the block.
According to one embodiment, redo is generated for anticipatory changes made to the proxy buffer prior to receiving the current version of the block. Once the current version of the block arrives, redo may be applied to the current version of the block in a manner similar to the "roll-forward" phase of the restore operation. Applying redo to the current version of the block causes the block to reflect the changes identified in the redo.
In some cases, whether a change can be made to a block may depend on what the current value in the block is. For example, assume a block contains data for multiple rows in a table. Assume that a single value constraint has been set for one of the columns in the table. Whether a particular row can be inserted into the table (by modifying the block) may depend on whether the insertion violates a single value constraint. Thus, according to one embodiment, constraint checking is performed based on the current state of the block prior to merging the anticipatory changes into the current version of the block.
Overview of hardware
FIG. 4 is a block diagram that illustrates a computer system 400 upon which an embodiment of the invention may be implemented. Computer system 400 includes a bus 402 or other communication mechanism for communicating information, and a processor 404 coupled with bus 402 for processing information. Computer system 400 also includes a main memory 406, such as a Random Access Memory (RAM) or other dynamic storage device, coupled to bus 402 for storing information and instructions to be executed by processor 404. Main memory 406 also may be used for storing temporary variables or other intermediate information during execution of instructions to be executed by processor 404. Computer system 400 also includes a Read Only Memory (ROM)408 or other static storage device coupled to bus 402 for storing static information and instructions for processor 404. A storage device 410, such as a magnetic disk or optical disk, is provided and coupled to bus 402 for storing information and instructions.
Computer system 400 may be coupled via bus 402 to a display 412, such as a Cathode Ray Tube (CRT), for displaying information to a computer user. An input device 414, including alphanumeric and other keys, is coupled to bus 402 for communicating information and command selections to processor 404. Another type of user input device is cursor control 416, such as a mouse, a trackball, or cursor direction keys for communicating direction information and command selections to processor 404 and for controlling cursor movement on display 412. The input device typically has two degrees of freedom in two axes, a first axis (e.g., the x-axis) and a second axis (e.g., the y-axis), allowing the device to specify positions in a plane.
The invention is related to the use of computer system 400 for implementing the techniques described herein. According to one embodiment of the invention, those techniques are performed by computer system 400 in response to processor 404 executing one or more sequences of one or more instructions contained in main memory 406. Such instructions may be read into main memory 406 from another machine-readable medium, such as storage device 410. Execution of the sequences of instructions contained in main memory 406 causes processor 404 to perform the process steps described herein. In alternative embodiments, hard-wired circuitry may be used in place of or in combination with software instructions to implement the invention. Thus, embodiments of the invention are not limited to any specific combination of hardware circuitry and software.
The term "machine-readable medium" as used herein refers to any medium that participates in providing data that causes a machine to operation in a specific fashion. In an embodiment implemented using computer system 400, various machine-readable media are used to provide instructions to processor 404 for execution, for example. Such a medium may take many forms, including but not limited to, non-volatile media, and transmission media. Non-volatile media includes, for example, optical or magnetic disks, such as storage device 410. Volatile media includes dynamic memory, such as main memory 406. Transmission media includes coaxial cables, copper wire and fiber optics, including the wires that comprise bus 402. Transmission media can also take the form of acoustic or light waves, such as those generated during radio-wave and infra-red data communications.
Common forms of machine-readable media include, for example, a floppy disk, a flexible disk, hard disk, magnetic tape, or any other magnetic medium, a CD-ROM, any other optical medium, punch cards, paper tape, any other physical medium with patterns of holes, a RAM, a PROM, and EPROM, a FLASH-EPROM, any other memory chip or cartridge, a carrier wave as described hereinafter, or any other medium from which a computer can read.
Various forms of machine-readable media may be involved in carrying one or more sequences of one or more instructions to processor 404 for execution. For example, the instructions may initially be carried on a magnetic disk of a remote computer. The remote computer can load the instructions into its dynamic memory and send the instructions over a telephone line using a modem. A modem local to computer system 400 can receive the data on the telephone line and use an infra-red transmitter to convert the data to an infra-red signal. An infra-red detector can receive the data carried in the infra-red signal and appropriate circuitry can place the data on bus 402. Bus 402 carries the data to main memory 406, and processor 404 retrieves the instructions from main memory 406 and executes the instructions. The instructions received by main memory 406 may optionally be stored on storage device 410 either before or after execution by processor 404.
Computer system 400 also includes a communication interface 418 coupled to bus 402. Communication interface 418 provides a two-way data communication coupling to a network link 420 that is connected to a local network 422. For example, communication interface 418 may be an Integrated Services Digital Network (ISDN) card or a modem to provide a data communication connection to a corresponding type of telephone line. As another example, communication interface 418 may be a Local Area Network (LAN) card to provide a data communication connection to a compatible LAN. Wireless links may also be implemented. In any such implementation, communication interface 418 sends and receives electrical, electromagnetic or optical signals that carry digital data streams representing various types of information.
Network link 420 typically provides data communication through one or more networks to other data devices. For example, network link 420 may provide a connection through local network 422 to a host computer 424 or to data equipment operated by an Internet Service Provider (ISP) 426. ISP426 in turn provides data communication services through the worldwide packet data communication network now commonly referred to as the "internet" 428. Local network 422 and internet 428 both use electrical, electromagnetic or optical signals that carry digital data streams. The signals through the various networks and the signals on network link 420 and through communication interface 418, which carry the digital data to and from computer system 400, are exemplary forms of carrier waves transporting the information.
Computer system 400 can send messages and receive data, including program code, through the network(s), network link 420 and communication interface 418. In the internet example, a server 430 might transmit a requested code for an application program through internet 428, ISP426, local network 422 and communication interface 418.
The received code may be executed by processor 404 as it is received, and/or stored in storage device 410, or other non-volatile storage for later execution. In this manner, computer system 400 may obtain application code in the form of a carrier wave.
In the foregoing specification, embodiments of the invention have been described with reference to numerous specific details that may vary from implementation to implementation. Thus, the sole and exclusive indicator of what is the invention, and is intended by the applicants to be the invention, is the set of claims that issue from this application, in the specific form in which such claims issue, including any subsequent correction. Any definitions expressly set forth herein for terms contained in such claims shall govern the meaning of such terms as used in the claims. Hence, no limitation, element, property, feature, advantage or attribute that is not expressly recited in a claim should limit the scope of such claim in any way. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.
Claims (19)
1. A machine-implemented method, comprising:
sending a request for permission to perform a change involving a particular resource;
performing the change while preventing the change from being a permanent change prior to receiving the permission;
after performing the change, receiving permission to perform the change; and
stopping blocking the change to a permanent change after receiving permission to execute the change.
2. The method of claim 1, wherein the change is performed as part of a transaction, and the step of performing the change while preventing the change from being a permanent change comprises:
performing the change to a private backup of the particular resource; and
blocking the transaction commit.
3. The method of claim 2, wherein the method further comprises:
maintaining tracking information indicating whether the transaction has made any changes that have not been permitted; and
blocking the transaction commit as long as the tracking information indicates that the transaction has made any changes that have not been permitted.
4. The method of claim 1, wherein:
a request for permission to perform the change is sent from a requestor to a manager of the resource; and is
The method further comprises the following steps:
the administrator determining whether (a) a currently granted lock for the resource grants permission to modify the resource, and (b) a pending lock request is a request for permission to modify the resource; and
in response to determining that no currently granted lock for the resource has been granted permission to modify the resource and that no pending lock request is a request for permission to modify the resource, the master sends a proceed message to the requestor;
the requestor performs the change in response to receiving the proceed message.
5. The method of claim 4, wherein the method further comprises:
in response to determining that no currently granted lock for the resource has been granted permission to modify the resource and that no pending lock request is a request for permission to modify the resource, the master places a request for permission to modify at the head of a pending lock request queue for the resource.
6. The method of claim 1, wherein:
a request for permission to perform the change is sent from a requestor to a manager of the resource;
while the requester sends the request, the requester holds a shared lock on the resource and has a private backup of the current version of the resource; and is
The step of performing the change includes performing a change to a private backup of a current version of the resource.
7. The method of claim 1, wherein:
a request for permission to perform the change is sent from a requestor to a manager of the resource;
while the requestor sends the request, another process holds an exclusive lock on the resource; and is
The step of performing the change comprises:
performing the change on a proxy buffer; and is
When the requestor receives a backup of the current version of the resource, the changes from the proxy buffer are merged into the backup of the current version of the resource.
8. The method of claim 7, wherein the method further comprises generating redo in response to performing the change on the proxy buffer.
9. The method of claim 7, wherein:
performing the change on the proxy buffer without checking whether a constraint is violated; and is
The changes are merged into the current version of the backup only after checking if constraints are violated.
10. The method of claim 1, wherein:
a request for permission to perform the change is sent from a requestor to a manager of the resource;
while the requestor sends the request, the requestor does not hold a shared lock on the resource, but a set of one or more other processes hold a shared lock on the resource; and is
The method also includes causing a process of the set of processes to send a current backup of the resource to the requestor.
11. The method of claim 10, wherein:
the requestor performs the change in response to receiving a proceed message; and is
The method also includes causing the processes in the set of processes to include the proceed message with the current backup of the resource.
12. The method of claim 10, wherein:
the requestor performs the change in response to receiving a proceed message; and is
The method also includes causing the administrator of the resource to send the proceed message to a requestor.
13. A machine-implemented method, comprising:
receiving, at a manager of a resource, a request from a requestor, wherein the request is for a request to modify a permission of the resource;
while one or more currently granted locks prevent the administrator from granting the requestor permission to modify the resource, the administrator causes the requestor to receive a proceed message that allows the user to make an earlier change to the resource but prevents the change from being a permanent change;
when no currently granted lock prevents the master from granting the requester permission to modify the resource, the master sends a lock grant message to the requester that allows the requester to make the change permanent.
14. The method of claim 13, wherein the method further comprises causing the administrator to place the request at the head of a request queue ahead of other previously received lock requests for the resource.
15. The method of claim 13, wherein the method further comprises:
after receiving the request, the administrator determines whether any granted or requested locks are locks granting permission to modify the resource; and
in response to determining that the lock that is not granted or requested is a lock that grants permission to modify the resource, the master causes the requester to receive a proceed message.
16. The method of claim 13, wherein:
the requester holds a shared lock on the resource; and is
The administrator causes the requester to receive the proceed message by sending the proceed message to the requester.
17. The method of claim 13, wherein:
the requester does not hold a shared lock on the resource; and is
The administrator causes the requester to receive a proceed message by causing a process that does not hold a shared lock on the resource to send the requester (a) a current backup of the resource for the requester and (b) the proceed message.
18. A computer-readable medium storing instructions that, when executed, cause one or more processors to perform the method of any one of claims 1-17.
19. A computer system comprising one or more processors and memory containing instructions that, when executed by the one or more processors, cause the computer system to perform the method of any of claims 1-17.
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US11/351,675 | 2006-02-10 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| HK1129751A true HK1129751A (en) | 2009-12-18 |
Family
ID=
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| AU2007215295B2 (en) | Anticipatory changes to resources managed by locks | |
| US7600063B2 (en) | Techniques for improved read-write concurrency | |
| US6412034B1 (en) | Transaction-based locking approach | |
| US6708198B1 (en) | Efficiently initiating lock state transitions for distributed resource objects that participate in a distributed lock management system | |
| AU2007212685B2 (en) | Adaptive region locking | |
| US6965893B1 (en) | Techniques for granting shared locks more efficiently | |
| US6539446B1 (en) | Resource locking approach | |
| US8510334B2 (en) | Lock manager on disk | |
| US7912821B2 (en) | Apparatus and method for data management | |
| US20210382636A1 (en) | Customizable lock management for distributed resources | |
| US20030145210A1 (en) | Method, system, program, and data structure for implementing a locking mechanism for a shared resource | |
| US20010037343A1 (en) | Transferring a resource between caches of different nodes | |
| US6704767B1 (en) | Using distributed information about lock conversion requests to efficiently manage lock state transitions | |
| CN115951844B (en) | File lock management method, equipment and medium of distributed file system | |
| EP1366420B1 (en) | Disk writes in a distributed shared disk system | |
| CN101523352A (en) | Persistent locks/resources for concurrency control | |
| US10459810B2 (en) | Technique for higher availability in a multi-node system using replicated lock information to determine a set of data blocks for recovery | |
| HK1129751A (en) | Anticipatory changes to resources managed by locks | |
| JP2008544371A (en) | How to handle lock-related inconsistencies | |
| EP1162539B1 (en) | Recovering data from one or more failed caches | |
| EP1408408B1 (en) | Managing a resource used by a plurality of nodes | |
| HK1137535A (en) | Persistent locks/resources for concurrency control |