[summary of the invention]: the objective of the invention is to solve the inefficiency problem of existing database fault recovery method, dynamic restoration methods a kind of suitable distributing real-time data bank, that support the recovery while serving is provided.
The distributing real-time data bank fault recovery method that support provided by the invention recovers while serving, method comprises:
1) the real-time logging mode of integrated subregion daily record of employing and of short duration daily record characteristic: promptly according to the partition strategy of transactions classes, log store is distinguished into corresponding different subregions, the log record of the affairs that belong to a different category is respectively stored in different daily record subregions.Log record is not preserved lastingly simultaneously, and in local fuzzy checkpoint implementation, some useless log records are deleted.
2) tissue of storage medium: the storage medium of each website is divided into three layers: magnetic disk memory, non-volatile RAM, easily lose RAM (main memory); Local external memory database (LSDB) is stored in the magnetic disk memory; Non-volatile RAM is as the log store district, and corresponding to standardization graduation σ (σ is defined in hereinafter and specifically provides), whole log store district is divided into four independently sub-log area; Local memory database (LMDB) is stored in the volatibility main memory, and is divided into two independent partitions: critical data subregion and general data subregion are used for storing respectively critical data class and general data class;
3) carry out the adjustable Fuzzy Test dot pattern of frequency dynamic: adopting the Fuzzy Test dot pattern, on check point triggering opportunity, be not the periodic triggers strategy that adopts Fixed Time Interval, but (brief note is R according to log store district space utilization rate
LU) whether arrive preset threshold α and determine whether triggering check point.Work as R
LUGreater than α, the check point execution that is triggered.The initial value of α can preestablish according to the requirement of using, and can dynamically adjust the frequency that check point is carried out by the value of revising α in system's operational process.
4) dynamic recovery policy: in the recovery processing procedure after website breaks down, adopted the dynamic recovery processing policy that recovers thought based on classification, its key feature is: the critical data class is at first recovered, before recovering the general data class, recover the website service, recover the general data class then while serving, to reduce the time that the fault website stops to serve to greatest extent.Dynamically recovery policy specifically comprises the steps:
1. the main memory corresponding data subregion of from local external memory database (LSDB), the critical data class being packed into, local memory database (LMDB);
2. eliminate the control affairs of dying young belong to crucial transactions classes causes the external world is changed, and the critical data class is returned to nearest coherency state;
3. recover the service of fault website;
4. the main memory corresponding data subregion of from local external memory database (LSDB), the general data class being packed into;
5. eliminate the control affairs of dying young belong to general transactions classes causes the external world is changed, and the general data class is returned to nearest coherency state.
---said method 1) in the graduation method in log store district as follows:
1) at first affairs S set T is divided into two subclass: ST by affairs priority
>p={ T
i| Pr (T
i)>p, T
i∈ ST} and ST
<=p={ T
i| Pr (T
i)≤p, T
i∈ ST}, here, Pr (T
i) expression affairs T
iPriority; Obviously, { ST
>p, ST
<=pIt is the graduation of ST;
2), make DS (ST by suitable adjustment p value
>p) ∩ DS (ST
<=p)=, i.e. { ST
>p, ST
<=pIt is the quadrature graduation of ST; Wherein, DS (ST
>p) for belonging to ST
>pIn the set of data object of high priority office access, claim DS (ST
>p) be the critical data class, claim ST
>pBe crucial transactions classes; DS (ST
<=p) for belonging to ST
<=pIn the set of data object of low priority office access, be called the general data class, claim ST
<=pBe general transactions classes;
3) further, with ST
>pBe divided into two or more subclass: ST
>p,>f={ T
i| Fr (T
i)>f, T
i∈ ST
>pAnd ST
>p,<=f={ T
i| Fr (T
i)≤f, T
i∈ ST
>p, here, Fr (T
i) represent T
iEstimation carry out frequency, f is a frequency values of setting, obviously, { ST
>p,>f, ST
>p,<=fBe ST
>pA graduation; Similarly, with ST
<=pBe divided into two or more subclass: ST
<=p,>f={ T
i| Fr (T
i)>f, T
i∈ ST
<=pAnd ST
<=p,<=f={ T
i| Fr (T
i)≤f, T
i∈ ST
<=p, obviously, { ST
<=p,>f, ST
<=p,<=fBe ST
>pA graduation;
4) make σ={ ST
>p,>f, ST
>p,<=f, ST
<=p,>f, ST
<=p,<=f, then (according to theorem 1) σ is a standardization graduation.
5) corresponding to standardization graduation σ, whole log store district is divided into four independently sub-log area: the sub-log area of crucial high frequency transactions classes, the sub-log area of crucial low frequency transactions classes, the general sub-log area of high frequency transactions classes and the general sub-log area of low frequency transactions classes, brief note is respectively: LS
Ch, LS
Cl, LS
GhAnd LS
Gl, they are used for storing accordingly ST respectively
>p,>f, ST
>p,<=f, ST
<=p,>fAnd ST
<=p,>=fThe log record of transactions classes, i.e. { LS
Ch, LS
Cl, LS
Gh, LS
GlIt is a subregion in the log store district of related standardization graduation σ; With LS
ChAnd LS
ClBe referred to as the key log district; LS
GhAnd LS
GlBe referred to as general log area.
---wherein in real time the type of log record and structure as shown in Figure 1, implication is as follows:
1) in conjunction with real-time committing protocol 1PRCP, designs five kinds of log record types: Begin, Redo, Compensate, Ready and Commit use " B " respectively, " D ", " CP ", " R " and " C " represents, wherein, P-TID represents distributed transaction (global transaction) sign, is defined as: P-TID::=<Cor_Addr, N 〉, here, Cor_Addr represents the coordinator's of distributed transaction the network address; N represents the sequence number of distributed transaction, and at each coordinator's website, N is a monotonically increasing;
2) for local matter, P-TID is changed to NULL; TID is local matter or subtransaction sign, is defined as: TID::=<Addr, SN 〉, here, Addr represents the network address of local matter or subtransaction place website; SN represents the sequence number of local matter or subtransaction, is monotone increasing at each website SN;
3) represent that with TS Redo or Compensate or Commit type log record create logic markers constantly; At each website, the target initial value is changed to 0 during logic, and whenever a Redo or Compensate or Commit log record or check point log record are created, target value increases by 1 during logic;
4) be updated the sign of data object with RID representative, BN represent with local external memory database (LSDB) in the logical block number (LBN) of data block among the corresponding LSDB of data page; AI represents to be updated the back reflection of data object; VTI represents the maximum significant instant of real time data object, be VTI=ST (X)+VI (X), the sampling of ST (X) expression here markers, the time of the external world object of the X correspondence of promptly sampling, the term of validity of VI (X) expression X is promptly counted the time span that V (X) has validity from ST (X); CA represents the pairing compensation activity of control affairs.
---carry out the adjustable Fuzzy Test dot pattern of frequency dynamic
Each website is carried out local fuzzy checkpoint independently; In the check point implementation, the renewal of LMDB is written out to LSDB, simultaneously, deletes useless log record; On check point triggering opportunity, according to space, log store district utilization rate (R
LE) whether arrive preset threshold α and determine whether triggering check point; Work as R
LEGreater than α, the check point execution that is triggered.
When check point was carried out, the check point log record was written into the independent memory space that system distributes for the check point log record in non-volatile ram; The check point log record comprises five parts: check point bit field (CKB), crucial transactions classes are recovered initial markers (CTRST), general transactions classes is recovered initial markers (GTRST), check point markers (CKT) and refresh page territory (UPF); Check point bit field (CKB) is used for representing whether this check point completes successfully, and its value is that 1 expression completes successfully, and is generation systems fault in the 0 expression check point implementation; Scale value when crucial transactions classes need after initial markers (CTRST) the expression fault to recover to carry out the minimum logic of crucial transactions classes of REDO recovery operation, and general transactions classes scale value when need after initial markers (GTRST) the expression fault to recover to carry out the minimum logic of general transactions classes of REDO recovery operation; Logic markers when check point markers (CKT) expression check point is triggered; Refresh page territory (UPF) is provided with the update mode that a updated space (updating bit) writes down this page for each data page among the LMDB, and this position is 0 to represent that this page or leaf also is not updated behind the last time check point; This position is that 1 expression this page or leaf behind the last time check point is updated.
Advantage of the present invention and good effect: what support provided by the invention recovered while serving adopts the real-time logging mode of integrated subregion daily record and of short duration daily record characteristic based on " during knowledge " the dynamic fault-recovery method (TCDCRS) of daily record, use non-volatile high speed storing equipment as the log store district simultaneously, daily record cost when normally moving to reduce system as much as possible; On the recovery policy after website breaks down, TCDCRS has provided the dynamic recovery policy of recovering thought based on classification, comes back-up system to recover while serving, thereby reduces the time (T that the fault website stops to serve as far as possible
DT).The present invention compared with prior art has the following advantages:
(1) thought of recovering based on " dynamically " is supported to recover while serve, thereby has greatly shortened the time of serving of stopping after the system failure, helps the satisfied of Real-time Transaction off period.
(2) adopt integrated subregion and of short duration daily record characteristic, based on the real-time daily record technology of non-volatile ram and the local Fuzzy Test dot pattern that adapts with it, reduce daily record and check point cost when system normally moves widely, improved the performance when system moves significantly.
[embodiment]:
Embodiment 1
What support provided by the invention recovered while serving has adopted the real-time logging mode of integrated subregion daily record and of short duration daily record characteristic based on " during knowledge " the dynamic fault-recovery method (TCDCRS) of daily record, use non-volatile high speed storing equipment as the log store district simultaneously, daily record cost when normally moving to reduce system as much as possible; On the recovery policy after website breaks down, TCDCRS has provided the dynamic recovery policy of recovering thought based on classification, comes back-up system to recover while serving, thereby reduces the time that the fault website stops to serve as far as possible.Specifically comprise:
Integrated subregion daily record and of short duration daily record characteristic, based on the real-time daily record technology of non-volatile ram
---adopted log store to distinguish the thought in district, promptly according to the partition strategy of transactions classes, log store is distinguished into corresponding different subregions, the log record of the affairs that belong to a different category is respectively stored in different daily record subregions, thus the system performance bottleneck that can avoid single journal file to cause.Provide the principle of TCDCRS daily record subregion below.
The implication of related symbol is described as follows in the literary composition:
Parameter | Implication | Parameter | Implication |
ST | In the system might affairs set | LS | The log store district |
ST
i | The subclass of ST | DS(T) | The set of the data object of affairs T access |
DS(ST
i)
| ST
iIn the union of sets collection of data object of all affairs accesses
| SA(T) | The storage area of the log record of affairs T |
n | Represent a positive integer | | |
Definition 1. supposition ST
1, ST
2If ST is ST
1∩ ST
2= then claims ST
1And ST
2Mutual exclusion.Be designated as: ST
1⊥ ST
2
Definition 2. supposition ST
1, ST
2..., ST
nIf ST is to ST arbitrarily
i, ST
j, 1≤i≤n, 1≤j≤n has ST
i⊥ ST
j, then claim set { ST
1, ST
2..., ST
nIt is the mutually exclusive sets of ST.
Definition 3. supposition { ST
1, ST
2..., ST
nBe a mutually exclusive sets, if ST is arranged
1∪ ST
2∪ ... ∪ ST
n=ST then claims { ST
1, ST
2..., ST
nIt is the graduation (classification) of ST.Wherein, ST
i, 1≤i≤n is called a transactions classes.
Definition 4. supposition LS
1, LS
2..., LS
nIf LS is to LS arbitrarily
i, LS
j, 1≤i≤n has LS
i∩ LS
j= then claims set { LS
1, LS
2..., LS
nIt is the mutually exclusive sets of LS.
Definition 5. supposition π={ ST
1, ST
2..., ST
nBe the graduation of ST, μ={ LS
1, LS
2..., LS
nBe the mutually exclusive sets of LS, if there is dijection (---mapping) f: π → μ, claim that then μ is the subregion of the LS of related graduation π, LS
i(1≤i≤n) is called a sub-log area.Wherein, f represents ST
i∈ π has and has only a LS
i∈ μ makes T ∈ ST
iSA (T) LS is all arranged
iOtherwise, and also set up.
Definition 6.{ST
1, ST
2..., ST
nBe called as the quadrature graduation of ST, if { ST
1, ST
2..., ST
nBe graduation and the ST of ST
i, ST
j∈ { ST
1, ST
2..., ST
nDS (ST arranged
i) ∩ DS (ST
j)=.
Principle 1. is in order to ensure arriving correct, coherency state with database recovery after the fault, and TCDCRS requires graduation π={ ST of the ST of daily record section post association
1, ST
2..., ST
nSatisfy condition: { ST
K1, ST
K2..., ST
Kj π, (DS (π
1) ∩ DS (π
2))=.Here, π
1=ST
K1∪ ST
K2∪ ... ∪ ST
Kj, π
2=ST-π
1We claim the branch that satisfies condition in the principle 1 to divide the standardization graduation into.
We have proved following theorem:
If theorem 1. is { π
1, π
2Be the quadrature graduation of ST, { ST
K1, ST
K2..., ST
KjBe π
1A graduation, { ST
M1, ST
M2..., ST
MiBe π
2Graduation, then { a ST
K1ST
K2..., ST
Kj, ST
M1ST
M2..., ST
MiIt is a standardization graduation.
According to theorem 1, following mask body provides a kind of building method.At first ST is divided into two subclass: ST by affairs priority
>p={ T
i| Pr (T
i)>p, T
i∈ ST} and ST
<=p={ T
i| Pr (T
i)≤p, T
i∈ ST}, here, Pr (T
i) expression affairs T
iPriority.Obviously, { ST
>p, ST
<=pIt is the graduation of ST.By suitably adjusting the value of p, can make DS (ST
>p) ∩ DS (ST
<=p)= (the worst situation ST
>pAnd ST
<=pIn have one for ), i.e. { ST
>p, ST
<=pIt is the quadrature graduation of ST.DS (ST
>p) for belonging to ST
>pIn the set of data object of high priority office access, we claim DS (ST
>p) be the critical data class, claim ST
>pBe crucial transactions classes; DS (ST
<=p) for belonging to ST
<=pIn the set of data object of low priority office access, we are called the general data class, claim ST
<=pBe general transactions classes.Further, we are with ST
>pBe divided into two (also can be a plurality of) subclass: ST
>p,>f={ T
i| Fr (T
i)>f, T
i∈ ST
>pAnd ST
>p,<=f={ T
i| Fr (T
i)≤f, T
i∈ ST
>p, here, Fr (T
i) represent T
iEstimation carry out frequency, f is a frequency values of setting.Obviously, { ST
>p,>f, ST
>p,<=fBe ST
>pA graduation.Similarly, can be with ST
<=pBe divided into two (also can be a plurality of) subclass: ST
<=p,>f={ T
i| Fr (T
i)>f, T
i∈ ST
<=pAnd ST
<=p,<=f={ T
i| Fr (T
i)≤f, T
i∈ ST
<=p.Obviously, { ST
<=p,<f, ST
<=p,<=fBe ST
<=pA graduation.Make σ={ S
T>p,>f, ST
>p,<=f, ST
<=p,>f, ST
<=p,<=f, then according to theorem 1, σ is a standardization graduation.
---the tissue of storage medium
As shown in Figure 1, the storage medium of each website is divided into three layers: magnetic disk memory, non-volatile RAM, easily lose RAM (main memory).Local external memory database (LSDB) is stored in the magnetic disk memory.Non-volatile RAM is as the log store district, corresponding to standardization graduation σ, whole log store district is divided into four independently sub-log area: the sub-log area of crucial high frequency transactions classes, the sub-log area of crucial low frequency transactions classes, the general sub-log area of high frequency transactions classes and the general sub-log area of low frequency transactions classes, brief note is respectively: LS
Ch, LS
Cl, LS
GhAnd LS
Gl, they are used for storing accordingly ST respectively
>p,>f, ST
>p,<=f, ST
<=p,>fAnd ST
<=p,<=fThe log record of transactions classes, i.e. { LS
Ch, LS
Cl, LS
Gh, LS
GlIt is a subregion in the log store district of related standardization graduation σ.We are with LS
ChAnd LS
ClBe referred to as the key log district; LS
GhAnd LS
GlBe referred to as general log area.Local memory database (LMDB) is stored in the volatibility main memory, and is divided into two independent partitions: critical data subregion and general data subregion are used for storing respectively critical data class and general data class.
---the type and the structure of real-time log record
In conjunction with real-time committing protocol 1PRCP, we design five kinds of log record types: Begin, Redo, and Compensate, Ready and Commit, as shown in Figure 2.Wherein, P-TID represents distributed transaction (global transaction) sign, is defined as: P-TID::=<Cor_Addr, N 〉, here, Cor_Addr represents the coordinator's of distributed transaction the network address; N represents the sequence number of distributed transaction, and at each coordinator's website, N is a monotonically increasing.For local matter, P-TID is changed to NULL.TID is local matter or subtransaction sign, is defined as: TID::=<Addr, SN 〉, here, Addr represents the network address of local matter or subtransaction place website; SN represents the sequence number of local matter or subtransaction, is monotone increasing at each website SN." B ", " D ", " CP ", " R " and " C " are used for representing respectively Begin, Redo, Compensate, five kinds of log record types of Ready and Commit.TS represents that Redo or Compensate or Commit type log record create logic markers constantly.At each website, the target initial value is changed to 0 during logic, and whenever a Redo or Compensate or Commit log record or the check point log record hereinafter introduced are created, target value increases by 1 during logic.The RID representative is updated the sign of data object.BN represent with LMDB in the logical block number (LBN) of data block among the corresponding LSDB of data page.AI represents to be updated the back reflection of data object.VTI represents the maximum significant instant of real time data object, be VTI=ST (X)+VI (X), the sampling of ST (X) expression here markers, the time of the external world object of the X correspondence of promptly sampling, the term of validity of VI (X) expression X is promptly counted the time span that V (X) has validity from ST (X).For the persistant data object, its VTI is changed to infinity.CA represents the pairing compensation activity of control affairs.
◆ local Fuzzy Test dot pattern
In TCDCRS, each website is carried out local fuzzy checkpoint independently.In the check point implementation, the renewal of LMDB is written out to LSDB, and simultaneously, some useless log records are deleted to discharge corresponding log store space.On check point triggering opportunity, TCDCRS is not the periodic triggers strategy that adopts Fixed Time Interval, but (brief note is R according to log store district space utilization rate
LU) whether arrive preset threshold α and determine whether triggering check point.Work as R
LUGreater than α, the check point execution that is triggered.The initial value of α can preestablish according to the requirement of using, and can dynamically adjust the frequency that check point is carried out by the value of revising α in system's operational process.
When check point was carried out, the check point log record was written into the independent memory space that system distributes for the check point log record in non-volatile ram.The check point log record comprises five parts: check point bit field (CKB), crucial transactions classes are recovered initial markers (CTRST), general transactions classes is recovered initial time (GTRST), check point markers (CKT) and refresh page territory (UPF).CKB is used for representing whether this check point completes successfully.The CKB value is that 1 expression completes successfully, and is generation systems fault in the 0 expression check point implementation.Scale value when CTRST need after the fault to represent to carry out the minimum logic of crucial transactions classes of REDO recovery operation, and GTRST scale value when need after the fault to represent to carry out the minimum logic of general transactions classes of REDO recovery operation.Logic markers when CKT represents that check point is triggered.UPF is that each data page among the LMDB is provided with the update mode that a updated space (updating bit) writes down this page, and this position is that 0 expression this page or leaf behind the last time check point also is not updated; This position is that 1 expression this page or leaf behind the last time check point is updated.The check point implementation can be described below:
Procedure LocalCheckpoint() 1:CKB=0; 2:CKT=TCounter++; 3:Write data pages updated by committed transaction out to LSDB; 4:Set UPF according to updating state of data page; 5:Write the data pages whose upadting bits are 1 out to LSDB; 6:Delete useless log records,i.e.the log records of aborted transactions or whose logic timestamp in Commit log records is not larger than CKT,and free the corresponding logging store spaces; 7:Get the minimal logging timestamp of critical transaction class,set the value of CTRST; 8:Get the minimal logging timestamp of ordinary transaction class,set the value of GTRST; 9:CKB=1; |
The Chinese of above-mentioned algorithm is described:
The local check point execution algorithm of Procedure LocalCheckpoint ()/* */1:CKB=0; 2:CKT=TCounter++; 3: the data page that will submit to affairs to upgrade is written out to LSDB; 4: the update mode according to data page is provided with UPF; 5: with updated space among the UPF is that 1 data page is written out to LSDB; 6: die young affairs and submit that the logic markers discharges the log store space greater than the log record of the affairs of CKT in the record to of deletion; 7: obtain minimum logic markers in the crucial transactions classes daily record, and assign it to CTRST; 8: obtain minimum logic markers in the general transactions classes daily record, and assign it to GTRST; 9:CKR=1; |
In the superincumbent description and in the arthmetic statement handled of the recovery of back, TCounter is used for presentation logic markers counter, and its initial value is changed to 0, and whenever a Redo or Compensate or Commit or check point log record are created, its value adds 1.System distributes corresponding storage space for TCounter in non-volatile ram.
◆ dynamically recover disposal route
In the recovery processing procedure after the website fault, at first, LSDB is loaded into main memory and rebuilds LMDB; Then, recovery subsystem is responsible for LMDB is returned to nearest coherency state.In order to improve system performance, TCDCRS has provided the dynamic recovery processing policy that recovers thought based on classification, dynamically recovering processing policy is to propose real-time logging mode based on the front, its key feature is: the critical data class is at first recovered, before recovering the general data class, recover the website service, recover the general data class then while serving, to reduce the time that the fault website stops to serve to greatest extent.In conjunction with real-time committing protocol 1PRCP, dynamically recovery policy can be guaranteed the atomicity of distributed transaction fault.Dynamically recovery policy specifically comprises the steps:
(1) the main memory corresponding data subregion of from LSDB the critical data class being packed into is rebuild LMDB;
(2) eliminate the control affairs of dying young belong to crucial transactions classes causes the external world is changed, and the critical data class is returned to nearest coherency state;
(3) service of recovery fault website;
(4) the main memory corresponding data subregion of from LSDB, the general data class being packed into;
(5) eliminate the control affairs of dying young belong to general transactions classes causes the external world is changed, and the general data class is returned to nearest coherency state.
In the step, the implementation algorithm of (2) and (5) can be unified to be described below in the above:
Procedure CrashRecovery(char dc)
Input:dc denotes data class asking to be recovered and dc=”C”stands for critical data class,
while dc=”G”stands for general data class.
1:FT=TCounter
2:if(dc=”C”)then
3: RST=CTRST;
4: Scan critical logging partition(including CALP and CDLP)to look for all Compensate log reords
CPLog
Ti,which satisfy the following conditions:the corresponding Commit log records
CommitLog
Ti don’t exist,i.e.the corresponding transactions don’t commit successfully,
and timestamp of CPLog
Ti is smaller than FT.At the same time insert these CPLog
Ti into
compensating activity recovery list(CARL)in order of their timestamp;
5:else
6: RST=GTRST;
7: Scan ordinary logging partition(including OALP and ODLP)to look for all Compensate log reords
CPLog
Ti,which satisfy the following conditions:the corresponding Commit log records
CommitLog
Ti don’t exist,i.e.the corresponding transactions don’t commit successfully,
and timestamp of CPLog
Ti is smaller than FT.At the same time insert these CPLog
Ti into
compensating activity recovery list(CARL)in order of their timestamp;
8:Scan reversely CARL until the head of CARL and for each CPLog
Ti,execute the corresponding
compensating activity CPLog
Ti.CA;
9:while(RST≤FT)
10: if(dc=”C”)then
11: Scan critical logging partition to look for the Redo log record RedoLog
Ti,k whose timestamp
is RST;
12. else
13: Scan ordinary logging partition to look for the Redo log record RedoLog
Ti,k whose timestamp
is RST;
14: if(find the Redo log record RedoLog
Ti,k)then
15: if(find the corresponding Commit log record CommitLog
Ti)then
16: if(RedoLog
Ti,k.VTI>T
c)then
17: REDO(RedoLog
Ti,k)
18: RST++;continue;
19: else
20: RST++;
21: Triggeer the corresponding sample transaction to update overdue data;
22: if(find the corresponding Ready log record ReadyLog
Ti)then
23: if(receive Commit message)then
24: REDO(RedoLog
Ti,k);
25: Add CommitLog
Ti to the corresponding logging partition;
26: RST++;
27: if(receive Abort message)then
28: RST++;
29: else
30: RST++;
31:else
32: RST++;
33:endwhile
The Chinese of above-mentioned algorithm is described:
Procedure CrashRecovery(char dc)
Input: dc represents to require data recovered classification, dc=" C " represent the critical data class, and dc=" G " represent the general data class
1:FT=TCounter
2:if(dc=”C”)then
3: RST=CTRST;
4: scanning key log subregion, seek the Compensate log record CPLog that satisfies following condition
Ti: and the submission log record of these affairs is not deposited
And CPLog
Ti, the logic markers littler than FT.With the CPLog that finds
Ti, it is extensive that scale value is inserted into compensation from small to large successively during by their logics
Among the multiple hotlist CARL.
5:else
6: RST=GTRST;
7: scan general daily record subregion, seek the Compensate log record CPLog that satisfies following condition
Ti: and the submission log record of these affairs is not deposited
And CPLog
Ti, the logic markers littler than FT.With the CPLog that finds
Ti, it is extensive that scale value is inserted into compensation from small to large successively during by their logics
Among the multiple hotlist CARL.
8: reverse scan CARL shows up to gauge outfit, to each CPLog
Ti, carry out the corresponding mobile C PLog of replenishing
Ti.CA;
9:while(RST≤FT)
10: if(dc=”C”)then
11: scanning key log subregion looks for the logic markers to equal the Redo log record RedoLog of RST
Ti, k
12. else
13: scan general daily record subregion and look for the logic markers to equal the Redo log record RedoLog of RST
Ti, k
14:if (finds RedoLog
Ti, k) then
(there is corresponding C ommit log record CommitLog in 15:if
Ti) then
16: if(RedoLog
Ti,k.VTI>T
c)then
17: REDO(RedoLog
Ti,k)
18: RST++;continue;
19: else
20: RST++;
21: trigger corresponding sampling affairs and upgrade the stale data object;
22:if (finds corresponding Ready log record ReadyLog
Ti) then
23:if (having received coordinator's submission message) then
24: REDO(RedoLog
Ti,k);
25: increase CommitLog
TiTo corresponding daily record subregion;
26: RST++;
27:if (having received coordinator's the message of dying young) then
28: RST++;
29: else
30: RST++;
31:else
32: RST++;
33:endwhile
In the superincumbent arthmetic statement, RedoLog
Ti, kExpression affairs T
iK bar Redo log record; Process REDO (RedoLog
Ti, k) be responsible for RedoLog
Ti, kThe value of the data object of record in LMDB covers with videoing thereafter; RedoLog
Ti, k.VTI represent RedoLog
Ti, kThe significant instant of the data object of record.Because in a single day expired its value of real time data object promptly becomes meaningless, therefore, in above-mentioned dynamic recovery processing policy, expired real time data object is not carried out the REDO operation, still take to trigger the value that corresponding sampling affairs are upgraded the stale data object.
Embodiment 2
[specific performance is relatively]:
The influence of different logging modes to system performance tested in the comparison of the cost of daily record when we had carried out operation with TCDCRS and other restoration methods.The major parameter of performance test is provided with as shown in table 1, U[i wherein, j] expression obeys the equally distributed stochastic variable on interval [i, j].In our experiment, global memory's database (GMDB) is the set of being made up of 50000 data pages, these data pages are assigned to 5 websites and form corresponding local memory database (LMDB), visit and concurrent control to data all occur in the page or leaf level, concurrent control strategy adopts distributed high priority two-phase lock agreement (DHP-2PL), and affairs priority is assigned employing and cut last preference strategy (EDF) the earliest.The off period of affairs T is calculated as follows: Deadline (T)=AT (T)+Slack * ET (T).Here, the off period of Deadline (T) expression T; AT (T) expression T arrives the time of system; Slack represents relaxation factor, is generally one and satisfies equally distributed stochastic variable; The estimation execution time of ET (T) expression T.ET (T) estimates by following formula: ET (T)=OpN * AET, wherein the implication of OpN and AET is as described in Table 1.The ratio MDR that we miss the off period with Real-time Transaction is a main performance index, and it is defined as follows: MDR=(missing the number of off period affairs)/(entering the sum of system transaction).Obviously, MDR is more little, and system real time can be good more.
Table 1.Experiment parameters
Table 1. experiment parameter
Parameter | Value (unit) | Meaning |
NS | 5 | The website number that the distributed real-time main memory database system comprises |
S
LMDB | 10000(Page) | The size of each website LMDB |
R
CD | 0.4 | Critical data class data account for the ratio of total data |
R
TD | 0.8 | Real time data accounts for the ratio of total data |
NP | 4 | Log store is distinguished district's number |
SL | 8(MB) | The size in each website log store district |
AET | 0.4(ms) | The average execution time of transaction operation |
PU | 0.4 | Transaction operation is the probability that upgrades operation |
Slack | U[2.0,6.0] | Relaxation factor |
NTO | U[4,8] | The number of the operation that affairs comprise |
α | 0.8 | Space, log store district utilization rate threshold value |
We are with the integrated subregion daily record of TCDCRS and real-time logging mode PERT-NVRAM and other three kinds of logging modes of of short duration daily record characteristic: no daily record pattern (NLS), compare based on the subregion logging mode (PLSD) of disk with based on disk sequence logging mode (SLSD).NLS represents not write down transaction journal in system's operational process, and obviously this can not satisfy the requirement of recovery, here the benchmark that it is compared as the different mode cost.Test result as shown in Figure 3, when the arrival rate of affairs improves, four kinds of all corresponding increases of the pairing MDR of logging mode, and PERT-NVRAM is near the effect of NLS, its MDR is significantly less than other two kinds of logging modes.
The time T that the back system stops to serve takes place in fault
DTIt is another important indicator of weighing restorability.For distributing real-time data bank system, T
DTMainly comprise: data are rebuild the required time T of LMDB from the LSDB graftabl
1With LMDB is returned to the required time T of coherency state
2Because TCDCRS has adopted the dynamic recovery policy (crucial class data are at first packed into, recovered, and have recovered system service before general class data graftabl) of recovering thought based on classification, therefore for TCDCRS, T
DTEqual critical data class graftabl required time and the summation of in internal memory, they being recovered the coherency state required time, T
DTCan estimate as follows:
T
DT=T
1+T
2≈S
LMDB×R
CD×T
L0+(SL×R
CL×α)÷S
LR×T
rp (1)
(1) in the formula, T
L0Expression is read in a data block to the average required time of internal memory from external memory; R
CLExpression key log district accounts for the ratio of whole available log area; S
LRRepresent the mean size of a log record; T
RpThe average handling time of log record when representative recovers; S
LMDB, R
CD, SL and α implication such as table 1 description.Because the critical data class only accounts for the fraction of total data usually, therefore the static recovery policy of system service after being packed into, recover, total data is provided again, and TCDCRS reduction system significantly stops the time T of serving
DT