• Sonuç bulunamadı

Exploiting Main Memory DBMS Features to Improve Real-Time Concurrency Control Protocols

N/A
N/A
Protected

Academic year: 2021

Share "Exploiting Main Memory DBMS Features to Improve Real-Time Concurrency Control Protocols"

Copied!
3
0
0

Yükleniyor.... (view fulltext now)

Tam metin

(1)

Exploiting Main Memory DBMS Features to Improve

Real-Time Concurrency Control Protocols

Ozgfir Ulusoy ° D e p a r t m e n t of C o m p u t e r Engineering Bilkent University Ankara, T U R K E Y A l e j a n d r o B u c h m a n n D e p a r t m e n t of C o m p u t e r S c i e n c e T e c h n i c a l U n i v e r s i t y D a r m s t a d t D a r m s t a d t , G E R M A N Y 1 I n t r o d u c t i o n

The Real-Time Database Systems (RTDBSs) Project at Bilkent University is concerned with var- Ious aspects of transaction scheduling in RTDBSs. Within the REACH (REal-time, Active and Het- erogeneous Systems) Project at Darmstadt we have been working on engineering real-time DBMSs on top of the Chorus RTOS with a special emphasis on ~eroviding predictability and the ability to map high- vel RT-protocols to basic RTOS schedulers. We are also working on combining active and real-time functionality [2]. Recently, both groups started to cooperate. The work described in this paper is joint work that resulted from this cooperation.

Predictability of transaction execution is a basic issue in RTDBSs. Because of the unpredictability of page faults and the time required for I / O (3-4 orders of magnitude higher than memory accesses) the work on RTDBS concurrency control has made one of two possible assumptions: either the perfor- mance metric used is simply the percentage of trans- actions finishing their execution within their dead- line, without giving any guarantees for an individual transaction, or the underlying database is memory- resident. Main memory databases become increas- ingly feasible due to the drastically falling mem- ory prices and growing memory sizes. However, the concurrency control protocols developed so far for RTDBSs are derived from disk-resident DBMS con- currency control algorithms and do not exploit the inherent properties of main memory datab~es.

An assumption underlying the recently published concurrency control protocols for RTDBSs is that predeclaration of locks is impractical because it is impossible to predict which instance of a relation will actually be accessed by a transaction. There- fore, the model of dynamic resource acquisition is assumed. Those protocols spend considerable CPU time for the detection and resolution of data con- flicts and fine-grained lock management. This over- head reduces the effective C P U utilization, and leads to an increase in the number of missed trans- action deadlines.

It has been demonstrated that very large lock

"The work of Ulusoy was supported by the Research Council of Turkey (TfJBITAK) grant no. EEEAG-137.

granularities (e.g., relations) are most appropriate in main memory databases [3], [4]. When I/O is eliminated, the primary advantage of small lock granularities is effectively removed. Under the con- siderations for lock granularity in main-memory databases, we believe that concurrency control and scheduling with predeclaration of resources should be revisited for RTDBSs. It is simple to determine by purely syntactic means during transaction com- pilation the read and write sets of the transaction at the relation level. If the lock granularity is the relation, it becomes feasible to use simple but ef- ficient concurrency control and scheduling mecha- nisms based on resource predeclaration.

In this paper, we propose a simple, predec- laration-based concurrency control protocol for main-memory RTDBSs. Predeclaration protocols require the knowledge of what resources will be used ahead of t,.'me and the granularity at which resources are locked. A transaction, when submitted, is al- ways parsed and compiled into an internal, opti- mizable form. During parsing it is possible to detect with simple syntactical means which relations will be accessed by a given transaction. It is further pos- sible to detect in the same parsing step whether the proposed access is for reading or writing purposes. Under these conditions the read and write sets for a transaction can be established a priori, and the transaction can be scheduled in a conflict-free man- ner by preacquiring the necessary resources. By do- ing this, a transaction will execute without blocking and will minimize its time in the system. Data re- sources will be locked only the time required for the actual computation of a transaction. The CPU as the limiting resource will be fully used and less time will be wasted on lock management. We claim that our protocol is much more efficient than previously proposed protocols with dynamic resource acquisi- tion. it also offers the possibility of determining ex- ecution times without the effects of blocking thereby allowing us to give guarantees for the execution of high-priority transactions.

