CN101794247A - Real-time database failure recovery method under nested transaction model - Google Patents

Real-time database failure recovery method under nested transaction model Download PDF

Info

Publication number
CN101794247A
CN101794247A CN 201010132651 CN201010132651A CN101794247A CN 101794247 A CN101794247 A CN 101794247A CN 201010132651 CN201010132651 CN 201010132651 CN 201010132651 A CN201010132651 A CN 201010132651A CN 101794247 A CN101794247 A CN 101794247A
Authority
CN
China
Prior art keywords
nrtt
redo
affairs
log
log record
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN 201010132651
Other languages
Chinese (zh)
Inventor
肖迎元
尹波
申艳
刘凤连
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin University of Technology
Original Assignee
Tianjin University of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin University of Technology filed Critical Tianjin University of Technology
Priority to CN 201010132651 priority Critical patent/CN101794247A/en
Publication of CN101794247A publication Critical patent/CN101794247A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a real-time database failure recovery method under a nested transaction model. Aiming at the properties of nested real-time transactions, the invention provides a new failure recovery method for a nested real-time transaction model. The failure recovery method improves the traditional log record types and structures to well adapt to the properties of the nested real-time transactions; in a log buffer area distribution strategy, the concurrent nested real-time transactions are distributed to independent active log areas so as to solve the problem that the current log buffer page in a sequent log mode affects the performance of a system due to serious access competition; and in a recovery processing algorithm after the failure happens, a Redo initial point section and execution order is optimized so as to improve the recovery performance as far as possible on the premise of ensuring submitted transaction durability. The method is suitable for time key application of a computer integrated manufacturing system, power grid dispatching and the like.

Description

