5
2012, Vol.17 No.2, 109-113 Article ID 1007-1202(2012)02-0109-05 DOI 10.1007/s11859-012-0813-8 A Partition Checkpoint Strategy Based on Data Segment Priority LIANG Ping, LIU Yunsheng School of Computer Science and Technology, Huazhong University of Science and Technology, Wuhan 430074, Hubei, China © Wuhan University and Springer-Verlag Berlin Heidelberg 2012 Abstract: A partition checkpoint strategy based on data segment priority is presented to meet the timing constraints of the data and the transaction in embedded real-time main memory database systems (ERTMMDBS) as well as to reduce the number of the transactions missing their deadlines and the recovery time. The partition checkpoint strategy takes into account the characteristics of the data and the transactions associated with it; moreover, it partitions the database according to the data segment priority and sets the corresponding checkpoint frequency to each partition for independent checkpoint operation. The simulation results show that the partition checkpoint strategy decreases the ratio of trans- actions missing their deadlines. Key words: embedded real-time main memory database systems; database recovery; partition checkpoint; data segment priority CLC number: TP 311.13 Received date: 2011-08-20 Foundation item: Supported by the National Natural Science Foundation of China (60673128) Biography: LIANG Ping, female, Ph.D. candidate, research direction: real-time database, mobile database, etc. E-mail: [email protected] 0 Introduction Because the data and the transaction in Embedded Real-time Main Memory Database Systems (ERTMMDBS) have the timing constraints, when the system fails, many transactions may miss their deadlines and a large number of real-time data may lose their effectiveness before it can be used. Therefore, the effective crash recovery mechanism is very important to the system performance. Checkpoint is a critical part of the recovery mechanism, and its efficiency will influence the overall system per- formance directly. The checkpoint strategy of ERTMMDBS should be able to use the characteristics of data to process appro- priately to meet the real-time property of the system since the data of ERTMMDBS have different character- istics. Besides, the checkpoint should not affect the nor- mal execution of system transactions. There are many researches on checkpoint strategy of main memory data- bases [1-7] in recent years. However, those researches only concentrate on the volatile property of main memory on failure without considering the timing constraint of the data and the transactions in real-time environment, so they are not suitable for ERTMMDBS. Only a few re- searches on checkpoint strategy of ERTMMDBS appear recently, for example, the partition checkpoint strategy in Refs. [8,9] use different partition checkpoint operation in accordance with different types of data to reduce the re- covery time. It only considers a single characteristic of data such as update frequency and validity interval; however, the multiple characteristics of data and the timing constraints of the transactions are not taken into consideration.

A partition checkpoint strategy based on data segment priority

Embed Size (px)

Citation preview

Page 1: A partition checkpoint strategy based on data segment priority

2012, Vol.17 No.2, 109-113

Article ID 1007-1202(2012)02-0109-05

DOI 10.1007/s11859-012-0813-8

A Partition Checkpoint Strategy Based on Data Segment Priority

□ LIANG Ping, LIU Yunsheng

School of Computer Science and Technology, Huazhong

University of Science and Technology, Wuhan 430074, Hubei,

China

© Wuhan University and Springer-Verlag Berlin Heidelberg 2012

Abstract: A partition checkpoint strategy based on data segment priority is presented to meet the timing constraints of the data and the transaction in embedded real-time main memory database systems (ERTMMDBS) as well as to reduce the number of the transactions missing their deadlines and the recovery time. The partition checkpoint strategy takes into account the characteristics of the data and the transactions associated with it; moreover, it partitions the database according to the data segment priority and sets the corresponding checkpoint frequency to each partition for independent checkpoint operation. The simulation results show that the partition checkpoint strategy decreases the ratio of trans-actions missing their deadlines. Key words: embedded real-time main memory database systems; database recovery; partition checkpoint; data segment priority CLC number: TP 311.13

Received date: 2011-08-20 Foundation item: Supported by the National Natural Science Foundation of China (60673128) Biography: LIANG Ping, female, Ph.D. candidate, research direction: real-time database, mobile database, etc. E-mail: [email protected]

0 Introduction

Because the data and the transaction in Embedded Real-time Main Memory Database Systems (ERTMMDBS) have the timing constraints, when the system fails, many transactions may miss their deadlines and a large number of real-time data may lose their effectiveness before it can be used. Therefore, the effective crash recovery mechanism is very important to the system performance. Checkpoint is a critical part of the recovery mechanism, and its efficiency will influence the overall system per-formance directly.

