Docsity

Analysis of Concurrency Control in Distributed Database Systems, Summaries of Engineering

Toggle sidebar
bg1
Modeling and Analysis of Transaction Processing Systems
Philip S. Yu
IBM Research Division, T. J. Watson Research Center
Yorktown Heights, NY 10598
Abstract. In recent years, the demand for on-line transaction processing systems has
grown rapidly with ever stringent performance requirements. In this paper, we examine
several issues encountered in designing transaction processing systems and report some
of the recent advancements in analytical performance modelling methodology on analyz-
ing alternative design trade-offs. First of all, the Concurrency Control (CC) scheme em-
ployed can profoundly affect the performance of transaction processing systems. A
general analytic modelling approach is presented that can be applied to analyze the vari-
ous CC schemes under a unified framework, including locking, various optimistic
schemes, and hybrid schemes. The analysis can capture the effect of skewed data access,
different lock modes, variable length transactions and the buffer retention effect on rerun
transactions. Next we consider the analysis of buffer hit probability. In a multi-node
environment, whether in a cluster or client server environment, buffer coherency needs
to be addressed. The cross invalidation phenomenon can have an adverse effect on the
buffer hit probability. A general methodology to analyze various coherency control
schemes is examined to predict the buffer hit probability. A hierarchical approach is used
to decompose the modelling of transaction processing systems into three components:
hardware resource, concurrency control and buffer models. The interaction among the
components is then captured through a fixed point iteration.
1. Introduction
In recent years, the demand for on-line transaction processing systems has grown rapidly with
ever stringent performance requirement. With the advent of VLSI technology, coupling multiple
micro-processors to support high transaction rates has been pursued by various vendors
[KRON86, YU92B,C]. Furthermore, client-server architectures have increasingly become a
common approach to support transaction processing [KIM90, DEUX90, HORN87]. There has
also been considerable interest in geographically distributed transaction processing systems, in
which the databases may be distributed among regional systems [GRAY86]. In this paper, we
examine several issues encountered in designing transaction processing systems to accommodate
these requirements and report some of the recent advancement in analytical modelling method-
ology on analyzing performance trade-offs of alternative designs to address these issues.
First of all, the Concurrency Control (CC) scheme employed can profoundly affect the per-
formance of transaction processing systems. This is particularly so as the demand for transaction
throughput increases leading to greater data contention. There have been numerous analytical
studies of the performance of CC schemes. A survey of the analysis of locking in centralized
databases can be found in [TAY84,TAY90], while [SEVC83] examines early analytical work
on the performance of different CC schemes in distributed databases. More recent work includes
[CHES83, MORR85, TAY85A, B, THOM85, YU85, RYU87, YU87, CELL88, SING88, HSU88,
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19

Partial preview of the text

Download Analysis of Concurrency Control in Distributed Database Systems and more Summaries Engineering in PDF only on Docsity!

Modeling and Analysis of Transaction Processing Systems

Philip S. Yu

IBM Research Division, T. J. Watson Research Center

Yorktown Heights, NY 10598

Abstract. In recent years, the demand for on-line transaction processing systems has

grown rapidly with ever stringent performance requirements. In this paper, we examine

several issues encountered in designing transaction processing systems and report some

of the recent advancements in analytical performance modelling methodology on analyz-

ing alternative design trade-offs. First of all, the Concurrency Control (CC) scheme em-

ployed can profoundly affect the performance of transaction processing systems. A

general analytic modelling approach is presented that can be applied to analyze the vari-

ous CC schemes under a unified framework, including locking, various optimistic

schemes, and hybrid schemes. The analysis can capture the effect of skewed data access,

different lock modes, variable length transactions and the buffer retention effect on rerun

transactions. Next we consider the analysis of buffer hit probability. In a multi-node

environment, whether in a cluster or client server environment, buffer coherency needs

to be addressed. The cross invalidation phenomenon can have an adverse effect on the

buffer hit probability. A general methodology to analyze various coherency control

schemes is examined to predict the buffer hit probability. A hierarchical approach is used

to decompose the modelling of transaction processing systems into three components:

hardware resource, concurrency control and buffer models. The interaction among the

components is then captured through a fixed point iteration.

1. Introduction

In recent years, the demand for on-line transaction processing systems has grown rapidly with

ever stringent performance requirement. With the advent of VLSI technology, coupling multiple

micro-processors to support high transaction rates has been pursued by various vendors

[KRON86, YU92B,C]. Furthermore, client-server architectures have increasingly become a

common approach to support transaction processing [KIM90, DEUX90, HORN87]. There has

also been considerable interest in geographically distributed transaction processing systems, in

which the databases may be distributed among regional systems [GRAY86]. In this paper, we

examine several issues encountered in designing transaction processing systems to accommodate

these requirements and report some of the recent advancement in analytical modelling method-

ology on analyzing performance trade-offs of alternative designs to address these issues.

First of all, the Concurrency Control (CC) scheme employed can profoundly affect the per-

formance of transaction processing systems. This is particularly so as the demand for transaction

throughput increases leading to greater data contention. There have been numerous analytical

studies of the performance of CC schemes. A survey of the analysis of locking in centralized

databases can be found in [TAY84,TAY90], while [SEVC83] examines early analytical work

on the performance of different CC schemes in distributed databases. More recent work includes

[CHES83, MORR85, TAY85A, B, THOM85, YU85, RYU87, YU87, CELL88, SING88, HSU88,

DAN88, HART89, CICI90A,B, SING91, THOM91, YU91, CIC192, HSU92, YU92A,93].

While there have been numerous simulation studies of concurrency control performance, we do

not mention them here since the focus of this paper is on analytical methodology. Here a general

analytic modelling framework is presented which can be applied to analyze the performance

trade-offs of various CC schemes under a unified methodology, including locking, various op-

timistic schemes, and hybrid schemes. This is based on the methodology developed in [YU93]

which is derived and extended from a number of specific studies we have done, e.g. [YU85,

CORN86, YU87, CICI92,90A,B, YU90,91,92A]. The analysis can capture the effect of skewed

data access, different lock modes, and variable length transactions.

Next we consider the analysis of buffer hit probability. In a multi-node environment, whether

in a cluster or client-server environment, buffer coherency control needs to be addressed. The

cross invalidation phenomenon can have an adverse effect on the buffer hit probability. In the

literature, there have been few studies based on analytic models for this. Recently, a general

methodology has been developed in [DAN90,91,92A,93A,B] to model the effects of various

coherency control schemes on buffer hit probability. Here we present the buffer modeling

methodology based on these works. We note that coherency control can be provided by gen-

eralizing the CC manager function to track the buffer contents [DIAS89]. Various lock retention

schemes have also been proposed to support coherency control [RAHM86, RAHM88, MOHA91,

DAN92A,93A, WlLK90, FRAN92, CARE91], although most of the performance studies are

based on simulations.

The execution time of a transaction depends on three main factors: 1) the concurrency