Real-time database failure recovery method under nested transaction model
[technical field]: the invention belongs to the real-time database failure recovery field.At properties of nested real-time transactions, a kind of fault recovery method new, that support the nested real-time transactions model has been proposed.This fault recovery method improves traditional log record types and structure, to adapt to properties of nested real-time transactions better; On the log buffer district distributed strategy, concurrent nested real-time transactions was assigned with independently activity log district, thereby had solved current log buffer page or leaf in the sequential log pattern influences system performance because of serious accessing competition problem; In the recovery Processing Algorithm after fault takes place, (Redo) starting point of reforming is selected to have carried out optimization process with execution sequence, guaranteeing to submit under the persistent prerequisite of affairs, to improve restorability as much as possible.
[background technology]: real-time data base is applied in computer integrated manufacturing system, the crucial class application of dispatching of power netwoks equal time usually.And for application such as computer integrated manufacturing system, the engineering design affairs of its processing are often huge and have a labyrinth, the smooth transaction model of the no inner structure of tradition can not satisfy the demand of the engineering design affairs with labyrinth, and this just needs to support the nested transaction model of inner structure.Subtransaction has the semanteme different with smooth affairs on transaction isolation, affairs are submitted to and died young, thereby new strategy and machine-processed need be provided at aspects such as dispatching algorithm, concurrency control protocol, fault recoveries.
For the real-time data base that data and affairs all have regularly restriction, it is vital rapidly and effectively recovering after fault takes place.Existing real-time database failure recovery Study on Technology is mainly based on smooth transaction model.And for application such as computer integrated manufacturing system, the engineering design affairs of its processing adopt nested transaction model usually, and a nested real-time transactions can be defined as follows:
Define 1 nested real-time transactions (Nested Real-Time Transaction NRTT) is defined as a four-tuple:
NRTT::=(S,R,< t,C)
S::={<STEP>,......}
STEP::=<SUBTRAN>|<OP>
Wherein, SUBTRAN represents subtransaction, and subtransaction can comprise the subtransaction of oneself, i.e. SUBTRAN::=NRTT|SUBTRAN again; OP represents basic transaction operation; The required system resource of S is carried out in the R representative;< tBe a partial ordering relation on the S; C represents the timing restriction of subtransaction.
By above-mentioned NRTT definition as can be known, a NRTT is exactly an affairs tree in logic.In the affairs tree, there are not the affairs of father's affairs to be called root affairs (being the root node of affairs tree).There are not the affairs of subtransaction to be called the leaf affairs.Include son obviously, in an affairs tree, the root affairs are unique.
For traditional smooth affairs, atomicity is followed in the execution of affairs: perhaps the operation in the affairs all is finished, and the renewal to the data object is reflected in the database; Perhaps the operation in the affairs is all died young and is called internal affairs for non-affairs of database and outer affairs.Portion's environment stays any vestige.For NRTT, dying young of a subtransaction not necessarily requires his father's affairs to die young, i.e. the execution of father's affairs does not have atomicity.When subtransaction was died young, father's affairs can be made following selection according to the characteristic (whether can reform, whether have alternative affairs, whether can compensate) and the criticality of this subtransaction of this subtransaction: (1) re-executed this subtransaction; (2) carry out " substituting " or " compensation " affairs of this subtransaction; (3) no matter dying young of this subtransaction continues to carry out; (4) father's affairs are died young.
Following rule is followed in the execution of NRTT:
(1) submit rule to: the submission of a subtransaction only means finishing of its logical operation, its renewal to the data object only is written to its result data and concentrates, and its change to database could really be written to physical database when the root affairs that comprise this subtransaction are submitted to.
(2) rule of dying young: dying young of (son) affairs among the NRTT on any one-level, cause dying young of its all subtransactions, but dying young of subtransaction not necessarily causes dying young of father's affairs, father's affairs still may normally be submitted to.The rule of dying young has transitivity, and obviously all affairs that will cause NRTT of dying young of root affairs are died young.
(3) visibility rules: subtransaction can be visited the data object (subtransaction has been inherited the lock that father office holds) that his father office holds; After subtransaction was submitted to, it can be by father's transactions access to the renewal (result data collection) of data object.Visibility rules also has transitivity.
Obviously, also must guarantee satisfying of above-mentioned rule in the fault recovery processing procedure, this just requires fault recovery method that corresponding support is provided.
[summary of the invention]: the present invention seeks to overcome the prior art above shortcomings,, propose a kind of fault recovery method new, that support the database of nested real-time transactions model at properties of nested real-time transactions.
Fault recovery method provided by the invention improves traditional log record types and structure, to adapt to properties of nested real-time transactions better; On the log buffer district distributed strategy, concurrent nested real-time transactions was assigned with independently activity log district, thereby had solved current log buffer page or leaf in the sequential log pattern influences system performance because of serious accessing competition problem; In the recovery Processing Algorithm after fault takes place, (Redo) starting point of reforming is selected to have carried out optimization process with execution sequence, guaranteeing to submit under the persistent prerequisite of affairs, to improve restorability as much as possible.
The fault recovery method of database under the nested real-time transactions model specifically comprises:
The first, the foundation of log record types and logical organization in the nested real-time transactions
Executing rule characteristics according to nested real-time transactions NRTT, log record types is designed to five kinds, be respectively: affairs begin log record Begin, rewrite log record Redo, the affairs log record Abort that dies young, subtransaction submits to log record Sub_Commit and affairs to submit log record Commit to, and its logical organization is respectively:
Figure GSA00000063554200021
Figure GSA00000063554200023
Figure GSA00000063554200024
Figure GSA00000063554200025
Wherein, ID is a NRTT sign, is used for each NRTT of unique sign, belongs to the affairs of same NRTT, comprises that root affairs, internal affairs and leaf affairs have identical ID; TID is a Transaction Identifier, is used for each affairs among the unique identification NRTT; P-TID is the Transaction Identifier of TID father's affairs, if TID is the root affairs, then P-TID is changed to null; B, R, SC, C, A represents Begin respectively, Redo, Sub_Commit, five kinds of log record types of Commit and Abort; LT represents the length of Redo log record, scale value during logic when TS represents that the Redo log record is created, the target initial value is made as 0 during logic, whenever a Redo log record is created, target value just adds 1 in proper order during logic, RID represents to be updated the sign of data object, and BN represents the logical block number (LBN) of counterfoil outside the RID place, and AI represents that the value after data object is updated also claims the back reflection; VTI represents the significant instant of temporal data object, i.e. VTI=ST+VP, and here, ST represents the sampling instant of temporal data object, and VP represents the temporal data object term of validity, and for non-temporal data, VTI is changed to infinity;
The second, the foundation of daily record execution model, this daily record execution model comprises:
Carry out engine modules: be used to carry out each transaction operation, comprise that affairs begin, upgrade operation, affairs submission, subtransaction submission, affairs and die young.
Log management module Logger: be responsible for each NRTT individually the allocation activities log area, create corresponding log record, be responsible for simultaneously creating and maintenance activity transaction table ATL, after the submission log record of the root affairs of a NRTT was written into corresponding activity log district, Logger was responsible for the content in its activity log district just is refreshed to the Disk Logs file.ATL be used for writing down current all enliven the status information of NRTT and all subtransactions thereof, enlivening NRTT is to have begun to carry out, but the root affairs are not finished the NRTT that submits to or die young as yet, Logger enlivens NRTT for each and safeguard a list item in ATL, and set up the corresponding state chained list for its all subtransactions that comprise, its logical organization is as follows:
Figure GSA00000063554200031
Wherein, ID is the NRTT sign; Scale value when FTS represents the logic of the first Redo log record of NRTT, if NRTT is read-only affairs, FTS is changed to-1; TID is a subtransaction sign, and Status represents the subtransaction current state, and the subtransaction current state comprises: enliven Active, submit Sub-Commit to and three kinds of the Abort of dying young;
The activity log district: this model distributes interim log buffer page or leaf individually for each NRTT, abbreviates the activity log district as; To each transaction operation, the activity log subregion that log management module (Logger) is responsible under current execution NRTT is created corresponding log record for it, have only after the submission log record of the root affairs of a NRTT is written into corresponding activity log district, the content in its activity log district just is refreshed to the Disk Logs file;
Private data buffer zone: the data object that is used to deposit NRTT read-write before the root affairs are submitted to
System data buffer: be the buffer memory of data in internal memory that maybe will be used in the disk database, when the root affairs of a NRTT were submitted to, the data in its private data buffer zone were refreshed to system data buffer.
Disk database and Disk Logs file: for internal memory, we will quarter at the database of disk and the set of log record is called disk database and Disk Logs file.
Three, the analysis phase after the real-time dataBase system fault takes place, promptly determine the Redo starting point of reforming
Recovery processing procedure after real-time data base breaks down mainly is divided into two stages: analysis phase and Redo stage;
In the analysis phase, at first determine that by analyzing daily record the check point LS_Checkpoint that preceding the last time completes successfully takes place fault, promptly the End_Checkpoint record has write the last check point of Disk Logs file;
The relative position relation on time shaft according to NRTT and check point LS_Checkpoint, determine whether the Redo that to reform, the NRTT that has been refreshed to system data buffer for renewal before writing the Disk Logs file at the Begin_Checkpoint of LS_Checkpoint record need not Redo, the necessary Redo of all the other NRTT; Need the NRTT of Redo to navigate to the NRTT of FTS minimum in scanning, be the starting point of reforming, and the FTS that this is minimum is designated as MinFTS;
Four, the Redo stage after the real-time data base fault takes place
In the Redo stage, according to the starting point of reforming that the analysis phase is determined, carry out redo operation, at first SDB is returned to nearest coherency state, do not carry out the Redo operation for expired temporal data;
Be without loss of generality, the Redo log record that scale value equals MinFTS when supposing logic in the journal file is designated as RedoLog TThe implementation algorithm in Redo stage is described below:
Procedure?RedoRecovery(long?int?MinFTS)
Input:MinFTS represents FTS. minimum among T2 and the T12 class NRTT
Begin
1:Temp=MinFTS;
2:While(Temp<CTS)
3: from the RedoLog of journal file TLog record rises, the forward scan journal file;
4:IF(
Figure GSA00000063554200041
RedoLog Ti((RedoLog Ti.TS==Temp)∧(RedoLog Ti.VTI>T C)))
5:Switch(Class)
6:Case?Sub_transaction:
7:IF((
Figure GSA00000063554200042
CommitLog Ti)∧(
Figure GSA00000063554200043
LocalCommitLog Ti))
8:Redo(RedoLog Ti);
9:Case?Root_transaction:
10:IF(
Figure GSA00000063554200044
CommitLog Ti)
11:Redo(RedoLog Ti);
12:Case?default:break;
13:Temp++;
End
In above-mentioned implementation algorithm, scale value determines to carry out the order of Redo operation during according to the logic of Redo log record;
In above-mentioned implementation algorithm is described, target value during logic when CTS represents to carry out check point; T CExpression system current time; RedoLog TiExpression nested real-time transactions T iA Redo log record; RedoLog Ti.TS represent RedoLog TiLogic the time scale value; RedoLog Ti.VTI represent RedoLog TiThe significant instant of the data object of record; Class represents T iClassification, represent T with Sub_transaction here iBe subtransaction, and Root_transaction represents T iBe the root affairs; CommitLog TiThe Commit log record of expression root affairs; LocalCommitLog TiThe LocalCommit log record of expression subtransaction; Process Redo (RedoLog Ti) be responsible for RedoLog TiThe data object of record covers with its back reflection.
Advantage of the present invention and good effect:
Compared with prior art, the present invention has the following advantages:
(1). at properties of nested real-time transactions, traditional log record types and structure are improved, to adapt to the characteristic of subtransaction better;
(2). on the log buffer district distributed strategy, concurrent nested real-time transactions was assigned with independently activity log district, thereby had solved current log buffer page or leaf in the sequential log pattern influences system performance because of serious accessing competition problem;
(3). in the recovery Processing Algorithm after fault takes place, the Redo starting point is selected to have carried out optimization process with execution sequence, guaranteeing to submit under the persistent prerequisite of affairs, to improve restorability as much as possible.
The performance test results shows that compared with prior art, the fault recovery method that the present invention proposes has than traditional fault recovery technology better real-time property energy.
[description of drawings]:
Fig. 1 is the building-block of logic of five kinds of log record types;
Fig. 2 is a daily record execution model block diagram;
Fig. 3 is the building-block of logic of active transaction table;
Fig. 4 is the log record sequential chart.
Fig. 5 is the comparison diagram of three kinds of fault recovery method real-time performances
Fig. 6 is the comparison diagram of three kinds of fault recovery method downtime
[embodiment]:
Embodiment 1
The specific descriptions of the fault recovery method of database are as follows under the nested real-time transactions model provided by the invention:
◆ log record types and structure
According to the submission rule of NRTT, NRTT delays time to the write operation of database and just really carries out (having adopted " time-delay is write " technology) when the root affairs are submitted to, thereby in the fault recovery processing procedure, and the Undo operation of NRTT is no longer needed.At NRTT, we have designed five kinds of log record types: Begin, Redo, Abort, Sub_Commit (subtransaction submission) and Commit (submission of root affairs).Fig. 1 has shown the logical organization of five kinds of log record types.Wherein, ID is a NRTT sign, is used for each NRTT of unique sign, and the affairs (comprising root affairs, internal affairs and leaf affairs) that belong to same NRTT have identical ID; TID is a Transaction Identifier, is used for each affairs among the unique identification NRTT; P-TID is the Transaction Identifier of TID father's affairs, if TID is the root affairs, then P-TID is changed to null; B, R, SC, C, A represents Begin respectively, Redo, Sub_Commit, Commit, five kinds of log record types of Abort; LT represents the length of Redo log record; Scale value during logic when TS represents that the Redo log record is created, the target initial value is made as 0 during logic, whenever a Redo log record is created, during logic target value just order add 1; RID represents to be updated the sign of data object; BN represents the logical block number (LBN) of counterfoil outside the RID place; AI represents the value (back reflection) after data object is updated; VTI represents the significant instant of temporal data object, i.e. VTI=ST+VP, and here, ST represents the sampling instant of temporal data object, VP represents the temporal data object term of validity.For non-temporal data, VTI is changed to infinity.
◆ the daily record execution model
For traditional sequential log pattern, the log record of concurrent transaction is recorded in the current log buffer page or leaf successively by the execution sequence of corresponding transaction operation, submits to or log buffer district when full when affairs, and corresponding log record is written into the external memory journal file.Obviously, for can seize the real-time dataBase system of scheduling strategy based on priority, current log buffer page or leaf can become the bottleneck of system performance because of serious accessing competition.
As shown in Figure 2, in our logging mode, for each NRTT distributes interim log buffer page or leaf (abbreviating the activity log district as) individually.To each operation of NRTT (comprise affairs begin, upgrade operation, root affairs are submitted to, subtransaction is submitted to, affairs are died young), the activity log subregion that log management module (Logger) is responsible under this NRTT is created corresponding log record for it, have only after the submission log record of the root affairs of a NRTT is written into corresponding activity log district, the content in its activity log district just is refreshed to the Disk Logs file.When subtransaction is carried out, when relating to reading to the data object, during write operation, this data object is read into the private data buffer zone of this subtransaction earlier (if this data object is in system data buffer, then directly it is read into the private data buffer zone from system data buffer, otherwise from disk database, read in), when subtransaction is submitted to, its renewal to the data object only is reflected in its private data buffer zone, have only when the root affairs are submitted to, just all renewals are flushed to system data buffer, when carrying out the check point operation or when system data buffer is full, these upgrade is forced to be written out to disk database from system data buffer.
For the needs that fault recovery is handled, at system's normal operation period, Logger is responsible for creating and maintenance activity transaction table (ATL).ATL be used for writing down current all enliven the status information of NRTT and all subtransactions thereof.Enlivening NRTT is to have begun to carry out, but the root affairs are not finished the NRTT that submits to or die young as yet.Logger enlivens NRTT for each and safeguard a list item in ATL, and is its all subtransaction creation state chained lists that comprise, and its logical organization is illustrated in fig. 3 shown below.Wherein, ID is the NRTT sign; Scale value when FTS represents the logic of the first Redo log record of NRTT, if NRTT is read-only affairs, FTS is changed to-1; TID is the subtransaction sign; Status represents the subtransaction current state, and the subtransaction current state comprises: active (Active), submission (Sub-Commit) and (Abort) three kinds that die young.
When a NRTT begins to carry out, in its activity log district, the Begin log record of a correspondence is created, and creates a respective items for this NRTT simultaneously in ATL; When the subtransaction execution that is triggered, a corresponding Begin log record is created, and the table tail of the subtransaction state-chain-table of NRTT inserts corresponding catena in ATL simultaneously; To each write operation, the Redo log record of a correspondence is created; Submit to when a subtransaction, the Sub_Commit log record of a correspondence is created, and the Status territory corresponding to the catena of this subtransaction is changed to Sub_Commit among the ATL simultaneously; When a subtransaction is died young, send the message of its all subtransaction of dying young earlier to task manager, after the acknowledge message of dying young of receiving all subtransactions, the Abort log record of a correspondence is created, and simultaneously the Status territory corresponding to the catena of this subtransaction is changed to Abort among the ATL; If the root affairs are died young, the die young message of its all subtransaction of transmission, after the acknowledge message of dying young of receiving all subtransactions, the Abort log record of a correspondence is created, and simultaneously list item and the corresponding subtransaction state-chain-table corresponding to this NRTT among the ATL is deleted.After root affairs have been finished all operations, check ATL, if no longer include active subtransaction in its subtransaction, it is the state of all subtransactions in the subtransaction state-chain-table or for Abort, be Sub_Commit, the root affairs enter submit state, and a corresponding Commit log record is created, relevant renewal in the privately owned buffer zone chained list of root affairs is refreshed to system data buffer, and list item and the corresponding subtransaction state-chain-table corresponding to this NRTT among the ATL deleted.
◆ the fault recovery Processing Algorithm
After the system failure takes place, recover processing procedure and mainly be divided into two stages: analysis phase and Redo stage.
(1) analysis phase
Analysis phase is determined the Redo starting point by analyzing daily record.As shown in Figure 4, LS_Checkpoint is illustrated in fault the preceding recent check point that completes successfully takes place, and promptly the End_Checkpoint record has write the last check point of Disk Logs file; The Begin_Checkpoint record that T1 is illustrated in LS_Checkpoint writes the NRTT that the former activity log district of journal file has been written to the Disk Logs file; T2 represents that partial log writes before being recorded in Begin_Checkpoint, and partial log is recorded in the NRTT that Begin_Checkpoint writes the activity log district afterwards; T3 represents log record after Begin_Checkpoint, but writes the NRTT of journal file before End_Checkpoint; T4 represents that partial log writes before being recorded in End_Checkpoint, and part writes the NRTT in activity log district after End_Checkpoint; T5 represents that log record is after End_Checkpoint but write the NRTT of journal file before fault takes place; T6 represents that log record is not written to the NRTT of journal file with regard to the generation systems fault as yet.For T2, T3, T4, this four class of T5 NRTT, the Commit log record has write journal file before fault takes place, but this four class NRTT does to be updated in to database and not necessarily really write SDB before fault takes place, so must carry out Redo during recovery.Therefore T6 class NRTT need not Redo because its Commit log record does not write journal file as yet.For T1 class NRTT, in conventional database systems based on first-serve scheduling policy, because all log records had write journal file before LS_Checkpoint begins, according to first-serve scheduling policy, they also should be refreshed to system data buffer to the renewal of database before LS_Checkpoint carries out, thereby in the check point process, these renewals will intactly be written to SDB.So for conventional database systems, T1 class affairs need not Redo.Yet, for real-time dataBase system, owing to adopted based on priority preemptible scheduling strategy, affairs are after flushing to journal file with the activity log district, when renewal or did not as yet flush to system data buffer as yet fully, CPU may be seized by other high priority affairs, thereby may cause affairs that database update is failed intactly to be written to SDB in the LS_Checkpoint process, when fault takes place, cause the affairs effect to be lost.Further, we are divided into two classes: T11 and T12 with T1 class NRTT.T11 is illustrated in the Begin_Checkpoint record and writes the NRTT that the former renewal of Disk Logs file has been refreshed to system data buffer; T12 is illustrated in and upgrades the NRTT that is not also flushed to system data buffer fully when the Begin_Checkpoint record writes the Disk Logs file.Obviously T11 class NRTT need not Redo, and T12 class NRTT must Redo.The result of analysis phase finds the NRTT of FTS minimum in T2 and T12 class NRTT, promptly determine the starting point of reforming.The minimum FTS that will satisfy above-mentioned condition below is designated as MinFTS.
(2) the Redo stage
The starting point of reforming that the Redo stage was determined according to the analysis phase is carried out the Redo operation, and SDB is returned to nearest coherency state.Because after temporal data had surpassed the term of validity, it is meaningless that its value just becomes, therefore,, expired temporal data is not carried out the Redo operation in the Redo stage.Be without loss of generality, the Redo log record that scale value equals MinFTS when supposing logic in the journal file is designated as RedoLog TThe implementation algorithm in Redo stage is described below:
Procedure?RedoRecovery(long?int?MinFTS)
Input:MinFTS represents FTS. minimum among T2 and the T12 class NRTT
Begin
1:Temp=MinFTS;
2:While(Temp<CTS)
3: from the RedoLog of journal file TLog record rises, the forward scan journal file;
4:IF(
Figure GSA00000063554200081
RedoLog Ti((RedoLog Ti.TS==Temp)∧(RedoLog Ti.VTI>T C)))
5:Switch(Class)
6:Case?Sub_transaction:
7:IF((
Figure GSA00000063554200082
CommitLog Ti)∧( LocalCommitLog Ti))
8:Redo(RedoLog Ti);
9:Case?Root_transaction:
10:IF(
Figure GSA00000063554200084
CommitLog Ti)
11:Redo(RedoLog Ti);
12:Case?default:break;
13:Temp++;
End
In above-mentioned implementation algorithm, scale value determines to carry out the order of Redo operation during according to the logic of Redo log record.In the arthmetic statement, target value during logic when CTS represents to carry out check point; T CExpression system current time; RedoLog TiExpression nested real-time transactions T iA Redo log record; RedoLog Ti.TS represent RedoLog TiLogic the time scale value; RedoLog Ti.VTI represent RedoLog TiThe significant instant of the data object of record; Class represents T iClassification, represent T with Sub_transaction here iBe subtransaction, and Root_transaction represents T iBe the root affairs; CommitLogT iThe Commit log record of expression root affairs; LocalCommitLog TiThe LocalCommit log record of expression subtransaction; Process Redo (RedoLog Ti) be responsible for RedoLog TiThe data object of record covers with its back reflection.
Embodiment 2[specific performance is relatively]:
Restoration methods with the inventive method and existing support nested transaction model: the comparison of daily record cost based on the fault recovery method of savepoint and when supporting the fault recovery method of subtransaction to move, tested daily record expense when the different faults restoration methods is normally moved in system to the influence of system performance, in addition the system of different faults restoration methods is stopped service time and also compare, the main performance index of test is: the time downtime that the back system stops to serve takes place in ratio MDR and fault that nested real-time transactions is missed the off period.The ratio MDR that nested real-time transactions is missed the off period has reflected the real-time performance of system, and its value is more little, and the real-time performance of system is good more.In experiment, off period preference strategy is the earliest adopted in the priority assignment.The off period of nested real-time transactions is calculated as follows: off period=AT+SF * ET, and here, AT represents the time of arrival of nested real-time transactions; SF represents relaxation factor, for satisfying equally distributed stochastic variable; ET represents the estimation execution time of nested real-time transactions.Table 1 has provided the major parameter of experiment, wherein, U[i, j] represent to be defined on the interval [i, j] to satisfy equally distributed stochastic variable.
The main experiment parameter of table 1.
Fig. 5 has shown when affairs arrival rate TArRate increases, the inventive method with miss difference on the off period ratio MDR based on the fault recovery method of savepoint, the fault recovery method of supporting subtransaction in nested real-time transactions, in Fig. 5, we represent the inventive method with NFRS, the SPFRS representative is based on the fault recovery method of savepoint, and the fault recovery method of subtransaction is supported in the TFRS representative.As can be seen, when TArrRate increases, the MDR of NFRS, SPFRS and TFRS correspondingly increases, but the MDR of NFRS will be starkly lower than the MDR of SPFRS and TFRS, and it is more obvious that the superiority of NFRS real-time performance becomes along with the increase of TArrRate, this is because NFRS has adopted the log buffer district different with traditional sequential log pattern to distribute strategy, thereby has solved current log buffer page or leaf in the sequential log pattern influences system performance because of serious accessing competition problem effectively.
Fig. 6 is the comparative result of three kinds of fault recovery method NFRS, SPFRS and TFRS downtime under different TArrRate.As can be seen, when TArrRate increased, the downtime of three kinds of fault recovery methods correspondingly increased, and this is because when TArrRate increases, and the also corresponding reason that increases with data of nested real-time transactions that the back requirement recovers takes place fault.Also can see simultaneously, than SPFRS and TFRS, the downtime of NFRS is littler, this is because NFRS selects to have carried out optimization process with execution sequence to the Redo starting point, and removed from expired temporal data object Redo operation, thereby more performance has been arranged on downtime than SPFRS and TFRS.