The checkpoint strategy of ERTMMDBS should be able to use the characteristics of data to process appro-priately to meet the real-time property of the system since the data of ERTMMDBS have different character-istics. Besides, the checkpoint should not affect the nor-mal execution of system transactions. There are many researches on checkpoint strategy of main memory data-bases[1-7] in recent years. However, those researches only concentrate on the volatile property of main memory on failure without considering the timing constraint of the data and the transactions in real-time environment, so they are not suitable for ERTMMDBS. Only a few re-searches on checkpoint strategy of ERTMMDBS appear recently, for example, the partition checkpoint strategy in Refs. [8,9] use different partition checkpoint operation in accordance with different types of data to reduce the re-covery time. It only considers a single characteristic of data such as update frequency and validity interval; however, the multiple characteristics of data and the timing constraints of the transactions are not taken into consideration.

Page 2: A partition checkpoint strategy based on data segment priority

Wuhan University Journal of Natural Sciences 2012, Vol.17 No.2 110

Embarking from the different characteristics of the data and the timing constraints of the transactions of ERTMMDBS, a partition checkpoint strategy based on data segment priority is presented to satisfy the recovery requirements of ERTMMDBS, which takes account of the various characteristics of the data and the features of the corresponding transactions.

1 Partition Method Based on Data Segment Priority

As embedded real-time data have different charac-teristics, the crash recovery of ERTMMDBS should con-sider them comprehensively. For checkpoint strategy, the following aspects should be concentrated on data seg-ment flushing:

● Low validity interval temporal data need not flush to archive memory (AM) and no logging will be invoked, which not only reduces the interference of logging and flushing activities on normal operations but also hastens the recovery process.

● Relatively short validity interval temporal data should be flushed to AM as soon as possible. This en-sures the validity of many temporal data.

● Critical data should be flushed to AM prior to other data. This satisfies the deadlines of the critical transactions that access the critical data.

● Data with higher update frequency will be flushed to AM more often so that the time for log processing on crash recovery can be reduced.

● Data accessed by transactions with higher priority should be flushed to AM prior to other data. This makes more transactions with higher priority satisfying their deadlines.

Based on the basic idea of partition-segment main memory organization architecture of the main memory databases[10], our checkpoint strategy uses data segment as a unit and set a priority for each data segment in terms of the different characteristics of data included in the data segment. This priority represents the flushing se-quence of the data segment during the checkpoint opera-tion, that is to say, data segment with higher priority will be flushed prior to data segment with lower priority. It is assumed that embedded real-time main memory database DB consists of n data segments, and Si is the data seg-ment i, namely, DB={Si|1≤ i≤ n}. P(Si) represents the flushing priority of data segment Si. If the minimum va-lidity interval of the data in Si is smaller than the mini-

mum average time of transaction accessing the such data once, or there is no update on data in Si, then P(Si)=0 or else P(Si) is calculated by using the following formula:

( )

( / ( )) ( ) ( ) ( )i

v i i F i C i H

P S =

W V S F S W C S W H S W+ × + × + ×

(1) where V(Si) represents the minimum validity interval of the data in Si; F(Si) represents the sum of the update fre-quency of the data in Si; C(Si) represents the maximum of the criticality of the data in Si; H(Si) represents the highest priority of the transaction accessing the data in Si; and WV, WF, WC, and WH represent the weight of V(Si), F(Si), C(Si) and H(Si), respectively, which can be set ac-cording to system requirements. Formula (1) denotes that the shorter the validity interval of the data in data seg-ment is, the higher the flushing priority of data segment is; the higher the update frequency of the data in data segment is, the higher the flushing priority of data seg-ment is; the higher the criticality of the data in data seg-ment is, the higher the flushing priority of data segment is.

On the basis of above set method, the following partitioning scheme is proposed to partition the data segments into different logical partitions in accordance with their flushing priorities.

Suppose DB is partitioned into n partitions accord-ing to data segment flushing priority. The length of each partition is D. The number of partitions and the length of each partition can be chosen randomly and the reason of each partition having the same length is just for clarity. Firstly, when partition Si is updated, formula (1) is used to calculate the P(Si) of partition Si. If P(Si)=0, which denotes that Si need not to be flushed, then Si will not add to any partition. If P(Si) ∨ 0, then the partition number j of Si is generated as follows: calculating ( ) /iP S D , if

( ) / ,iP S D n ∧ then ( ) /ij P S D= or else j n= . Secondly, decisions will be made, which partition Si should be added to. If Si is not in any partition, namely a new update partition, then add Si to partition j; if Si is in a partition, which denotes that its priority is changed and the partition that it belongs to should adjust accordingly. After adjusting, the new partition number is gotten and Si is added to this partition. The reason of adjusting the par-tition is that our checkpoint using the fuzzy checkpoint scheme, which permits checkpoint and transaction exe-cuting concurrently; therefore, Si may be updated during the checkpoint operation and the partition it belongs to will be changed. How to adjust the partition will be de-

Page 3: A partition checkpoint strategy based on data segment priority

LIANG Ping et al : A Partition Checkpoint Strategy Based on Data …

111