control protocol used for resolving conflict in accessing data pages (waiting, abort etc.), 2) the

buffer hit probability that determines the number of I/O operations to be performed by the

transaction, and 3) the processing time and the queueing delay in accessing system resources

such as CPU, etc.. We model the concurrency control, buffer hit probability and system resource

access times separately and capture their interactions via a higher level model. This higher level

model relates quantifies from the lower level models through a set of non-linear equations. The

solution of the higher level model corresponds to the solution of a fixed point problem which

we solve through an iterative process. The transaction execution time depends on the buffer hit

probability estimated by the buffer model, and by the queueing and services estimated by the

CPU model. The CC model estimates the data conflict probability based on the transaction ex-

ecution time, and this in turn affects both the buffer and resource models.

In Section 2 we discuss the workload model. In Section 3 we discuss the general method-

ology for analyzing concurrency control schemes. We apply this methodology in Section 4 to

analyze various CC schemes. For optimistic schemes the effect of changed buffer hit probability

when a transaction is rerun is handled in the analysis. For locking we provide a simple ap-

proximate expression for the mean lock waiting time. In Section 5 we present the methodology

to analyze the buffer hit probability under various coherency control schemes. In Section 6,

generalization of the methodology in Section 5 is considered. Concluding remarks appear in

Section 7.

access pattern where K = 2 , (r162 0.2), and (13,.1~2)=(0.2,0.8). The uniform access model is another special case with M = 1, c~ = 1 and 131= 1. Even if each transaction application follows the 80-20 access pattern on some relations, multiple transaction applications may have different hot sets and cold sets, and different access rates. Overall this can result in a larger number of logical partitions with different access frequencies and partition sizes. In [DAN93C], real workload traces are analyzed to fit this kind of skewed access model. It was found that with a small number of partitions, the matching of the buffer hit prediction based on this model with the trace driven simulation can be very close.

