[ieee 2010 international conference on machine vision and human-machine interface - kaifeng, china...

3
Research on the Improvement of the Concurrency Control Protocol for Real- time Transactions Wu Peng Computer Center Henan University Kaifeng, China [email protected] Pang Zilong Computer Center Henan University Kaifeng, China [email protected] Abstract—The traditional lock-based concurrency control mechanism which focuses on the data’s consistency and the transactions’ concurrency cannot meet the demand that the real-time database systems make on the temporal consistency. After the improvement of the concurrency control protocol for real-time transactions, this paper will present a new concurrency control method which is based on the locking, multi-version and valid confirmation concurrency control mechanisms. This method can adopt different concurrency control mechanisms according to the idiographic situation. In this way it can effectively improve the concurrency of transactions and increase the amount of the transactions completed within the deadline. The feasible analysis denotes that this new method is better than the traditional one on performance Keywords-Real-time transaction; Deadline; Concurrency control I. INTRODUCTION The Real-time database systems (RTDBS) have shown the timing constraint of both data and transactions. The correctness of the systems depends not only on the logical results, but also on the time used to produce these results. Because the transaction for concurrent implementation has its own timing constraint and dependence, the Systems are mainly to ensure that more transactions can be completed within the deadline. The traditional lock-based pessimistic concurrency control mechanisms -- two phase locking protocol of a high priority (2PL-HP) can guarantee the transactions serializable, so as to powerfully guarantee the consistency of data. However, because of a high rate of restart of transactions, it cannot satisfy the need of the real- time database systems very well. Whereas the optimistic concurrency control mechanism believes that the probability of any two concurrent transactions requesting the same database is seldom. And all operations can be directly performed when transactions request which must go through the valid conformation before they are allowed to be submitted [1]. The Multi-version Concurrency Control Protocol is one kind of the optimistic concurrency control mechanisms which makes the transaction has a large degree of concurrency by maintaining multiple versions of data items. So it is more suitable for real-time database systems where the transaction has a low rate of restart and delay of cut-off time but a high degree of concurrency. However, when it comes to ensuring transactions serializable, the mechanism of valid conformation is less simple and less straightforward than the blockade mechanism [2]. After the improvement of the concurrency control protocol, this paper will present a new concurrency control method which is based on the locking, multi-version and valid confirmation concurrency control mechanisms. This method can adopt different concurrency control mechanisms according to the idiographic situation. In this way it can effectively improve the concurrency of transactions and increase the amount of the transactions completed within the deadline. The feasible analysis denotes that this new method is better than the traditional one on performance. II. THE ANALYSIS OF REAL-TIME TRANSACTION In the multi-version systems of the real-time database, the real-time transactions can be divided into three categories according to the multi-version concurrency control mechanism: Read-only Transaction (T r ): Always read the data elements that is the maximum timestamp with a less than or equal T r in timestamp TS (T r ). In other words, the read-only transaction reads the most recent version of the data before it, so reading-reading conflict or the reading-writing conflict will not happen. T r never fails. Write-only Transaction (T w ): The old data elements are not modified. But a new version of data elements will be created which is given by T w as timestamp TS (T w ). So writing-writing conflict will not happen and T w will not be blocked by other transactions. Data-processing Transaction (T p ): It not only reads the data elements, but also writes a new version of data elements. So writing- writing conflict between T p s is likely to happen [1]. From the above analysis we can see that in the multi- version systems of real-time database writing-writing conflict between the data-processing transactions must be effectively resolved in order to improve the system’s performance. This leads to propose a new concurrency control mechanism. This mechanism uses the concurrency control methods of combining the optimistic multi-version, valid confirmation of transaction and the pessimistic blockade so as to increase the rate of success of the transaction under the condition of strict time limit. III. THE DESCRIPTION OF THE NEW METHOD After the usage of the new method, T r , T w will not fail. The resolusion of the conflicts among transactions in T p will be based on the following principles. 2010 International Conference on Machine Vision and Human-machine Interface 978-0-7695-4009-2/10 $26.00 © 2010 IEEE DOI 10.1109/MVHI.2010.119 146

Upload: pang

Post on 09-Feb-2017

214 views

Category:

Documents


2 download

TRANSCRIPT

Research on the Improvement of the Concurrency Control Protocol for Real-

time Transactions

Wu Peng

Computer Center

Henan University

Kaifeng, China

[email protected]

Pang Zilong

Computer Center

Henan University

Kaifeng, China

[email protected]

Abstract—The traditional lock-based concurrency control

mechanism which focuses on the data’s consistency and the

transactions’ concurrency cannot meet the demand that the

real-time database systems make on the temporal

consistency. After the improvement of the concurrency

control protocol for real-time transactions, this paper will

present a new concurrency control method which is based on

the locking, multi-version and valid confirmation

concurrency control mechanisms. This method can adopt

different concurrency control mechanisms according to the

idiographic situation. In this way it can effectively improve

the concurrency of transactions and increase the amount of

the transactions completed within the deadline. The feasible

analysis denotes that this new method is better than the

traditional one on performance.... Keywords-Real-time transaction; Deadline; Concurrency

control

I. INTRODUCTION

The Real-time database systems (RTDBS) have shown the timing constraint of both data and transactions. The correctness of the systems depends not only on the logical results, but also on the time used to produce these results. Because the transaction for concurrent implementation has its own timing constraint and dependence, the Systems are mainly to ensure that more transactions can be completed within the deadline. The traditional lock-based pessimistic concurrency control mechanisms -- two phase locking protocol of a high priority (2PL-HP) can guarantee the transactions serializable, so as to powerfully guarantee the consistency of data. However, because of a high rate of restart of transactions, it cannot satisfy the need of the real-time database systems very well. Whereas the optimistic concurrency control mechanism believes that the probability of any two concurrent transactions requesting the same database is seldom. And all operations can be directly performed when transactions request which must go through the valid conformation before they are allowed to be submitted [1]. The Multi-version Concurrency Control Protocol is one kind of the optimistic concurrency control mechanisms which makes the transaction has a large degree of concurrency by maintaining multiple versions of data items. So it is more suitable for real-time database systems where the transaction has a low rate of restart and delay of cut-off time but a high degree of concurrency. However, when it comes to ensuring transactions serializable, the mechanism of valid

conformation is less simple and less straightforward than the blockade mechanism [2]. After the improvement of the concurrency control protocol, this paper will present a new concurrency control method which is based on the locking, multi-version and valid confirmation concurrency control mechanisms. This method can adopt different concurrency control mechanisms according to the idiographic situation. In this way it can effectively improve the concurrency of transactions and increase the amount of the transactions completed within the deadline. The feasible analysis denotes that this new method is better than the traditional one on performance.

II. THE ANALYSIS OF REAL-TIME TRANSACTION

In the multi-version systems of the real-time database, the real-time transactions can be divided into three categories according to the multi-version concurrency control mechanism: Read-only Transaction (Tr): Always read the data elements that is the maximum timestamp with a less than or equal Tr in timestamp TS (Tr). In other words, the read-only transaction reads the most recent version of the data before it, so reading-reading conflict or the reading-writing conflict will not happen. Tr never fails. Write-only Transaction (Tw): The old data elements are not modified. But a new version of data elements will be created which is given by Tw as timestamp TS (Tw). So writing-writing conflict will not happen and Tw will not be blocked by other transactions. Data-processing Transaction (Tp): It not only reads the data elements, but also writes a new version of data elements. So writing-writing conflict between Tps is likely to happen [1].

From the above analysis we can see that in the multi-version systems of real-time database writing-writing conflict between the data-processing transactions must be effectively resolved in order to improve the system’s performance. This leads to propose a new concurrency control mechanism. This mechanism uses the concurrency control methods of combining the optimistic multi-version, valid confirmation of transaction and the pessimistic blockade so as to increase the rate of success of the transaction under the condition of strict time limit.

III. THE DESCRIPTION OF THE NEW METHOD

After the usage of the new method, Tr, Tw will not fail. The resolusion of the conflicts among transactions in Tp will be based on the following principles.

2010 International Conference on Machine Vision and Human-machine Interface

978-0-7695-4009-2/10 $26.00 © 2010 IEEE

DOI 10.1109/MVHI.2010.119

146

In multi-version systems of real-time database, the transaction priority P(T) is mainly determined by

Deadline(T), that is, TTT ∈∀ 21 , , located Deadline(T1)>=Deadline(T2), then P(T1)<=P(T2), the high-priority transaction will gain the priority of implementation; order d on behalf of data elements of the conflict,

pji TTT ∈∀ , , P(Ti)<P(Tj), Ti, Tj in the conflict of d,

then Ti, Tj will be in the following manner: (1) Ti, Tj can deal with the different data items d

without disturbing each other, then d will be divided into smaller data items, change the block size of data, and allow low-priority transaction to inherit high-priority

transaction’s priority, and assume P(Ti)= P(Tj) which

makes that Ti, Tj can perform simultaneously with helping each other. Of course, this approach may have some errors, so these errors must be calculated before the submitting phrase, if they are in the permitting extent in systems of the real-time database to generate a new version of data items and set d’s timestamp by the final submission of the transaction. This method can effectively reduce the blocking time in the conflict of the low-priority transaction and the rate of restart in reducing the transaction.

(2) d has the atomicity which can not be divided further, Ti, Tj are likely to have conflicts and if using the optimistic mechanism of the valid confirmation, the rollback of transaction is almost inevitable, so in this case blockade mechanism is still used to save resources, and at the same time, the traditional 2PL-HP’s means (PS) of resolving conflicts have to cause low-priority transactions to restart, which will make the number of transactions for delaying deadline increase. Therefore, according to the mechanisms of valid confirmation improvements will be made as follows:

In real-time database systems, ExecutionTime(T) of transaction is predictable. When the requested data is

possessed by Ti, P(Ti)<P(Tj), instead of immediate restart of Ti, first of all weigh the conditions before making a decision:

DeadTime=min(Deadline(Ti), Deadline(Tj));// Order DeadTime as the less one between Deadline(Ti) and Deadline(Tj);

If ((Current time + Ti’s remained time of the execution + ExecutionTime(Tj) ) < DeadTime)

Then { P(Ti)=P(Tj); // Low-priority transaction inherits the

priority of high-priority one, which improves Ti’s priority, thus accelerating their implementation;

Implementation of the Ti comes to the end; // Tj waits for Ti’s completion and the release of the lock on d; Tj obtains the lock on d and starts the implementation

until the completion; } Else if ((current time + Ti’s remained time of the execution

+ ExecutionTime(Tj)) <Deadline(Ti)&& Deadline(Ti)>

Deadline(Tj)) then { Ti dies; // Ti releases the lock on d;

Tj obtains the lock on d and starts the implementation until the completion; // Ti waits for Tj’s completion and the release of the lock on d; Ti obtains the lock on d and starts the implementation

until the completion; } else // Abandon the blockade mechanism, adopt the

mechanism of valid confirmation in order to maximize the number of transactions completed within the deadline

{ Ti dies; // Ti releases the lock on d; Start Tj’s implementation; // There is no data locked

any longer Start Ti’s implementation; // Tj, Ti simultaneously start

implementation; If Tj finds the risk when validity is confirmed then { Ti dies; // Finding the risk, unconditionally put an end

to low-priority transactions to ensure that high-priority transactions can be successfully implemented;

Complete Tj; } else { Complete Tj; Complete Ti; // Operations of Ti, Tj's reading and

writing can just performed in time to a serial implementation, which can be successfully completed by the valid conformation;

} Endif } Endif Endif As for the transactions’ conflicts between data

elements which can not be further divided, if the order of the implementation of transactions can still meet the need of their deadline, the priority-inheritance mechanism can be used without changing the order of the implementation of transactions , then use the blockade mechanism to make transactions serialized to save the expense, or abandon the blockade mechanism to use the mechanism of valid conformation so as to minimize the rate of transactions’ delaying deadline.

IV. THE ANALYSIS OF PERFORMANCE

Through the testing comparison between the new and traditional methods, figure 1 shows how transaction’s different inter-arrival time effects the transaction’s restart. From the figure we can see, as the interval increases, the rate of restart becomes small due to the less opportunity of conflicts. But when the interval is not long, the new method is significantly better than traditional one. The performance of real-time database systems has a fundamentally different target compared with the traditional one. The real-time database systems require the number of transactions completed within the deadline for the largest rather than the number of concurrent transaction for execution to maintain the largest [3].

147

Figure 1. The Restart of Transaction(The number of transactions is 10).

The new method makes read-only and write-only transactions never fail and avoids their unnecessary restart. It effectively saves the system’s expense and improves the system’s throughput. As for the data-processing transactions, the new method makes the same data elements operate on different data items of the transaction without interfering but collaborating with each other by changing dynamically the data elements of the block size; when it comes to the data elements which can not be divided, according to the idiographic situation this method can adaptively use the blockade mechanism and the mechanisms of valid confirmation for the implementation of the conflicts and create a new version of data elements to improve the concurrency degree of transaction and the amount of transactions completed before deadline. In summary, in different situations the new method can flexibly take advantage of the traditional concurrency control mechanism with multiple versions, blockade, and

valid confirmation, it can improve the concurrency of the system, save effectively the expense of the system. Compared with the traditional concurrency control mechanisms, the improved one is better on performance.

V. CONCLUSION

As the real-time database systems have a strong time constraint for the transactions and data, and the traditional concurrency control mechanisms can not meet their needs very well. After the improvement of the concurrency control protocol, this paper will present a new concurrency control method. With a strong self-adaptability, this method is able to use different concurrency control mechanisms according to different situations. It can also effectively improve the performance of system. The next step is to do further test and evaluation left on the method in the actual environment so as to refine and improve the algorithm.

REFERENCES

[1] Hector Garcia-Molina, Jeffrey D. Ullman, Jennifer Widom. The Implementation of Database System [M]. China Machine Press , 2002:369-377.

[2] Jian-Jun Han, Qing-Hua, Abbas A. Essa. The scheduling algorithms in transactions of Temporal Constraints in the Real-Time Database [J]. Mini-Micro Systems, 2005,26 (7) :1229-1232.

[3] Xiao Mei Yang, YE Xiao-jun. The comparative study on the implementation of concurrency control [J]. Computer Application Research, 2006, (6) :19-22.

148