Recherche Images Maps Play YouTube Actualités Gmail Drive Plus »
Recherche avancée dans les brevets | Images de page | Historique Web | Connexion

Brevets

  
[graphic][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][graphic]
[merged small][merged small][merged small][table][merged small][merged small][merged small][table][merged small][merged small][merged small][graphic][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][graphic][merged small]

FAST INTERSYSTEM PAGE TRANSFER IN A DATA SHARING ENVIRONMENT WITH RECORD LOCKING

5

This is a file wrapper continuation of application Ser. No. 07/656,567, filed Feb. 15, 1991, now abandoned.

CROSS-REFERENCE TO RELATED

APPLICATIONS 10

The following co-pending U.S. Patent Applications are commonly assigned with and contain material which is relevant to the material in this application:

U.S. patent application Ser. No. 07/715,505, filed Jun. 14, 1991, for "METHOD FOR NON- 15 HIERARCHICAL LOCK MANAGEMENT IN A MULTI-SYSTEM SHARED DATA ENVIRONMENT"; and

U.S. patent application Ser. No. 07/059,666, filed Jun. 8, 1987, for "METHOD FOR MANAGING 20 SUBPAGE CONCURRENCY CONTROL IN PARTIAL TRANSACTION ROLLBACK IN A TRANSACTION-ORIENTED SYSTEM OF WRITEAHEAD LOGGING TYPE".

BACKGROUND OF THE INVENTION 25

This invention relates to the control of access to, and maintenance of, the integrity of data resources in a data sharing environment in which multiple instances of a database management system have access to one or 30 more permanent data storage resources. Attendant with the provision of common access is the need to make the access fast while maintaining integrity of accessed data.

A suggested approach to improving capacity and availability in a single-system database management 35 system (DBMS) is the use of multiple systems. A principal architecture in use in the multi-system environment is called "data sharing" and involves the sharing of access to non-volatile data storage resources such as disks. The architecture is also referred to as the "shared 40 disks" (SD) environment. In the SD environment, all disks containing the database are shared among the different CECs. Every CEC that has an instance of the DBMS executing on it may access and modify any portion of the database on the shared disks. In this archi- 45 tecture, a global locking facility is required for concurrency control of data units by different DBMS instances. In this architecture, each CEC maintains its own buffer for temporary data storage. In order to maintain coherency of data units which have been buff- 50 ered, a global locking facility and protocol may be provided. A representative shared disks architecture is the IMS/VS Data Sharing product available from the assignee of this application.

Typically, in the shared disks environment, data units 55 are obtained and transferred in the form of "pages". Initially, an executing transaction requests data (usually, a "record") from the DBMS in its CEC. The DBMS obtains the page containing the record, places it in its buffer, and notifies the transaction of the availability 60 and location of the page.

The page may be obtained by the DBMS either from a disk (in the form of a direct access storage device, DASD), or from another instance of the DBMS which has previously buffered the page. 65

Whether a record can be immediately obtained depends upon whether the record is currently being accessed by another transaction. For example, if the re

cord has been obtained by another transaction for the purpose of changing data in it, any subsequent requests for access must be synchronized with the updating process in order to ensure that the most current version of the data is available. Synchronization of access to a piece of data is effected by granting a "lock" to a transaction currently updating that data, which prevents all other transactions from gaining access to that data.

In fact, a lock may not necessarily bar access to a page. If the lock is a shared (S) lock, more than one transaction may have access to the page. If the lock is exclusive (X), only the transaction possessing the lock may have access to the page.

Shared locks permit multiple, concurrent access to a page, and an S lock will be granted in the face of another S lock on the same page. If an X lock is requested on a page which is S-locked, the requesting transaction is suspended until the S lock is surrendered.

In transaction processing, when a transaction possesses a lock on a unit of data for the purpose of updating the unit, the lock is not surrendered until the update is either "committed" or "rolled back". In this regard, when the transaction attempts to update a page, the updates will be committed when the transaction reaches a particular stage (the "synch point"), or all the attempted updates will be undone. The purpose of this procedure is to maintain consistency of the page when a system abnormality occurs during an update process which may affect the integrity of the process. If the update process is completed with no indication of terminating conditions, the update is "committed"; if abnormal conditions are indicated, the update is "rolled back".