We note that skewed access pattern has different effects on data contention and buffer hit probability [DAN90B]. The presence of skew increases the data contention probability. This would have a negative effect on the the transaction response time. On the other hand, the skewed accesses improve the buffer hit probability. This would have a positive effect on the response time. However, in a multi-node environment, the skewed accesses also makes the buffer invalidation effect more severe, and thus negatively affects the buffer hit probability. The analytic modelling methodology would need to capture all these effects.

3. Concurrency Control: General Methodology

In an environment with no data contention, the transaction response time is determined by the queueing and processing delay in accessing hardware resources such as CPU, I/O, etc.. In the presence of data contention, the transaction response time further depends upon the occurrence of data conflict in accessing the database. The probability of data conflict for any transaction depends not only on the CC scheme itself but also on the transaction response time which in turn depends on the conflict probability. For example, when locking is used, if the lock contention probability increases, the transaction response time increases due to additional lock waits. In turn, longer transaction response time leads to a longer lock holding time, and hence to a higher lock contention probability. Similarly, when an optimistic CC scheme is used if the transaction abort rate increases, there is a concomitant increase in the CPU utilization causing longer re- sponse and data holding times, and therefore a higher probability of abort. We model hardware resource access times and the effect of CC separately and then we solve the models simultane- ously using an iteration to estimate the mean transaction response time. We assume here an open model with Poisson transaction arrivals, but the analysis can be extended to a closed model as shown in [YU93]. The hardware resource contention can be modeled by conventional queueing models with CPU servers and disk servers. Since this is rather straightforward, we will only briefly outline it for the case of analyzing optimistic CC (Section 4.1.2).

In this and the next section, we will concentrate on how to estimate the data conflict proba- bility and mean lock waiting time. A model for predicting buffer hit probability can also be incorporated to provide a more accurate estimate of the number of I t ' s and will be discussed in Section 5.

3.1 Conflict Analysis

A conflict is defined to be an event in which a transaction accesses a data granule that is cur- rently accessed or in use by another transaction in an incompatible mode. The result of a conflict is either a transaction wait or transaction abort. We assume that there is only one transaction type. (Generalization to multiple transaction types is straightforward and can be found in

[YU93].) We also make the following additional assumptions and then show how they can be relaxed at the end of this section:

9 The granule access distribution is uniform over the set of granules. 9 All accesses to granules are exclusive or update.

Let 7~ be the transaction arrival rate, NL be the mean number of granule accesses by each transaction, and L be the number of granules in the database. Let Tn denote the mean holding time of a granule, that is the period of time from when the granule is first accessed until the end of the transaction.

Consider a generic locking scheme. We assume that the probability of deadlock is negligible compared to lock contention as shown in [GRAY81, TAY85B, YU93]. Before a granule can be accessed, a transaction needs to acquire a lock on that granule. A lock request can be made right before each granule is accessed as in dynamic locking, or all lock requests can be made at the beginning of a transaction as in static locking. Each time a lock request is made the corresponding entry in the lock table is examined. If no other transactions hold an incompatible lock on that entry, the granule is locked and the access is granted. The granule is locked until it is released by the transaction. If the granule has already been locked in an incompatible mode, lock contention occurs. (Note that for now we are considering only exclusive granule access so that all accesses to the same granule are incompatible.) Due to the assumption that deadlocks do not occur and the assumption of uniform granule access distribution, the arrival rate of lock

requests for a particular granule is ~OVdL. We have

Conflict probability under Locking: Assume that the lock request times form a Poisson

process and that lock contention events for a transaction are independent. Then the probability of contention on any lock request, Pw, is given by

~NLTH

P w - L ' (3.1)

and the probability, Pco~, that a transaction encounters lock contention is upper bounded as

follows:

PCOIVT<I _ ( 1 - ----T-- LNLTH lqL ) (3.2)

The derivation is straightforward for the case of fixed length transactions. As shown in [YU93], this is also true for the case of variable length transactions.

We will use the upper bound in Equation (3.2) as an approximation to Pco~r, i.e.

Pco~,rr~l_(1 - ~ L r H ~ ) ~L. (3.3)

An O(llL) approximation to Equation (3.3) is given by

~L2r.

Pc~ L (3.4)

Pco~W 2 ~iL (3.8) i=

As we assume that each lock request independently references partition i with probability ~ , the mean lock holding times are the same for each partition i, i.e. Tn, = T., 1 _<i < M. Under OCC in this environment, a similar development to that for a single partition of granules gives,

PA=Z ~iL (3.9/ i=

Finally we illustrate how the case of different access modes can be handled by considering the case of exclusive and shared modes. Assume that each data access has probability p" of being ia exclusive mode and that the mode of each access is independent. Again we consider the case of uniform accesses to the database. First consider the generic locking case, similar to Equation (3.3), we can get,

PCONT < _ (^) 1 -- (1 (^) - LNLT ~ ) H NLp" (1 (^) LNtpUTH L ) NL(I-P")