scribed in later sections. In accordance with the above partitioning scheme,

the flushing priorities of data segments in one partition are close to each other. Therefore, different checkpoint frequency can be given to each partition to flush the par-titions in terms of the different characteristics of data in data segment during the checkpoint operation.

2 Partition Checkpoint Strategy

In our partition checkpoint strategy, the partition with higher flushing priority is given the higher check-point frequency and the partition with lower flushing priority is given the lower checkpoint frequency. Let D be the length of partition and n be the number of parti-tions the DB has. ACP

iP is the average checkpoint prior-ity of partition i and it can be calculated as follows:

ACP (1 (2 1) ) / 2,1iP i D i n= + − × ≤ ∧ (2)

The checkpoint frequency of partition i denoted as CKPiF

is calculated as follows accordingly with ACPiP :

CKP ACP ACP

1

n

i i ii

F P P n=

= ×

(3)

The objective of formula (3) is to guarantee that if ACP ACP

i jP P∨ , then CKP CKPi jF F∨ . Besides, the value of

CKPiF should reflect the relative average checkpoint pri-

ority of partition i and enable each partition to be check-pointed at least once in a limited period of time. This avoids the starvation problem in which some partitions may never have a chance to be checkpointed.

The algorithm of the partition checkpoint strategy based on data segment priority is described as follows:

Procedure SPPCS() Input: n is the number of partitions of DB, and D is

the length of partition Output: Step 1 Calculate ACP

iP of each partition in terms of formula (2).

Step 2 Calculate ACPiF of each partition in terms

of formula (3). Step 3 Log checkpoint begin record to global

checkpoint log. Step 4 Find a partition i, which has the highest

checkpoint frequency among n partitions, that is, CKP CKP , 1,2, , 1, 1, ,i jF F j i i n= − + ∨ ;

Step 5 Flush the data segments of partition i to AM sequentially, that is, perform a local checkpoint on partition i.

Step 6 Set CKP CKP 1i iF F= − , that is, decrease the

checkpoint frequency of partition i. Step 7 Check that if there exists a partition i such

that CKP 0 (1 )iF i n≤ ≤∨ , then go to Step 4; Otherwise, go to Step 8;

Step 8 Log checkpoint end record to global checkpoint log, that is, all partitions have finished their local checkpoint and global checkpoint ends.

3 Adjustment of Data Segment Partition

As checkpoint operation should not impact the normal execution of transactions in ERTMMDBS, our partition checkpoint strategy uses the fuzzy checkpoint scheme. This causes the changing in partition of data segment if there is an update on data segment. That is to say, the priority of data segment is increased due to the update on it, and the partition of data segment it belongs to may change to a partition with higher priority. If this partition with higher priority has finished its local checkpoint operation, then the updated data segment may be not flushed to AM in the period of the global check-point operation because the global checkpoint is exe-cuted in descending sequences of the priorities of parti-tions. This cannot guarantee the integrity of global checkpoint. Therefore, when partition of the updated data segment it belongs to is changed during the global checkpoint operation, this updated data segment cannot be added to the partition that finishes its local checkpoint, but it should be added to the partition that will execute local checkpoint next to partition executing local check-point currently, that is, the partition with the highest pri-ority currently. Therefore, the integrity of global check-point is guaranteed. The adjusting process of partition of data segment is shown in Fig. 1.

It is found in Fig. 1 that when the partition number of the data segment that is dirty at the beginning of global checkpoint is changed from i to j, if j is less than the parti-tion number C, which indicates the partition executing local checkpoint currently, then the data segment will be added to partition j; otherwise, it will be added to partition

1C − . Therefore, the adjustment scheme for partition of data segment is as follows: in the period of database global checkpoint, if the partition number of the data seg-ment that is dirty at the beginning of global checkpoint is changed, it is only needed to adjust the partition accord-ingly with the adjusting process in Fig. 1, then the data-base global checkpoint will be integrated.

Page 4: A partition checkpoint strategy based on data segment priority

Wuhan University Journal of Natural Sciences 2012, Vol.17 No.2 112

Fig. 1 Adjusting process of partition of data segment

4 Performance Test and Evaluation

The ERTMMDBS ARTs-EDB is used as a simulation model to test the performance of our partition checkpoint scheme based on data segment priority (PCS-DSP). The primary performance metric is the percentage of transac-tions missing their deadlines, which is denoted as TMDP. Simulation experiments include two sets of experiments: the impact on TMDP with different transaction arrival rate of PCS-DSP, conventional fuzzy checkpoint strategy (CFCS), and update frequency valid interval partition checkpoint strategy (UFVIPCS) in Ref. [9]; and the impact on TMDP with

different number of partitions of PCS-DSP. The parameters for the simulation experiments are