When a transaction has completed an update process and the updates are committed, the transaction may release its lock on the updated unit of data, signaling to other requestors that the unit is available, and guaranteeing the integrity of the data in the unit.

The reversibility of an update process is supported by a "log" which a DBMS maintains in a reliable storage resource such as a disk. The log is a chronological, or time-based, history of transaction updating activity which identifies the transaction, the unit of data being updated, the condition of the unit before updating, the condition of the unit after updating, and the time of the updating process. The roll back operation (also called "recovery") uses log entries to restore a unit of data to its form before a failed update operation began.

The subjects of transaction integrity, recovery, concurrency, and locking are covered in detail in Chapter 18 of C. J. Date's book entitled "AN INTRODUCTION TO DATABASE SYSTEMS", Addison-Wesley, 1986.

Locking and transaction processing are designed to meet the problems of multiple access, coherency, and recovery in a database system. A need exists to extend these techniques in a multi-system, data sharing environment so that fast access is afforded to units of data when requested without sacrificing the integrity of the data. Data integrity could be threatened when, for example, one instance of a DBMS in one CEC is updating a page to which another instance of the DBMS in another CEC is requesting access. With a proliferation of DBMS instances in different CECs, the challenge is to provide the fastest access to units of data which may be either buffered or stored on disk, while maintaining the integrity of those units of data.

3 4

-.......^v TUC ... forwarding the updated data unit from the first

SUMMARY OF THE INVENTION DBMS tQ the sgcond DBMS and providing the version

It is, therefore, an object of the invention to provide number of the updated data unit from the first DBMS to

an improved method and structure for providing fast the global lock manager;

access to data resources by multiple users on multiple 5 forwarding the version number received from the

instances of a DBMS while ensuring coherency of the first DBMS by the global lock manager to the second

data resources. DBMS;

A further object of this invention is to provide a if the version number provided to the second DBMS locking procedure which supports inter-DBMS transfer is greater than the version number in the updated data of units of data without storage to disk. 10 unit received by the second DBMS or if the updated A still further object of this invention is to avoid disk data unit has not been received at the second DBMS I/O in a multiple user, data-sharing environment by when the version number arrives, writing the updated transferring a modified unit of data from the buffer of data unit to a disk from the first DBMS, providing the one DBMS to another DBMS which needs it. data unit to the second DBMS from the disk and readIt is a further object of this invention to permit up- 15 ing the record; otherwise, dates to a unit of data to be made by several systems reading the record from the updated data unit transbefore the unit is written back to disk. ferred to the second DBMS from the first DBMS.

According to the invention, a multiple user, data- In the event that the second DBMS wants to update

sharing arrangement permits a plurality of instances of a the record, the global lock manager forwards a request

DBMS which may be executing on one or more central 20 to the first DBMS to transfer the data unit. The first

electronic complexes to gain access to data stored in DBMS transfers the data unit to the second DBMS,

one or more disks available to all instances of the while providing the version number for the updated

DBMS. In this arrangement, lock management is pro- data unit to the global lock manager and writing the

vided by a global locking system which manages locks updated data unit to a disk. The first DBMS then re

on units of data and data records for all instances of the 25 leases its P lock and the global lock manager provides

DBMS. Fast access to units of data requested by trans- the version number to the DBMS. If the second DBMS

actions executing on different DBMS instances is pro- has received the updated data unit by the time it re

vided by inter-DBMS transfer of requested data units ceives the version number, it accepts the updated data

without disk I/O and with the guarantee of the integrity unit if the version number matches the version number

of the transferred data unit by the method of: 30 in the updated data unit. Otherwise, the updated data

maintaining a global lock table at a global lock man- unit is provided to the second DBMS from the disk,

ager, the global lock table including one or more The second DBMS then updates the record in the up

entries, each entry corresponding to a lock granted to a dated data unit. DBMS;

