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

Log replay method and device, server and storage medium

A server and log technology, applied in the database field, can solve the problems that the replay performance cannot be guaranteed, the processing efficiency cannot meet the demand, and the merge sort cannot be completed, and achieves the effect of improving the replay efficiency and performance.

Active Publication Date: 2019-11-12
SHANGHAI DAMENG DATABASE
View PDF6 Cites 15 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

In the prior art, a feasible method is to merge and sort the multi-channel REDO logs after receiving the REDO logs from the master database, and then replay the REDO logs in sequence. However, this method has the following problems: because there are multiple The REDO logs of the database instances are independent. When the standby database receives the REDO logs generated by a data instance, it needs to know whether other database instances have generated the REDO logs. Replay after merging and sorting, the processing efficiency cannot meet the demand, and the replay performance cannot be guaranteed

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
  • Log replay method and device, server and storage medium
  • Log replay method and device, server and storage medium
  • Log replay method and device, server and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0046] figure 1 It is a flow chart of the log replay method in Embodiment 1 of the present invention. This embodiment is applicable to the case of performing log replay on redo logs in the database. This method can be executed by a log replay device configured in the master database. The device may be implemented in software and / or hardware, for example, the device may be configured in a server.

[0047] figure 2It is a schematic diagram of the data guard system in Embodiment 1 of the present invention, and the data guard system is only an example, and there may be multiple standby databases. The data guardian system in the figure includes a primary database 101 and a standby database 102, wherein the primary database 101 is a shared storage database cluster including two database instances, the primary database 101 includes database instance 1 and database instance 2, each database Instances generate and manage their own redo logs independently. The primary database 101 c...

Embodiment 2

[0070] Figure 4 It is a flow chart of the log playback method in Embodiment 2 of the present invention. This embodiment is applicable to the case of performing log replay on the redo logs in the database. The method can be executed by a log replay device configured in the standby database, and the device can be realized by software and / or hardware. For example, the The device can be configured in a server. Such as Figure 4 As shown, the method of this embodiment specifically includes:

[0071] S210. Obtain redo logs sent by the primary database.

[0072] Wherein, redo logs may include page synchronization redo logs and regular redo logs.

[0073] S220. Whether the redo log is a page synchronization redo log.

[0074] According to the log type of the redo log, perform log replay on the redo log, first determine the log type of the redo log, that is, determine whether the redo log is a page synchronization redo log according to the log content, if the redo log is a page s...

Embodiment 3

[0084] Figure 5 It is a schematic structural diagram of the log replay device in Embodiment 3 of the present invention. The log replay device can be set in the master database. This embodiment is applicable to the case of log replay for redo logs in the database. The log replaying device provided in the embodiment of the present invention can execute the log replaying method provided in the first embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.

[0085] The device specifically includes a log generating module 310 and a log sending module 320, wherein:

[0086] The log generating module 310 is configured to generate a redo log when it is determined that the current database instance modifies the target data page for the first time, wherein the redo log includes page synchronization redo logs and conventional redo logs;

[0087] The log sending module 320 is configured to send the redo log to the sta...

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 embodiment of the invention discloses a log replay method and device, a server and a storage medium. The method is applied to a main database. The method comprises: if it is determined that a current database instance modifies a target data page for the first time, generating a redo log, and the redo log comprising a page synchronization redo log and a conventional redo log; and sending the redo log to the standby database to enable the standby database to perform log replay according to the log type of the redo log. According to the embodiment of the invention, when the main database generates the redo log, a new redo log type of the page synchronization redo log is added, so that the standby database can process the redo log except the page synchronization redo log in parallel according to the log type without additional logic judgment, and the replay efficiency and performance of the standby database are greatly improved.

Description

technical field [0001] The embodiments of the present invention relate to the technical field of databases, and in particular to a log replay method, device, server and storage medium. Background technique [0002] Relational database management systems usually use redo (REDO) logs to ensure the persistence of transactions. Any operation that modifies data will generate REDO logs inside the system, and ensure that the modified data pages are written to disk only after the REDO logs are flushed. The log sequence number (Log Sequence Number, LSN) is a BIGINT type value maintained inside the relational database management system, which is used to identify REDO log records. Each LSN value represents a collection of a series of data modification operations within the relational database management system. [0003] In a single-node database (that is, a database including a database instance), the LSN value has the characteristics of continuous increment and global uniqueness. When...

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): G06F16/18G06F16/182G06F16/28
CPCG06F16/284G06F16/1815G06F16/182
Inventor 韩朱忠王巍王海龙
Owner SHANGHAI DAMENG DATABASE
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