An approximation similar to that in Equation (3.4) is, ~jVL2TItpU(2 _ pU) PCONT= L (3.10)

Under the OCC environment, a similar development leads to

kN2TnpU (3.11) PA= L

3.2 Conservation Property of Conflict The approximate expressions for the transaction abort/invalidation probability when using the genetic OCC scheme given in Equation (3.7) and for the transaction contention probability when using the generic locking CC scheme given in Equation (3.4) are the same for the case of a single transaction type with exclusive access mode. (These approximations contain only the dominant term, which is O(1/L) in the approximations in Equations (3.6) and (3.3) respectively. However, we believe that the O(llL) expressions provide insight into the effects of data conflicts for the various CC schemes we consider, and thus we discuss them in this section.) This is true even if the database consists of multiple partitions of granules with different access probabilities as

shown in Equations (3.8) and (3.9). This is referred to as the conservation property of conflict

in [YU93]. Note, however, that the mean granule holding times, T,, will in general not be equal for the two schemes, as discussed later in this section, so that the conflict probabilities will differ.

In the optimistic case, the abort probability affects the number of reruns and hence the CPU utilization which affects TH. In the dynamic locking case, the contention probability increases the transaction response time, and consequently, the mean granule holding time, Tn. If the CPU resource is unlimited, the optimistic approach provides lower conflict since Tu is close to the processing time. If the CPU resource is very limited, static locking tends to provide lower

conflict. (In static locking, a transaction tries to acquire all locks at once at the beginning. If it cannot get all of them, it does not hold on to any locks, but tries later or waits until they all become available.) In this case, the wait time to get the locks does not enlarge the granule holding time. In [YU90], a CC scheme using a combination of locking and OCC is proposed, and is shown to improve the performance over both OCC and locking schemes by striking a balance between the effect of transaction aborts and lock waits as discussed in Section 4.3.1.

Finally, a word of caution. If we allow for different access modes like shared and exclusive, the conservation property may no longer hold. This is clear by comparing Equations (3.10) and (3.11). This is due to the fact that the concept of access modes is a further optimization to re- duce conflicts between transactions and different CC schemes like locking and OCC, depending upon the specific implementation, can have different capabilities to exploit it. Another case where the conservation property is violated is when transactions which may not be successfully committed abort conflicting transactions, or when transactions wait for subsequently aborted transactions, as in wound wait [ROSE78], locking with no-waiting [TAY85A], various running priority schemes in [FRA85], and wait depth limited concurrency conlrol in [FRA92]. These schemes produce unnecessary aborts or waits. On the other hand, these schemes may result in smaller values for T, compared to locking.

4. Analysis of Various CC schemes

In this section, we demonstrate how to apply the methodology just presented to approximate the mean response time for optimistic and locking CC schemes. Unless stated otherwise, for sim- plicity we will assume that there is only one transaction type, the granule access distribution is uniform and all accesses are exclusive. Relaxing these constraints can be similarly addressed as in Section 3. Furthermore, only the case of fixed length transactions is considered and a centralized lock manager is assumed. Generalization of the methodology to handle variable length transactions and distributed environments with database replications can be found in [YU93].

4.1 Optimistic Protocols In this subsection, we consider the OCC schemes. Various OCC schemes have been proposed in the literatures. Two commonly considered variations are the pure OCC scheme where a transaction is aborted only at certification time, and the broadcast O C C scheme where a transaction is aborted as soon as any granule it has accessed is made obsolete by a committing transaction. Most previous analyses on OCC schemes ignored the fact that due to buffering in main memory rerun transactions may not need to re-access from disk all the granules brought in during previous runs and therefore came out in favor of broadcast OCC. In [YU93], the analysis specifically captures this buffer retention effect and is able to show that pure OCC can in fact outperform broadcast OCC. A combination of the pure OCC and broadcast OCC, referred to as OCC with broadcast during rerun is proposed and analyzed in [YU92A]. In this scheme, a transaction uses pure OCC for its first run, and employs the early abort of broadcast OCC for any subsequent reruns. Compared with pure OCC, the immediate abort during rerun

Pa= 1 - exp ( - LN2TH/L) (1^ )~ILTCo,.,.it L^ )lvL

This can be further approximated as,

~dV2(TH + Tcommit) PA= L (4.2)