issuing a P lock for updating a data unit to a first 35

DBMS; FIG. 1 is a block diagrammatic representation of a

entering an entry for the P lock in the global lock typical computing system environment for operation of

table; the invention.

providing the data unit from a disk to a buffer of the FIG. 2 is a block diagrammatic representation showfirst DBMS; 40 ing, in greater detail, functional elements and data struc

generating an updated data unit in the buffer by up- tures necessary for practice of the invention,

dating the data unit at the first DBMS; FIGS 3A', 3A", 3B and 3C form a flow diagram

in response to updating the data unit: representing detection in one DBMS instance of an

generating a version number for the updated data unit updated data unit in another DBMS instance and trans

at the first DBMS, the version number being a mono- 45 fer of the updated data unit between the instances, tonically increasing number;

attaching the version number to the updated data unit

in the buffer of the first DBMS; and In the IBM DB2 database system, updated pages are

storing the version number in the entry for the P lock not written to disk at transaction commit time in order

in the global lock table; 50 to improve the transaction response time and concur

issuing a request for an L lock to read a record on the rency. An updated page which has been obtained from

data unit from a second DBMS; disk and updated by a process is called a "dirty" page.

in response to a request for the L lock, providing the Retention of a dirty page in the buffer of an updating

second DBMS with the version number stored in the system is called "caching" a dirty page. In order to

global lock table and granting the L lock; 55 guarantee proper completion of recovery in the event

if a version of the data unit is in a buffer of the second of a DBMS failure, enough information is recorded in

DBMS, comparing the version number in the data unit - the updating system's log at checkpoint to redo updates

with the version number from the global lock table and contained in the dirty page. In a data sharing environ

requesting the data unit in the global lock manager if the ment, each DBMS instance has its own buffer pool to

version number in the data unit is less than the version 60 cache pages and also has a local log. If a dirty page is

number from the global lock table; otherwise, cached in one system (referred to as the "owner"), then

if the data unit is not in a buffer of the second DBMS, another system requesting the page must get the current issuing a request from the second DBMS to the global version of the page from the owner. The owner could lock manager for a P lock to read the data unit; transfer the page to the requestor by a) a memory-toproviding a request from the global lock manager to 65 memory transfer between database systems (hereinafter, the first DBMS to transfer the data unit to the second "a page transfer"), or b) writing the page to disk and DBMS in response to the P lock request or the request then making the requestor read it from the disk. Manifor the data unit; festly, the response time and concurrency advantages

BRIEF DESCRIPTION OF THE DRAWINGS

DISCLOSURE OF THE INVENTION

5 6

lie with memory-to-memory transfer since it is possible transaction is executing. Implicit in the request is a to save two disk I/O processes (a write I/O by the request for a lock, which the DBMS 16 passes to its owner and a read I/O by the requestor). local lock manager. The LLM forwards the lock reCoherency can be assured in memory-to-memory quest to the GLM. The GLM receives and processes transfer by a message process in which the owner writes 5 grant requests from its LLMs and processes the rethe updated page to disk, then broadcasts a message quests, granting locks by means of messages returned to invalidating all other buffered versions of the page, and the requesting LLMs.