Claims (1)

1. the fault recovery method of database under the nested real-time transactions model is characterized in that this method comprises:
The first, the foundation of log record types and logical organization in the nested real-time transactions
Executing rule characteristics according to nested real-time transactions NRTT, log record types is designed to five kinds, be respectively: affairs begin log record Begin, rewrite log record Redo, the affairs log record Abort that dies young, subtransaction submits to log record Sub_Commit and affairs to submit log record Commit to, and its logical organization is respectively:
Begin
Figure FSA00000063554100011
Redo
Figure FSA00000063554100012
Sub-Commi
Figure FSA00000063554100013
Commit
Figure FSA00000063554100014
Abort
Figure FSA00000063554100015
Wherein, ID is a NRTT sign, is used for each NRTT of unique sign, belongs to the affairs of same NRTT, comprises that root affairs, internal affairs and leaf affairs have identical ID; TID is a Transaction Identifier, is used for each affairs among the unique identification NRTT; P-TID is the Transaction Identifier of TID father's affairs, if TID is the root affairs, then P-TID is changed to null; B, R, SC, C, A represents Begin respectively, Redo, Sub_Commit, five kinds of log record types of Commit and Abort; LT represents the length of Redo log record, scale value during logic when TS represents that the Redo log record is created, the target initial value is made as 0 during logic, whenever a Redo log record is created, target value just adds 1 in proper order during logic, RID represents to be updated the sign of data object, and BN represents the logical block number (LBN) of counterfoil outside the RID place, and AI represents that the value after data object is updated also claims the back reflection; VTI represents the significant instant of temporal data object, i.e. VTI=ST+VP, and here, ST represents the sampling instant of temporal data object, and VP represents the temporal data object term of validity, and for non-temporal data, VTI is changed to infinity;
The second, the foundation of daily record execution model, this daily record execution model comprises:
Carry out engine modules: be used to carry out each transaction operation, comprise that affairs begin, upgrade operation, affairs submission, subtransaction submission, affairs and die young;
Log management module Logger: be responsible for each NRTT individually the allocation activities log area, create corresponding log record, be responsible for simultaneously creating and maintenance activity transaction table ATL, after the submission log record of the root affairs of a NRTT was written into corresponding activity log district, Logger was responsible for the content in its activity log district just is refreshed to the Disk Logs file; ATL be used for writing down current all enliven the status information of NRTT and all subtransactions thereof, enlivening NRTT is to have begun to carry out, but the root affairs are not finished the NRTT that submits to or die young as yet, Logger enlivens NRTT for each and safeguard a list item in ATL, and set up the corresponding state chained list for its all subtransactions that comprise, its logical organization is as follows:
Figure FSA00000063554100016
Wherein, ID is the NRTT sign; Scale value when FTS represents the logic of the first Redo log record of NRTT, if NRTT is read-only affairs, FTS is changed to-1; TID is a subtransaction sign, and Status represents the subtransaction current state, and the subtransaction current state comprises: enliven Active, submit Sub-Commit to and three kinds of the Abort of dying young;
The activity log district: this model distributes interim log buffer page or leaf individually for each NRTT, abbreviates the activity log district as; To each transaction operation, the activity log subregion that log management module (Logger) is responsible under current execution NRTT is created corresponding log record for it, have only after the submission log record of the root affairs of a NRTT is written into corresponding activity log district, the content in its activity log district just is refreshed to the Disk Logs file;
Private data buffer zone: the data object that is used to deposit NRTT read-write before the root affairs are submitted to;
System data buffer: be the buffer memory of data in internal memory that maybe will be used in the disk database, when the root affairs of a NRTT were submitted to, the data in its private data buffer zone were refreshed to system data buffer;
Disk database and Disk Logs file: for internal memory, we will quarter at the database of disk and the set of log record is called disk database and Disk Logs file;
Three, the analysis phase after the real-time data base fault takes place, promptly determine the Redo starting point
Recovery processing procedure after the real-time dataBase system fault takes place mainly is divided into two stages: analysis phase and reforming the Redo stage;
In the analysis phase, at first determine that by analyzing daily record the check point LS_Checkpoint that preceding the last time completes successfully takes place fault, promptly the End_Checkpoint record has write the last check point of Disk Logs file;
The relative position relation on time shaft according to NRTT and check point LS_Checkpoint, determine whether the Redo that to reform, the NRTT that has been refreshed to system data buffer for renewal before writing the Disk Logs file at the Begin_Checkpoint of LS_Checkpoint record need not Redo, the necessary Redo of all the other NRTT; Need the NRTT of Redo to navigate to the NRTT of FTS minimum in scanning, be the starting point of reforming, and the FTS that this is minimum is designated as MinFTS;
Four, the Redo stage after the real-time data base fault takes place
In the Redo stage, according to the starting point of reforming that the analysis phase is determined, carry out redo operation, at first SDB is returned to nearest coherency state, do not carry out the Redo operation for expired temporal data;
Be without loss of generality, the Redo log record that scale value equals MinFTS when supposing logic in the Disk Logs file is designated as RedoLogT; The implementation algorithm in Redo stage is described below:
Procedure?RedoRecovery(long?int?MinFTS)
Input:MinFTS represents FTS. minimum among T2 and the T12 class NRTT
Begin
1:Temp=MinFTS;
2:While(Temp<CTS)
3: from the RedoLog of journal file TLog record rises, the forward scan journal file;
4 : IF ( &Exists; RedoLog Ti ( ( RedoLog Ti &CenterDot; TS = = Temp ) ^ ( RedoLog Ti &CenterDot; VTI > T C ) ) )
5:Switch(Class)
6:Case?Sub_transaction:
7 : IF ( ( &Exists; CommitLog Ti ) ^ ( &Exists; LocalCommitLog Ti ) )
8:Redo(RedoLog Ti);
9:Case?Root_transaction:
10 : IF ( &Exists; CommitLog Ti )
11:Redo(RedoLog Ti);
12:Case?default:break;
13:Temp++;
End
In above-mentioned implementation algorithm, scale value determines to carry out the order of Redo operation during according to the logic of Redo log record;
In above-mentioned implementation algorithm is described, target value during logic when CTS represents to carry out check point; T CExpression system current time; RedoLog TiExpression nested real-time transactions T iA Redo log record; RedoLog Ti.TS represent RedoLog TiLogic the time scale value; RedoLog Ti.VTI represent RedoLog TiThe significant instant of the data object of record; Class represents T iClassification, represent T with Sub_transaction here iBe subtransaction, and Root_transaction represents T iBe the root affairs; CommitLog TiThe Commit log record of expression root affairs; LocalCommitLog TiThe LocalCommit log record of expression subtransaction; Process Redo (RedoLog Ti) be responsible for RedoLog TiThe data object of record covers with its back reflection.
CN 201010132651 2010-03-26 2010-03-26 Real-time database failure recovery method under nested transaction model Pending CN101794247A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010132651 CN101794247A (en) 2010-03-26 2010-03-26 Real-time database failure recovery method under nested transaction model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010132651 CN101794247A (en) 2010-03-26 2010-03-26 Real-time database failure recovery method under nested transaction model