While we can derive Equation (4.2) from Equation (4.1), what is interesting to note is that we can directly write down the expression by adding together the conflict terms from the two different sources, i.e. conflicting with transactions already in commit, and aborting by trans- actions initiating commit. This is referred to as the additive approximation property in [YU93]. In doing this, it is important to identify the sources of abort. In this case there are two: one is from invalidation and the other is from lock contention. Taking advantage of the additive approximation, we can estimate each term separately based on Equations (3.4) and (3.7) and sum them.

We next consider the rerun transactions. After state NL + 1, if the transaction is aborted, it returns to state 1. During reruns, upon entering state i, the transaction not only informs the concurrency control manager of its access to the i-th granules, but also checks to see if it has already been marked for abort. If already marked for abort, the transaction is immediately aborted and returns to state 1.

To analyze the abort probability of rerun Iransactions, recall that all read I/Os are assumed to be done in the first run; hence, there is no FO during rerun. The mean time at each state i, 1 < i < NL, is assumed to be the same and is denoted by R' corresponding to execution of P" instructions. The probability of abort A(i) in the i-th state of a rerun is estimated as,

A(i) = 1 - exp ( - iNLLI(IL ) (1 - lVL~.TCommi,L )" (4.3)

The remaining response time at the start of a rerun (if any) is estimated as,

NL i - 1 Z { ~ ( 1 -a(k))}a(i){B + TBackoff+ (i -- 1)R'} B = i=l k=lIVt

+ { I--I(1 -- A(k))}NLR'. k = l

i -! In the first summation term of Equation (4.4), { I-[(1-A(k))}A(O k=l corresponds to the abort probability after advancing to state i in a rerun and {B + T~,~o~r+ (i - 1)R'} i s the expected re- sponse time measured at the start of this rerun. In the second term of (4.4), l-I(1 -A(k)) is the t = l

probability that a rerun completes and commits, while No~" is the corresponding response time. The expected remaining instructions executed by a rerun transaction is estimated as,

NL i - I E t H ( 1 - A ( k ) ) } A ( i ) { O + TBackoff+ (i - 1)P'}

D = i = l k=l lVL

  • { H ( 1 -A(k))}NLI / 9

k=l

This equation is similar to (4.4) with B replaced by D, and R' by P'.

4.1.2 Hardware Resource Model We now describe the hardware resource model and show how it can be coupled with the data contention model through an iteration. We assume that the system consists of a single CPU and a database that is spread over multiple disks. Assuming Poisson arrivals of transactions, we model the processors as an M/M/1 queue with FCFS discipline and the disks as an infinite server. Other open queueing network models could be used; we chose this one for simplicity. The processor utilization is given by ^ ~ X { P A D + P I N P L + NLP} P = M I P S (4.6)

where MIPS is the processor speed. Then the mean times in different states are given by as,

RINPL =

PINPL

MIPS(1 - p ) ~" IINPL • I O T I M E ^ MIPS(1 - p)^ + I • I O T I M E 1 ~ - P" MIPS( I - p)

where I = 1 - H is the average number of I/Os per state in the first run (respectively any sub- sequent run). We will discuss how to estimate H in Section 6. The overall mean transaction response time is given by A R = Rtl~pL + NLR + Tcommit + eA(TBackoff+B). (4.8)

From Section 4.1.1, we know Pa and A(i) depend upon R and R', respectively, whereas R and R' depend upon the CPU utilization p which in turn depends upon PA and A(i). There clearly is an interdependency. We can first pick some arbilrarily small abort probabilities, Pa and A(i), and calculate the mean response times, k and R'. The mean response times are then used to calculate a new set of abort probabilities. The process continues and typically converges in a few iterations.

The quantity Rw/j~ (respectively a/A) is the mean remaining time in substate i (respectively i) given that the transaction contended with was in that state, 1 < i < NL, and similarly for clf3. Note that in obtaining Equation (4.10) we have assumed that when a transaction Tl encounters con- tention for a lock held by another transaction T2, then no other transaction T3 can be waiting for this same lock, i.e. the queue length for any lock never exceeds two. Thus, when T2 com- mits and releases the lock T~ acquires it without further waiting. Note, however, that T2 can be waiting for a lock held by yet another transaction T4, and T4 can also be waiting, etc. Thus, wait chains can build up due to waits for different locks, and this is captured by the analysis. Since transactions typically hold several locks, wait chains of this type (rather than for the same granule) predominate. The factors jS, J~ and J~ depend on the distributions of the times in sub- states i, i and NL+ 1 respectively. Substate i corresponds to the CPU execution time and the I/O time if the granule accessed in the state is not found in memory (recall that H denotes the probability that a granule accessed in any state is found in a main memory buffer). Assuming that H is not very close to one and that I/O time is constant and much larger than the processing time (this is true for typical parameter values), then it is easy to show that j~=2(1 - H ). In our studies we will assume that j~ = 2 corresponding to a constant time in the the commit state and that j~ = 1 corresponding to exponential lock waiting times. Comparison with simulations [YU92A] indicated that 3~ = 1 yields good results. At low contention levels, the estimates from j~ = 1 are a little pessimistic. Equation (4.10) can be simplified to yield,

2 ( a + b ) 2 ( N L + I ) ( N L _ I ) (NL+l)(-~x + a b + a c + b c ) 2 6 +^2 t-^ ~^ - ab - bc Rye= J3 (4.12) NL+ I - 1 a( ~ ) + c + b( - ~ - - )(1 - -f~l )

For large NL, small c, and small b compared to a, the right side of Equation (4.12) is approxi- mately equal to ((a + b)(NL - 1) + c)13. This is the approximation used in [YU87]. Furthermore, it follows from using Equation (3.1) and computing the mean lock holding time Tn from Equation (4.9) that

Pw = LGL (4.13)

The mean response time can be estimated as

R = Rt,vpL + R E + NLPwRw + Tco,,,,nit (4.14)

where RE = NL x a is the mean duration of the execution phase, which can be approximated using a hardware resource model similar to that in Section 4.1.2. Since both Rw and Pw in Equations (4.12) and (4.13), respectively, depend upon b =PwRw, we need to solve for them through an iteration. Starting with b = 0, we can get initial values for Rw and Pw, and thus a new b value. The process continues and typically converges in a few iterations.

4.3 Extensions to Other CC Schemes

4.3.1 Hybrid CC Schemes

Locking tends to suffer form cascade blocking while OCC may suffer from wasting resources due to transaction aborts. Various combinations of locking and OCC schemes have been con- sidered in the literature. One type of hybrid CC schemes is to use pure OCC for the first run and locking for the second run. As the second run will be shorter due to the buffer retention effect, the blocking effect would be minimized. This would also greatly reduce the number of reruns. If static locking is used for the second run, there can be at most one rerun. These types of schemes are analyzed in [YU92A] based on a similar analytic approach presented here.

Another type of hybrid scheme, referred to as locking with deferred blocking, is to divide transaction execution into a non-blocking phase and a blocking phase. At the start of the exe- cution, a transaction is in the non-blocking phase similar to OCC. After a transaction has ac- cessed a predefined number of granules, it tries to enter the blocking phase by obtaining locks on the granules already accessed and if successful, it will request locks for all subsequent granule accesses. This would avoid costly abort at the later states of a transaction execution and avoid long waits as transactions only hold locks at the later states. This scheme is analyzed in [YU90] using similar approach presented here. These hybrid schemes have been shown to lead to better performance than the conventional locking and OCC schemes and are especially at- tractive for real-time CC [YU94].

4.3.2 Dynamic Timestamp Certification The OCC schemes considered in Section 4.1 attempt to serialize transactions using certification times as the timestamps [BERN87]. Other OCC certification schemes using dynamically de- rived timestamps or interval of timestamps have been proposed [BAYE82, BOKS87, YU91]. This type of schemes is effective in reducing the read write conflict. Consider the following scenario. Assume that transaction X reads granule A and transaction Y subsequently updates granule A and commits before transaction X completes. If OCC (pure or broadcast) is used, transaction X will be aborted. This type of conflict is referred to as rw-conflict. However, transaction X can in fact be committed with a back-shifted timestamp earlier than that of trans- action Y. This is what the dynamic timestamp certification scheme offers. Note that shifting timestamp backward would not be allowed if it would cause conflict with other committed transactions. For example, if transaction X further updates granule C and some other transaction Z already read the old value of C and committed after transaction Y, giving transaction X a back-shifted timestamp before transaction Y would cause a conflict, referred to as a wr-conflict, with transaction Z and hence violate the serializability constraint.

The methodology presented here has been extended in [YU91] to analyze the dynamic timestamp certification scheme based on timestamp history. In [YU91], a discrete time approach

methodology described below is applicable to both environments, albeit the parameter values in the two environments can be different.) Various buffer coherency control schemes have been proposed in the literature [DIAS89, RAMA89, WlLK90, CARE91, DAN93B]. In [DAN93B], these are classified into three approaches: detection of invalidated granules, notification of invalidated granules, and propagation of updated granules. These schemes show different trade-offs on the buffer hit probability and CPU overhead. A general modeling methodology is developed in [DAN93B] to analyze six different coherency schemes under the three ap- proaches.

The buffer hit analysis under the LRU replacement policy can be analyzed based on two simple principles: (1) conservation of flow on L R U substack composition and (2) Ideation conten.t probability proportional to relative push down rate, as explained later. These have been applied to analyze the single node environment in [DAN90A] and the multi-node envi- ronment in [DAN93B, DAN92A,B]. We will use the multi-node environment to illustrate the ideas as the single node case can be considered to be a degenerate case of N = 1 in the multi- node environment. Two commonly used coherency control schemes are examined: the check- on-access (CA) and the broadcast or selective invalidation notification (IN) schemes, where CA follows a detection oriented approach and IN uses a notification oriented approach. (Note that the buffer hit probability under the propagation oriented approach is not affected by the the invalidation effect as the invalidated granules are immediately replaced.)

Under the IN approach, an invalidation message containing a list of granules modified by the committing transaction is broadcast to all other nodes during transaction commit [STRI82, DAN90B]. Each node upon receiving the invalidation message will check for the updated granules and mark them invalid if present in its local buffer. This immediately frees up the buffer space occupied by the obsolete granules which are brought to the bottom of the LRU stack. A variation of the scheme is to selectively notified only the nodes with a copy of the invalidated granules

Under the CA approach, the obsolete granules are detected at the granule access time by a transaction. We assume that the coherency control function is integrated with the CC manager/controller [DIAS89] which not only provides the traditional concurrency control ser- vice, but also tracks which node has a valid copy of a granule. The lock table entry can contain an additional valid bit for each node to indicate whether it has a valid copy. Before accessing any granule, the processing node of the transaction makes a lock request to the integrated CC manager. In response, the integrated CC manager returns not only the requested lock, but also the result of the associated buffer validation check based on the valid bit. Note that if the valid bit is off, it will be turned on after the status of the valid bit is returned as invalidation has now been accomplished. At the lock release time, if the granule has been updated, the valid bits of all other nodes except the updating node (which is the only node with an up-to-date version

of that granule) will be turned off. The CA scheme certainly saves the overhead of sending

immediate notification of invalidated granules, but it also reduces the buffer hit probability as

the obsolete granules continue to reside in the local buffer.

We consider the case of a homogeneous multi-node environment where the access pattem

to the database is the same from all nodes. Generalization to the case where each node has its

own affinity data set which is accessed less often by others can be found in [DAN92B,

DAN93A,B].

Since the multi-node is assumed to be homogeneous, we focus our attention to a single

buffer. We first look at the buffer hit probability under the detection oriented approach (CA),

which is more difficult to analyze as both valid and invalid granules are mixed together in the

buffer, based on the approach in [DAN93B]. To estimate the steady state probability of buffer

hit, we first derive the average number of valid granules of each partition in the local buffer of

any node. Let E(j) denote the average number of valid granules of partition i in the top j lo-

cations of the LRU stack. Therefore, the buffer hit probability of the i-th partition is

I~ = V~(B)I(~,L), and the overall buffer hit probability for a granule requested by a transaction is

estimated as

M W" = Y_~A i = 1

(5.1)

Let p~(j) be the probability that the j-th buffer location from the top of the LRU stack contains

a granule of partition i. Let pr(j) be the probability that the granule is valid given that the granule

belongs to the i-th partition. Then,

v,q) = ~p,( t)p~ (t). 1=

(5.2)

Also, let Y~(j)denote the average number of (both valid and invalid) granules of partition i in the

top j locations of the LRU stack. Then,

J

ritj) = ~p,(/). 1 =!

(5.3)

We will set up a recursive formulation to determine p,fj+ 1) and p?(j+ 1) for j > 1 given

p~(l) and pr(l) for l = 1,...d. Consider a smaller buffer consisting of the top j locations only. The

buffer location ( j + 1) receives the granule that is pushed down from location j. Let r~(j)be the

rate at which granules of partition i are pushed down from location j. Similarly, let rr(j) be the

Let H ~ be the buffer hit probabilities under IN. Hb' can be estimated in a similar way as H c" by setting the push down rate, ~(]), in Equation (5.4) as the difference of miss rate and in- validation rate (buffer purge rate).

r,{]) =/~/L~(1 -- ~Yz{]). ) -- t^ "N -- 1)~Laip^ u Yi(])[3iL (5.8)