waits for acknowledgements from all possible request- The lock management arrangement of FIG. 1 proors before releasing the lock on the page. A buffer inval- vides global locking functions, but does not perform idation broadcast, however, can be wasteful in cases 10 I/O on the DB 10 when the locks are granted. Inherent where there is a low incidence of contention for pages. in the global locking management function is the ability This process also increases the transaction response of the lock manager (comprising, for a DBMS, its LLM time and reduces concurrency. in conjunction with the GLM) to determine and idenThe invention provides propagation of an updated tify any other DBMS having an updated version of a page from an owner to a requestor on demand of the 15 unit of data for which a lock is requested. Further, requestor. In this respect, the invention provides for the given a message and a lock name, the lock manager can detection of a cached dirty page by a requesting process send the message to the current holder or holders of and speedy provision of the updated page to the re- that lock. This is termed a "notify" message, questor by the owner. The DBMS instances 16 and 30 can comprise curDetection of a cached dirty page is provided in the 20 rently available systems which operate in conjunction invention by a trail kept at a global lock manager in the with a global locking function. It is assumed that these form of a version number associated with the page. The instances communicate with a lock manager by means trail is easily used to detect an out-of-date copy of the of messages. An implementation of the invention enpage. The trail is made without additional messages. hances the DBMSs to provide a new and useful method The trail is especially adapted for a multi-user, data 25 for detecting dirty pages and effecting the memory-tosharing environment in which a global table of granted memory transfer of detected dirty pages without the locks is maintained for all users. In this respect, when a need for conducting I/O operations with the DB 10. lock for the purpose of updating a page is first requested For performance reasons, each DBMS instance has on a page which is not currently buffered, the lock is its own log manager which maintains its own log to granted, the page is obtained from the disk, the page is 30 which log records are first written. In DBMS 16, the updated, a version number is generated for the page, log manager (LM) 25 manages the log 27. In DBMS 30 and the version number' is stored in the lock record LM 35 manages log 37. For the purpose of handling entered in the global lock table for the page. data recovery, a merge log function produces a merged Now, any following request for a lock on the data version of the local logs (the "merged log" 42 in FIG. unit will receive a response including the updated ver- 35 1). This function can exist in any CEC in the complex, sion number. The requestor can compare the version A log manager associates with each log record a log number received in the response with the version num- sequence number (LSN) which is a monotonically inber attached to its copy of the data unit to determine creasing value. For example, an LSN can comprise a whether it needs a new version. If the requestor's ver- timestamp, requiring that the clocks in the multi-user sion number is less than the returned version number, 40 data sharing complex of FIG. 1 be synchronized by a the requestor can seek transfer of the latest version from system clock 44.

the owner, or obtain it from DASD. In the discussion which follows, it is assumed that FIG. 1 illustrates a multi-user data sharing environ- recovery is based upon write-ahead logging (WAL) in ment in which the invention is practiced. In the multi- which an updated page is written back to the same user, data sharing environment, a database (DB) 10 may 45 DASD location from which it was read. The WAL include one or more direct access storage devices protocol asserts that the log records representing (disks) for permanent (non-volatile) storage of data. changes to a page must already be in non-volatile storData is stored to, and obtained from, the DB 10 by a age before the changed page is allowed to replace the plurality of central electronics complexes, two of which previous version of that page on DASD. In the invenare indicated by 12 and 14. Each of the CECs serves one 50 tion, every page in the database has a page_LSN field or more database users and includes for this purpose which contains the LSN of the log record that describes suitable database management functions. For example, the latest update to that page. The value in this field is the CEC 12 includes a database management system also referred to as the "version number" (VRSN) of the (DBMS) 16 having a data manager (DM) 20, a buffer page. This allows the page state to be related precisely manager (BM) 24, and a buffer pool (BP) 26. The 55 with respect to the log records that have been written DBMS 16 maintains a log 27. Similarly, the CEC 14 for it in order for recovery to be performed correctly, includes DBMS 30 with DM 32, BM 34, BP 36, and a • Further, as will be explained below, the BM in each log 37. In this description, the different DBMSs are DBMS instance uses the version number information to identical, and are also referred to as "instances" of each ensure that its log has been forced up to the correspondother. 60 ing LSN before it writes the updated page to DASD.

Access to units of data stored in the DB 10 is man- When any DBMS acquires a page for updating, it is

aged by a locking system including local locking man- asserted that the same page will not be updated concur

agers (LLMs) 18 and 31 and a global locking manager rently in a different DBMS, since that would require the

(GLM) 40. existence of a mechanism to merge concurrent updates

Locking is managed by the GLM 40 in conjunction 65 into a single version of the page. Further, concurrent

with the LLMs. Relatedly, a transaction will request updating would affect the granularity of locking. To

access to an identified unit of data. This request is avoid these problems, the invention employs a physical

passed by a message through the DBMS where the (P) lock on a page to serialize the updating of that page

« PrécédentContinuer »