Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method and device for redoing logs of database records

A database and log technology, applied in the computer field, can solve problems affecting the processing speed of the database system, system bottlenecks, etc.

Active Publication Date: 2013-02-27
深圳华为云计算技术有限公司
View PDF3 Cites 23 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] In the process of database application, it is often the case that multiple transactions are executed in parallel. At this time, there may be multiple threads (or processes) requesting to record logs at the same time, or it may be during the process of recording a log in the redo cache Other logging requests are received. For these cases, under the existing processing mechanism using mutex locks, only one operation is allowed to log in the redo cache at the same time, and the subsequent logs must wait for the previous log records. Recording can only be started after completion, which will cause a system bottleneck and affect the processing speed of the database system

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for redoing logs of database records
  • Method and device for redoing logs of database records
  • Method and device for redoing logs of database records

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0096] The embodiment of the present invention provides a method for database recording redo log, refer to figure 1 , the processing flow of this method may include:

[0097] Step 101, receiving a log record request, where the log record request carries a transaction identifier and log information.

[0098] Step 102, judging whether the log record request is the first log record request corresponding to the transaction identifier, if yes, execute step 103, otherwise, execute step 104.

[0099] Step 103, select part of the cache space in the redo cache, create a transaction cache block corresponding to the transaction ID, and record the log information and the corresponding global sequence information into the transaction cache block. Wherein, the global sequence information records the time sequence of the log information among all the log information.

[0100] Step 104, determine the currently used transaction cache block among the established transaction cache blocks corre...

Embodiment 2

[0104] The embodiment of the present invention provides a method for recording redo logs in a database, and the processing flow can be as follows figure 1 As shown, the execution subject of this method can be CPU (Central Processing Unit, central processing unit), and the following will figure 1 The process is described in detail, the specific content is as follows:

[0105] In step 101, a log record request is received, and the log record request carries a transaction identifier and log information.

[0106] A transaction can include one or more operations. When a transaction operates on a database, it needs to record a corresponding log, and can send a log record request to the CPU. Among them, the transaction identifier is used to identify the transaction corresponding to the log, and the log information is the content of the operation corresponding to the log, for example, modify value1 (value 1) corresponding to key1 (primary key 1) to value1'.

[0107] Step 102 , judgi...

Embodiment 3

[0134] The embodiment of the present invention provides a kind of method for database record redo log, and the executive subject of this method can be CPU, and the concrete content of this method can be as follows:

[0135] When a transaction start notification carrying a transaction identifier is received, a part of the cache space is selected in the redo cache, and a transaction cache block corresponding to the transaction identifier is established. Wherein, the global sequence information records the time sequence of the log information in all log information. After the transaction cache block is established, the newly established transaction cache block can be set as the currently used transaction cache block. Specifically, for the establishment process of the transaction cache block, reference may be made to the specific content of step 103 in the second embodiment, which will not be repeated here.

[0136] When a log record request carrying a transaction identifier and ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method and device for redoing logs of database records, and belongs to the technical field of computers. The method comprises the following steps of receiving a log record request, wherein the log record request carries a transaction identifier and log information; judging the log record request to determine whether the log record request is the first log record request corresponding to the transaction identifier; if the log record request is the first log record request, selecting part of buffer space from a redone buffer, establishing an transaction buffer block corresponding to the transaction identifier, and recording the log information and the corresponding global sequence information into the transaction buffer block; if the log record request is not the first log record request, determining the transaction buffer block currently used in the established transaction buffer block corresponding to the transaction identifier, and recording the log information and the corresponding global sequence information into the transaction buffer block; and during occurrence of the preset trigger transaction, sustaining the log information in the redone buffer. The method and the device have the advantage that the processing speed of a database system can be increased.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to a method and a device for recording redo logs in a database. Background technique [0002] Data persistence is a very extensive and commonly used technology in the software field, especially in the database field. The operation on the database is carried out in the form of transaction processing, and the transaction of the database refers to a series of operations performed as a single logical unit of work. Transaction processing ensures that data in the database is not permanently updated unless all operations within the logical unit of work that process the transaction complete successfully. By grouping a group of related operations into an all-success-or-fail transaction, you can simplify error recovery and improve application reliability. [0003] In order to ensure the recoverability of the database, all modifications to the database will record the redo (redo) log in th...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F17/30
Inventor 陈志标彭勇飞吴程宏
Owner 深圳华为云计算技术有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products