(Note that there are no invalid granules under IN.) Together with Equations (5.6) and (5.3), it can be solved iteratively with the initial condition of p,(1) = ~. Hence,

M t f i = ~ ~Yi(B)/(~iL). i = 1

It was found in [DAN93B] that the difference in buffer hit probabilities between CA and IN to be very sensitive to the data access pattern. For skewed data accesses, the difference tends to be small, as under IN the immediate identification of invalidated granules for buffer reuse results mainly in more cold granules being buffered. In the presence of invalidation effect, as the buffer increases, a saturation point on buffer hit probability will be reached even under IN. This occurs at the point where the replacement rate is zero, i.e., at a buffer size of L/(1 + ( N - 1)p ~) as can be derived from (5.8). Furthermore, from (5.8), it can be shown that the buffer hit probability at this point is roughly 1/(1 + ( N - 1)p ~) for each partition, cold or hot. This upper limit on buffer hit probability is independent of the access pattern, uniform or skew. This is in contrast to the single node case where with sufficient buffer, the buffer hit probability can go to one.

6. Extensions on Buffer Modeling

6.1 Lock Retention, Deferred Writes, and Remote Caching

The buffer modelling methodology can be extended to study various other buffer related issues. In a single node environment, deferred write policy, where the dirty granules are not forced to disk at commit time, is often used to save write IO's as in IBM DB2. The number of write IO's is reduced if a granule can get multiple updates from different transactions before it is flushed out from the buffer and written to disks. The write IO rate under the deferred write policy can be determined by the rate that dirty granules are flushed out from the buffer, i.e. the dirty fraction M of Y r~v(B). The write I/O reduction can be analyzed by extending the above methodology to /= distinguish between clean and dirty granules [DAN93A].