Publications (1)

Publication Number Publication Date
CN101794247A true CN101794247A (en) 2010-08-04

Family

ID=42586957

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010132651 Pending CN101794247A (en) 2010-03-26 2010-03-26 Real-time database failure recovery method under nested transaction model

Country Status (1)

Country Link
CN (1) CN101794247A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102385611A (en) * 2010-08-27 2012-03-21 微软公司 Reducing locking during database transactions
CN102708143A (en) * 2011-03-18 2012-10-03 微软公司 Tracking redo completion at a page level
CN102760161A (en) * 2012-06-12 2012-10-31 天津神舟通用数据技术有限公司 Log organization structure clustered based on transaction aggregation and method for realizing corresponding recovery protocol thereof
CN103049546A (en) * 2012-12-27 2013-04-17 华为技术有限公司 Method and device for managing and accessing system logs
WO2013091162A1 (en) * 2011-12-19 2013-06-27 华为技术有限公司 Method, device, and system for recovering distributed storage data
WO2014153940A1 (en) * 2013-03-26 2014-10-02 华为技术有限公司 Method and apparatus for processing redo data of database
CN104537037A (en) * 2014-12-23 2015-04-22 杭州华为数字技术有限公司 Method and device for processing database logs
US9501386B2 (en) 2014-12-26 2016-11-22 Microsoft Technology Licensing, Llc System testing using nested transactions
CN106843000A (en) * 2017-02-13 2017-06-13 华北电力大学(保定) Climbing robot mobile control system restoration methods
CN107544859A (en) * 2017-07-12 2018-01-05 上海交通大学 It is used for ensureing the inspection point methods of data consistency on mixing memory system
CN108520069A (en) * 2018-04-13 2018-09-11 郑州云海信息技术有限公司 A kind of database high availability implementation method and database server
CN108647112A (en) * 2018-03-16 2018-10-12 阿里巴巴集团控股有限公司 The method, apparatus and distributing real time system system of data backup
CN108664359A (en) * 2018-05-23 2018-10-16 上海达梦数据库有限公司 A kind of database restoring method, device, equipment and storage medium
CN109271277A (en) * 2017-07-17 2019-01-25 阿里巴巴集团控股有限公司 Access method, device and system after database delay machine
CN112208579A (en) * 2020-09-24 2021-01-12 交控科技股份有限公司 FAO log transmission method and FAO system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090287874A1 (en) * 2008-05-13 2009-11-19 Microsoft Corporation Flash Recovery Employing Transaction Log

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090287874A1 (en) * 2008-05-13 2009-11-19 Microsoft Corporation Flash Recovery Employing Transaction Log

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《计算机集成制造系统》 20090131 肖迎元等 嵌套事务模型下实时数据库故障处理策略 175-177 1 第15卷, 第1期 2 *

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102385611A (en) * 2010-08-27 2012-03-21 微软公司 Reducing locking during database transactions
CN102708143A (en) * 2011-03-18 2012-10-03 微软公司 Tracking redo completion at a page level
US9384100B2 (en) 2011-03-18 2016-07-05 Microsoft Technology Licensing, Llc Tracking redo completion at a page level
CN102708143B (en) * 2011-03-18 2018-05-15 微软技术许可有限责任公司 Completion is reformed in the tracking of page level
WO2013091162A1 (en) * 2011-12-19 2013-06-27 华为技术有限公司 Method, device, and system for recovering distributed storage data
CN102760161A (en) * 2012-06-12 2012-10-31 天津神舟通用数据技术有限公司 Log organization structure clustered based on transaction aggregation and method for realizing corresponding recovery protocol thereof
CN103049546A (en) * 2012-12-27 2013-04-17 华为技术有限公司 Method and device for managing and accessing system logs
CN103049546B (en) * 2012-12-27 2016-01-13 华为技术有限公司 The method and apparatus of a kind of management, access system daily record
WO2014153940A1 (en) * 2013-03-26 2014-10-02 华为技术有限公司 Method and apparatus for processing redo data of database
US10387258B2 (en) 2013-03-26 2019-08-20 Huawei Technologies Co., Ltd. Method and apparatus for processing redo data in database
CN104537037B (en) * 2014-12-23 2018-01-23 杭州华为数字技术有限公司 A kind of method and device of processing data storehouse daily record
CN104537037A (en) * 2014-12-23 2015-04-22 杭州华为数字技术有限公司 Method and device for processing database logs
US9501386B2 (en) 2014-12-26 2016-11-22 Microsoft Technology Licensing, Llc System testing using nested transactions
CN106843000A (en) * 2017-02-13 2017-06-13 华北电力大学(保定) Climbing robot mobile control system restoration methods
CN106843000B (en) * 2017-02-13 2019-03-26 华北电力大学(保定) Climbing robot mobile control system restoration methods
CN107544859A (en) * 2017-07-12 2018-01-05 上海交通大学 It is used for ensureing the inspection point methods of data consistency on mixing memory system
CN109271277B (en) * 2017-07-17 2022-03-08 阿里巴巴集团控股有限公司 Access method, device and system after database downtime
CN109271277A (en) * 2017-07-17 2019-01-25 阿里巴巴集团控股有限公司 Access method, device and system after database delay machine
CN108647112A (en) * 2018-03-16 2018-10-12 阿里巴巴集团控股有限公司 The method, apparatus and distributing real time system system of data backup
CN108520069A (en) * 2018-04-13 2018-09-11 郑州云海信息技术有限公司 A kind of database high availability implementation method and database server
CN108664359B (en) * 2018-05-23 2020-12-29 上海达梦数据库有限公司 Database recovery method, device, equipment and storage medium
CN108664359A (en) * 2018-05-23 2018-10-16 上海达梦数据库有限公司 A kind of database restoring method, device, equipment and storage medium
CN112208579A (en) * 2020-09-24 2021-01-12 交控科技股份有限公司 FAO log transmission method and FAO system
CN112208579B (en) * 2020-09-24 2022-09-02 交控科技股份有限公司 FAO log transmission method and FAO system