We also describe a performance model designed for studying various issues in main-memory RT- DBSs. We are using this model to compare our protocol against other concurrency control proto- cols from the literature. The performance results

(2)

For each transaction T submitted to the system, OFF-LINE:

Parse transaction T, identify the relations to be accessed, and construct

read_set[T]

and

write_set[T].

ON-LINE:

Set

read_blocked[T]

and

write.blocked[T]

to empty.

For each transaction T * that is either executing or in the

ready-queue,

read_btocked[T] = read_btocked[T] V (read-set[T] n write.~a[T'])

write_blocked[T] = write_blocked[T] U (write.set[T] n read_set[T'])

U (write_set[T] n w','ite..set[T'])

EndFor.

If both

read_blocked[T]

and

wriie_blocked[T]

are empty insert T into

ready-queue.

else,

insert T into

wait-queue.

EndIf.

W h e n a transaction T commits,

T h e locks on the relations in

read_set[T]

and

write-s.set[T]

are released.

For each transaction T e in the

wait-queue,

read_blocked[T],= read_blocked[T'l, write_set[T]

write_blocked[T'] = write_blocked[T']- write_set[T]- read_set[T]

If both

read_blocked[T']

and

wrile_blocked[T']

become empty T ~ is transferred to the

ready-queue.

Endlf. EndFor.

The highest priority transaction in the

ready-queue

is started to execute after granting its locks.

Figure 1: The concurrency control protocol.

will be presented in the full version of the paper. 2 T h e C o n c u r r e n c y C o n t r o l P r o t o c o l

For each transaction submitted to the system, the list of relations to be accessed by the transac- tion, and the mode of each access (i.e., eiLher read or write) are determined. Then, a conflict check is performed between the relations to be accessed by the new transaction and the relations in the access list of already scheduled transactions. If no con- flict is detected, the transaction is inserted into the ready-queue. Otherwise, the transaction is inserted into the wait-queue, and two sets of blocked rela- tions, one for read access and one for write access, are established for the transaction. Both the ready- queue and the wait-queue are organized on the basis of transaction priorities. A variety of criteria can be used to determine a transaction's priority.

W h e n a transaction is committed, its read and write locks are released. T h e set of relations which were write-accessed (read/write-accessed) by the committed transaction is intersected with the read- blocked (write-blocked) relation set of each trans- action in the wait-queue. T h e intersecting elements are eliminated from the blocked relations sets. If, for any transaction in the wait-queue, both the

read-blocked and write-blocked relations sets be- come empty, that transaction is transferred to the ready-queue. Following each commitment, the first transaction in the ready queue is started to execute. 2.1 F o r m a l D e s c r i p t i o n o f t h e P r o t o c o l

The data structures associated with the protocol are:

• read.set[T]:

The set of relations to be read by

transaction T.

• write.set[T]:

The set of relations to be updated

by transaction T.

• read_blocked[T]:

The set of relations in

read-set[T],

but currently write-locked by some

other transactions.

• write_blocked[T]:

The set of relations in

write_set[T],

but currently read or write-locked

by some other transactions.

ready-queue:

T h e list of transactions that are

ready to execute.

wait-queue:

T h e list of transactions that have

s o m e access requests conflicting with the sched- uled transactions.

(3)

1 . O - - - ~ - - A

0 . 8

l ~ r o l o c o l

0'%.0 7:o 9:o , ;.o , ;.o ,5.o

A v t r l l ~ e Inl-trllrrtvll TIn-1Q

Figure 2: Real-time performance of the protocols as a function of the average interarrival time of trans- actions.

Figure 1 provides a formal description of our R T D B concurrency control protocol.

3 A R e a l - T i m e D a t a b a s e S y s t e m M o d e l a n d P r e l i m i n a r y R e s u l t s In this section, we sketch the R T D B S simula- tion model used to evaluate the performance of the proposed concurrency control protocol and give some preliminary results. The model is based on an open queuing model of a multiprocessor, memory- resident database system.

The entire database is kept in main memory, while a stable copy, possibly out of date, is kept on disk. For each transaction the disk is only accessed once to write the log record onto disk and guar- antee write-ahead logging. The disk-resident copy of the database can be updated asynchronously by applying the log (possibly on a separate processor). In the case of system failure, the database can be recovered from the stable copy and the log. Since application of the log records to the disk-resident version of the database can be done off-line, it is safe to assume that this process does not interfere with regular transaction processing. Therefore, the only I / O cost paid by a transaction is the writing of the log. A feasible alternative for writing to the disk is broadcasting the log to other machines, thus reducing the delay by almost an order of magnitude. Transaction arrivals are assumed to be Poisson. Each transaction is associated with a real-time con- straint in the form of a deadline. The transactions are prioritized based on the earliest deadline first policy; i.e., a transaction with an earlier deadline has higher priority than a transaction with a later deadline.

The details of the main-memory RTDBS model were captured in a simulation program. The per- formance of our protocol was studied and compared against the performance of some other concurrency control protocols proposed recently for RTDBSs.

1.0 0 9 0.8 0.7 0.6 0 .SS., ~ ~ 0 O P A , , , 1 , I P I , , 7 . 0 g.C 1 1 . 0 13.0 15.0 A v e c m O e Interm-rlvm! T i m e

Figure 3: Useful C P U time results.

T w o protocols selected for comparison are the Pri- ority Abort protocol [1] and the Priority Inheritance protocol [5]. The initial results we obtained under different levels of transaction load are quite encour- aging for the performance of our protocol. Figure 2 presents the preliminary results obtained for the relative performance of the protocols in terms of the fraction of transactions that satisfy their deadlines. The new protocol provides considerably better per- formance than the others. It enables the system to spend more useful C P U time on transaction pro- cessing, and as a result, even under very high loads only a few transactions miss their deadlines. Figure 3 presents the results obtained for useful C P U time which specifies the fraction of C P U time that is not wasted (i.e., used for processing the operations of committed transactions).

R e f e r e n c e s

[I] R. Abbott, H. Garcia-Molina, 'Scheduling Real-Time Transactions: A Performance Eval- uation', ACM Transactions on Database Sys- tems, vo1.17, no.3, pp.513-560, 1992.

[2] H. Branding, A. Buehmann, 'On Providing Soft and Hard Real-Time Capabilities in an Active DBMS', International Workshop on Ac- tive and Real-Time Database Systems, Skovde, Sweden, 1995.

[3] H. Garcia-Molina, K. Salem, 'Main-Memory Database Systems', IEEE Transactions on Knowledge and Data Engineering, vol.4, no.6, pp.509-516~ 1992.

[4] T.J. Lehman, M.J. Carey, 'A Recovery Al- gorithm for a High-Performance Memory- Resident Database System', ACM SIGMOD Conference, pp.104-I17, 1987.

[5] L.Sha, R.Rajkumar, S.H.Son, C.H.Chang, 'A Real-Time Locking Protocol', IEEE Transac- tions on Computers, vol.40, no.7, pp.793-800, 1991.

Şekil

Figure  2:  Real-time performance of the protocols as  a function  of the  average  interarrival  time  of trans-  actions

Referanslar

Benzer Belgeler

Un grand nombre d’aqueducs fameux sillonnent la cam­ pagne aux environs de la ville: ils sont destinés à transporter l'eau d'une colline à l’autre à travers les

Enstitüsü,nden sağlaİ;-T;;"" Hanım tritikale çeşidi, Bahri dağdaŞ Uluslararası Tarımsal Araştırma EntstitüSü,nden sağlanan Kalla,.Tat|ıçak,97, Melez

Applications to the asymptotic analysis of state-dependent queueing systems and networks with hierarchic state space, working in different scales of time and

In this study, the band structure and transmission spectra in multiferroic based Sierpinski-carpet phononic crystal are investigated based on finite element simulation.. In order

Yet Stephen Arata’s reading in ‘The Occidental Tourist: Dracula and the Anxiety of Reverse Colonialism’, foregrounds notions of identity, invasion and Englishness, which tally

Within the limits of the present paper, only the following questions are considered: Two close-ended questions inquired about how students learned during the

Before implementing CILL within any logical framework or Prolog, we have decided that it is a good practice to implement first-order intuitionistic logic with constraint extension

of the evolutionary approach, the mistakes jirevent any of the varic'ties, \.c. the strategies in the model, from getting extinct. The firms ¡K'rcc'ive theur own