The two principles on conservation of flow and relative push down rate still hold for the dirty (respectively, the clean) granules of each partition. However, there is an additional com- plexity. Consider the CA (similarly for the IN) scheme. In the previous section, Equations (5.2)-(5.7) form a set of forward recurrence relations. This is due to the fact that in Equation

(5.5) for the conservation of flow, only the content in the top stack j positions matters. This

is referred to as the substack decomposable property in [DAN92B]. However, if we apply the

conservation of flow to the dirty pages of partition i, the first term on the right hand side of

Equation (5.5) is no longer the miss probability at the top j stack positions. Instead, it is now

the probability that the remaining stack positions (from location j + 1 to B) containing the dirty

granule requested. (In the previous section, we only need to know that the requested granule

is missing from the top substack. Now the fact that the requested granule is missing from the

top substack does not imply that a dirty granule would be brought to the top of the stack. This

can only occur if the requested granule is already present in the bottom portion of the buffer and

is dirty.) We thus lose the substack decomposable property. This makes the recurrence relations

more complex to solve.

In a multi-node environment, the delaying propagation of dirty granules to disks or server

nodes can cause coherency problem for other nodes trying to access these dirty granules. This

problem can be solved via lock retention on dirty granules where locks are continued to be held

after commit by the buffering node as long as the granules are in the buffer. The lock manager