Similar Documents

Publication Publication Date Title
CN101794247A (en) Real-time database failure recovery method under nested transaction model
CN111143389B (en) Transaction execution method and device, computer equipment and storage medium
CN108804112B (en) Block chain settlement processing method and system
CN109739935B (en) Data reading method and device, electronic equipment and storage medium
CN113396407A (en) System and method for augmenting database applications using blockchain techniques
US20200034373A1 (en) Distributed database transaction protocol
US10747745B2 (en) Transaction execution commitment without updating of data row transaction status
CN106030533B (en) It is executed by split process and retries affairs automatically
Bernstein et al. Timestamp-Based Algorithms for Concurrency Control in Distributed Database Systems.
CN111190935B (en) Data reading method and device, computer equipment and storage medium
JP4586019B2 (en) Parallel recovery with non-failing nodes
US20140330767A1 (en) Scalable distributed transaction processing system
JP5343399B2 (en) Management program, management method, and management apparatus
CN105069134A (en) Method for automatically collecting Oracle statistical information
US20110055151A1 (en) Processing Database Operation Requests
CN109933632B (en) Data migration method, device and equipment for database
CN102760161A (en) Log organization structure clustered based on transaction aggregation and method for realizing corresponding recovery protocol thereof
Padhye et al. Scalable transaction management with snapshot isolation on cloud data management systems
Agrawal et al. A nonblocking quorum consensus protocol for replicated data
WO2003001405A1 (en) Method and system for performing concurrency control in a relational database
CN102339305A (en) Database cluster failure recovery method on basis of partial ordering relation logs
JP2023546818A (en) Transaction processing method, device, electronic device, and computer program for database system
Li et al. Leopard: A Black-Box Approach for Efficiently Verifying Various Isolation Levels
JP2001229063A (en) Data managing system
JPH10232809A (en) Transaction processing system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20100804