summarized in Table 1. The parameter FSlack corresponds to slack factor of transactions, which is usually a uni-formly distributed random variable. U(i,j) denotes a uni-formly distributed random variable in range [i,j]. The deadline of transaction T is calculated as follows:

Slack( ) ( ) (1 ) ( )A ED T T T F T T= + + × (4)

where D(T) is the arrival time of T and TE(T) is the esti-mated execution time of T, which is estimated as follows:

OP AOP( )ET T N T= × (5)

where NOP is the number of operations in one transaction and TAOP is the average execution time of one operation, respectively.

Table 1 Simulation experiment parameters

Parameter Setting value Meaning

MDBSize 2000 pages Main memory database size

VDataPer/% 45 Percentage of temporal data

IVDataPer/% 55 Percentage of non-temporal data

LVIDataPer/% 15 Percentage of low validity interval temporal data

PartitionNumber [1,10] The number of partitions

TAOP/ms 0.5 Average execution time of one operation

ProbUpdate/% 40 Probability that an operation is an update

FSlack U(4,8) Slack factor of transaction

NOP U(5,10) The number of operations in one transaction

ArrivalRate [30,80] Arrival rate of transaction

Page 5: A partition checkpoint strategy based on data segment priority

LIANG Ping et al : A Partition Checkpoint Strategy Based on Data …

113

Figure 2 shows that TMDP of all strategies in-creases with the increasing of transactions arrival rate, but PCS-DSP has the best performance. This is because data is partitioned according to its data segment priority, which considers the timing constraints of data and its corresponding transactions, and it makes partitioning scheme reasonable and flexible.

Fig. 2 Impact on TMDP of different checkpoint strategies with different transaction arrival rate

Figure 3 shows that the greater the number of parti-tions is, the smaller the impact on TMDP with PCS-DSP is. However, the more partitions the database has, the more overhead on normal system operations it incurs. When the number of partitions reaches a certain limit, the benefit obtained from further partitioning is not very significant. In Fig. 3, when the number of partitions reaches 8, for example, TMDP is not improved obvi-ously as the number of partitions increases to 10.

Fig. 3 Impact on TMDP with different number of partitions of PCS-DSP

5 Conclusion

A partition checkpoint strategy based on data seg-ment priority is presented to reduce the number of trans-actions missing their deadlines and the crash recovery time. The results of simulation experiments show that our partition checkpoint strategy decreases the ratio of transactions missing their deadlines and has better sys-tem performance.

With the development of mobile communication technology and the emergence of a variety of small

computing devices, the application requirements of ERTMMDBS in mobile environments increase unceas-ingly. The checkpoint strategy of ERTMMDBS in mo-bile environments will be our next researches.

[1] Lehman T J, Carey M J. A recovery algorithm for a high per-

formance memory-resident database system [C]//Proceedings

of the 1987 ACM SIGMOD International Conference on Man-

agement of Data. New York: ACM Press, 1987: 104-117.

[2] Hagmann R B. A crash recovery scheme for a mem-

ory-resident database system[J]. IEEE Transactions on

Computers, 1986, 35 (9): 839-843.

[3] Jagadish H V, Silberschatz A, Sudarshan S. Recovering from

main-memory Lapses[C]//Proceedings of the 19th Interna-

tional Conference on Very Large Data Bases. New York:

ACM Press, 1993: 391-404.

[4] Hu Guolin, Liu Yunsheng, Peng Jiaxiong. The recovery tech-

nique in main memory database system[J]. Journal of

Huazhong University of Science and Technology, 1996,

24(3): 35-38(Ch).

[5] Lee D, Cho H. Checkpointing schemes for fast restart in main

memory database systems[C]//Proceedings of the IEEE Pacific

Rim Conference on Communications, Computers and Signal

Processing. Piscataway, N J: IEEE Press, 1997: 663-668.

[6] Lin J L, Dunham M H. Segmented fuzzy checkpointing for

main memory databases[C]//Proceedings of the ACM Sym-

posium on Applied Computing. New York: ACM Press,

1996: 158-165.

[7] Qin X P, Cao W, Wang S. Simulation of main memory da-

tabase parallel recovery[C]//Proceedings of Spring Simula-

tion Multiconference. New York: ACM Press, 2009: 103.

[8] Gruenwald L, Huang J. Crash recovery for real-time main

memory database systems[C]//Proceedings of the 1996 ACM

Symposium on Applied Computing. New York: ACM Press,

1996: 145-149.

[9] Huang J, Gruenwald L. An update-frequency-valid-interval

partition checkpoint technique for real-time main memory

databases[C]//Proceedings of the 1st International Workshop

on Real-Time Databases:Issues and Applications. New York:

ACM Press, 1996: 130-137.

[10] Liu Y S, Fu W. Main memory database organization and

recovery techniques in active real-time database systems[J].

Computer Engineering and Applications, 2002, 38(9):

170-172(Ch).

References