can thus identify the node owning the most up-to-date version of a granule and properly direct

a requesting node where to obtain the up-to-date version of a granule. With the ever increasing

gap between memory and disk access times, the concept of remote caching has been pursued

by various researchers [LEFF91, LI89, FRAN92, MOHA91]. Under remote caching, granules

can be directly transferred between buffers. (In essence, the buffers of all the other nodes be-

come another level of the storage hierarchy between local buffer and disks.) Note that although

delaying propagation of dirty granules to disks can improve normal performance, it can prolong

the recovery time upon system failure as all dirty granules need to be derived from the database

log and applied to the database. For the multi-node environment, the recovery process can be

further complicated as log entries from all nodes need to be merged and applied in order, if dirty

granules can be transferred to multiple nodes via the remote caching mechanism before writing

to disks [MOHA91].

Generalizations of the buffer coherency schemes to support lock retention, remote caching

and delayed dirty page propagations have been proposed in [MOHA91, DAN92A,93A] for a

data-sharing like environment and for a client-server like environment in [FRAN92]. The buffer

analysis presented here can be extended to study the performance improvement of these schemes

[DAN92A, DAN93A] and their recovery time trade-offs [DAN93B]. The extension needs to

track the buffer composition in terms of the lock mode held in each buffer location, in addition

to the partition type of a granule. The two principles on conservation of flow and relative push

down rate still hold for granules of each lock mode held, but again we lose the substack de-

composable property.