Transaction log processing method, storage medium and equipment

By reading transaction logs from redo points and repairing incomplete data pages, the database recovery process is optimized, and the long recovery problem caused by data loss is solved, database recovery efficiency is improved and recovery time is shortened.

CN120276915APending Publication Date: 2025-07-08CETC JINCANG (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311865401.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

During the database main and backup synchronization process, when the page mirror data separation of transaction logs leads to data loss, the existing technology needs to start recovery from basic backup, which is a long recovery process, affecting the database recovery efficiency.

Method used

By reading the transaction log from the redo point, obtaining and checking the integrity of the data page, repairing incomplete data pages, optimizing the path to find valid pages from the main and backup database cluster, page mirror files, and basic backups, and shortening recovery time.

Benefits of technology

It significantly improves database recovery efficiency, shortens recovery time, reduces the amount of playback transaction logs, and prevents abnormal data spread.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120276915A_ABST
    Figure CN120276915A_ABST
Patent Text Reader

Abstract

The invention provides a transaction log processing method, a storage medium and equipment. The transaction log processing method comprises the following steps: reading a transaction log from a redo point; obtaining each data page corresponding to the transaction log; checking whether each data page is complete or not; and if not, repairing the incomplete data page. Compared with recovery starting from basic backup, the method has the advantages that incomplete data pages can be directly recovered, the amount of transaction logs needing to be replayed for recovery is greatly reduced, the recovery efficiency of the database can be remarkably improved, and the recovery duration can be shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data synchronization, and particularly to a method for processing transaction logs, a storage medium, and a device. Background Art

[0002] Database clusters usually adopt a synchronous streaming replication mode to keep the data of the primary and standby databases strictly consistent. However, when the primary database is under heavy business pressure, a large amount of XLOG logs will be generated. At this time, the synchronous streaming replication mode is likely to become a performance bottleneck of the database.

[0003] To solve the above problems, the page mirror data (page data) of the transaction log can be separated and continuously stored in the page mirror file, and then the disk write I / O of a large number of small and random page mirror files can be transformed into fewer and sequential disk write I / O to improve the disk write efficiency of the page data of the XLOG.

[0004] The inventors have recognized that when the separated page mirror data is lost (such as planned cleaning, misoperation, etc.), during the replay of the XLOG log, there may be a situation where page breaks occur and the corresponding page data file cannot be found, and it is inevitable to start recovery from the most recent base backup.

[0005] However, when the base backup is far from the target recovery point, even if the method of repairing the page mirror data of the XLOG log while recovering the database is adopted, it is still a relatively long process (possibly several hours or even dozens of hours) to successfully recover from the base backup once.

[0006] The above information disclosed in this background art is only used to increase the understanding of the background art of the present application. Therefore, it may include prior art that is not known to those of ordinary skill in the art. Summary of the Invention

[0007] In view of the above problems, the present invention provides a method for processing a database, a storage medium, and a device that can overcome or partially solve the above problems.

[0008] One object of the first aspect of the present invention is to improve the data recovery efficiency and significantly shorten the recovery time.

[0009] Another object of the first aspect of the present invention is to reasonably set the search strategy and path for valid pages.

[0010] Specifically, according to the first aspect of the present invention, the present invention provides a method for processing transaction logs, including:

[0011] Read a transaction log from the redo point;

[0012] Obtain each data page corresponding to the transaction log;

[0013] Check whether each of the data pages is complete;

[0014] If not, repair the incomplete data pages.

[0015] Optionally, the step of repairing the incomplete data pages includes:

[0016] Prevent the database from modifying and reading the incomplete data pages;

[0017] Find a valid page corresponding to the incomplete data page in the database;

[0018] At least repair the valid page to the same version as the incomplete data page.

[0019] Optionally, the step of finding a valid page corresponding to the incomplete data page in the database includes:

[0020] Sequentially find a valid page corresponding to the incomplete data page in the primary and standby database clusters of the database, in the page mirror file, and in the base backup.

[0021] Optionally, the step of at least repairing the valid page to the same version as the incomplete data page includes:

[0022] Obtain the sequence number of the transaction log that last modified the valid page from the valid page;

[0023] Redo the corresponding transaction log starting from the actual recovery start point of the base backup;

[0024] Check whether the sequence number of the last redone transaction log is greater than or equal to the sequence number corresponding to the incomplete data page;

[0025] If so, determine that the incomplete data page has been successfully repaired.

[0026] Optionally, the step of redoing the corresponding transaction log starting from the actual recovery start point of the base backup includes:

[0027] Read a transaction log from the actual recovery start point of the base backup;

[0028] Check whether the transaction log involves the valid page;

[0029] If so, apply the modification to the valid page recorded in the transaction log to the valid page.

[0030] Optionally, after the step of applying the modification to the valid page recorded in the transaction log to the valid page, it further includes:

[0031] Check whether the sequence number of the transaction log is greater than or equal to the sequence number corresponding to the incomplete data page;

[0032] If so, record the sequence number of the last redo transaction log, and then perform the step of checking whether the sequence number of the last redo transaction log is greater than or equal to the sequence number corresponding to the incomplete data page;

[0033] If not, read the next transaction log.

[0034] Optionally, before the step of reading the next transaction log, it further includes:

[0035] Check whether there is a next transaction log;

[0036] If so, perform the step of reading the next transaction log, and then perform the step of checking whether the transaction log involves the valid page;

[0037] If not, record the sequence number of the last redo transaction log, and then perform the step of checking whether the sequence number of the last redo transaction log is greater than or equal to the sequence number corresponding to the incomplete data page.

[0038] Optionally, after the step of repairing the incomplete data page, it further includes:

[0039] Judge whether the traversal of the transaction log is completed;

[0040] If so, end the redo process of the transaction log;

[0041] If not, read the next transaction log.

[0042] According to the second aspect of the present invention, the present invention provides a machine-readable storage medium, on which a machine-executable program is stored, and when the machine-executable program is executed by a processor, any one of the above-mentioned transaction log processing methods is implemented.

[0043] According to the second aspect of the present invention, the present invention provides a computer device, including a memory, a processor, and a machine-executable program stored on the memory and running on the processor, and when the processor executes the machine-executable program, any one of the above-mentioned transaction log processing methods is implemented.

[0044] The method for processing the transaction log of the present invention first reads a transaction log from the redo point, then obtains each data page corresponding to the transaction log, and then checks whether each data page is complete. If not, the incomplete data page is repaired. In this way, compared with restoring from the base backup, the present invention can directly repair the incomplete data page, greatly reducing the amount of transaction logs that need to be replayed during restoration, significantly improving the restoration efficiency of the database, and shortening the restoration duration.

[0045] Further, in the method for processing the transaction log of the present invention, during the process of searching for valid pages corresponding to the incomplete data pages in the database, the valid pages corresponding to the incomplete data pages can be searched for in the primary and standby database clusters of the database, the page mirror file, and the base backup in sequence. Among them, the speed of searching for valid pages in the primary and standby database clusters is the fastest, the speed of searching for valid pages in the page mirror file is the second fastest, and the speed of searching for valid pages in the base backup is the slowest, optimizing the search strategy and path for valid pages.

[0046] Through the following detailed description of the specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more clear about the above and other objects, advantages, and features of the present invention. Description of the Drawings

[0047] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present invention. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0048] Figure 1 is a schematic diagram of the method for processing the transaction log according to an embodiment of the present invention;

[0049] Figure 2 is a schematic structural diagram of the transaction log restoration range according to an embodiment of the present invention;

[0050] Figure 3 is a schematic diagram of the positional relationship between the redo point and the checkpoint log according to an embodiment of the present invention;

[0051] Figure 4 is a schematic diagram of at least restoring the valid page to the same version as the incomplete data page;

[0052] Figure 5 is a flowchart of at least restoring the valid page to the same version as the incomplete data page;

[0053] Figure 6 is a schematic diagram of a machine-readable storage medium according to an embodiment of the present invention;

[0054] Figure 7 Schematic diagram of a computer device according to an embodiment of the present invention. Detailed implementation manners

[0055] Those skilled in the art should understand that the embodiments described below are only a part of the embodiments of the present invention, rather than all the embodiments of the present invention. These embodiments are intended to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention. Based on the embodiments provided by the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts should still fall within the protection scope of the present invention.

[0056] It should be noted that the logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a fixed sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in combination with these instruction execution systems, apparatus, or devices.

[0057] In a database, the transaction log actually refers to the XLOG log, also called the WAL (write ahead log) log. A very important function of the XLOG log is to build a primary and standby database cluster. When the primary machine fails, the standby machine can immediately become the primary and take over the primary machine to continue providing services externally.

[0058] In the present invention, to reduce the data volume of the XLOG log, a page mirror file, that is, the pagedata file, can be pre-created in the database. During the assembly stage of the XLOG log, the page mirror data (page data) in the XLOG log is separated and continuously stored in the page data file.

[0059] For example, the newly generated XLOG log files are stored in the sys_wal directory. Create a directory under the sys_wal directory (such as named wal_pagedata), and create a corresponding page mirror file (page data file) in the wal_pagedata directory for each page data that needs to be retained in the XLOG log. Each page data and its related data are stored in a separate page data file.

[0060] As mentioned above, when the separated page mirror data is lost (such as planned cleaning, misoperation, etc.), during the replay of the XLOG log, page breaks may occur and the corresponding page data file cannot be found. Inevitably, it is necessary to start the recovery from the most recent base backup.

[0061] However, when the base backup is far from the target recovery point, even if the method of repairing the page mirror data of the XLOG log while recovering the database is adopted, it is still a relatively long process (possibly several hours or even dozens of hours) to successfully recover from the base backup once.

[0062] To solve the above problems, the present invention provides a method for processing transaction logs. Figure 1 It is a schematic diagram of a method for processing transaction logs according to an embodiment of the present invention, as Figure 1 shown, the method for processing transaction logs at least includes the following steps S102 to step S108.

[0063] Step S102, read a transaction log from the redo point.

[0064] Step S104, obtain each data page corresponding to the transaction log.

[0065] Step S106, check whether each data page is complete.

[0066] Step S108, if not, repair the incomplete data pages.

[0067] For the method for processing transaction logs in this embodiment, compared with starting the recovery from the base backup, the present invention can directly repair the incomplete data pages, greatly reducing the amount of transaction logs that need to be replayed during recovery, and can significantly improve the recovery efficiency of the database and shorten the recovery duration.

[0068] Before reading a transaction log from the redo point, the XLOG log range to be recovered can be determined first. As Figure 1 shown, the lsn (Log Sequence Number) corresponding to the recovery target can be recorded as recovery_target, the starting point of the recovery based on the base backup can be recorded as b_recovery_begin, and the starting point of the recovery in this embodiment can be recorded as cur_recovery_begin, as Figure 1 shown. Obviously, during the recovery of the database, the amount of XLOG logs that need to be replayed in this embodiment is much less than the amount of XLOG logs that need to be replayed when starting the recovery from the base backup.

[0069] The exact recovery start point can be further located. In a database, it is usually a redo point recorded in a checkpoint log, and its position is denoted as redo_lsn, as Figure 2 shown. The position information of this checkpoint log can be recorded in the control file of the database.

[0070] It should be noted that the redo point is a special point in the XLOG log. Before this point, all the data in the database is the same as the information reflected in the flushed XLOG log. During the creation of a checkpoint, a special XLOG log (checkpoint log) will be created, and a redo point will be recorded in this XLOG log. Only when the XLOG log and user data before this redo point are both flushed to disk can the checkpoint be successfully created. When the database crashes, a redo point can be found from the most recent checkpoint log, and the XLOG log can be replayed from this redo point to restore the database.

[0071] In an example, the first XLOG log is read from redo_lsn, then the data pages that need to apply the content of the current XLOG log are obtained, and then it is checked whether these data pages are complete. For example, a CRC (Cyclical Redundancy Check) is performed on the data pages. If the data pages are all complete, the content of the current XLOG log can be directly applied to these data pages. If the data pages are incomplete, the problematic data pages need to be repaired.

[0072] In an alternative embodiment, the steps to repair incomplete data pages can be to prevent the database from modifying and reading the incomplete data pages, find the valid pages corresponding to the incomplete data pages in the database, and at least repair the valid pages to the same version as the incomplete data pages.

[0073] The incomplete data pages in this embodiment refer to damaged or missing data pages, and the valid pages refer to normal or healthy data pages. By preventing the database from modifying and reading the incomplete data pages, the spread of abnormal data can be prevented, avoiding further data damage or inconsistency. After obtaining the valid pages, they cannot be directly replaced, but the XLOG log is used to make the obtained valid pages at least reach the same version as the incomplete data pages.

[0074] In an alternative embodiment, the steps to find the valid pages corresponding to the incomplete data pages in the database can be to sequentially find the valid pages corresponding to the incomplete data pages in the primary and standby database clusters of the database, in the page mirror file, and in the base backup.

[0075] That is to say, this embodiment provides three methods for finding the valid page corresponding to the incomplete data page in the database. The order of using these three methods is related to their time consumption. Generally, the first method takes the shortest time, the second method takes the second shortest time, and the last method will only be used in the worst case because it is time-consuming to replay the XLOG log starting from the base backup. By searching for the valid page in the primary and standby database clusters of the database, the page mirror file, and the base backup in sequence, the search strategy and path can be optimized.

[0076] In a specific implementation, the lsn of the XLOG log being replayed when the incomplete data page is found can be recorded as cur_lsn, the incomplete data page can be recorded as cur_page, and the starting lsn of the XLOG log that needs to be replayed to repair cur_page can be recorded as real_recovery_begin.

[0077] The steps for finding the valid page corresponding to the incomplete data page in the primary and standby database clusters of the database can be as follows: Check whether it is currently the primary and standby database cluster. If it is the primary and standby database cluster, search for the valid page corresponding to cur_page in the data disks of other databases in the cluster (search by RelFileNode and BlockNumber). Here, RelFileNode is the position of the valid page in the data disk in the table to which it belongs, and BlockNumber is the block number of the valid page in the table to which it belongs. If found, the valid page can be transmitted to the current database through the network, and then the step of obtaining the sequence number of the transaction log that last modified the valid page from the valid page can be executed. If it is not the primary and standby database cluster or the valid page is not found in the primary and standby database cluster, search in the page data file.

[0078] The steps for finding the valid page corresponding to the incomplete data page in the page data file can be as follows: Search by the file name RelFileNode_BlockNumber_lsn of the page data. Here, lsn is cur_lsn. If found, execute the step of obtaining the sequence number of the transaction log that last modified the valid page from the valid page in the following text. If not found, search in the base backup.

[0079] The steps to find the valid page corresponding to the incomplete data page from the base backup can be as follows: Check if there is a base backup. If there is a base backup, find the valid page corresponding to cur_page from the base backup. If found, execute the steps of redoing the corresponding transaction log starting from the actual recovery start point of the base backup in the following text. If not found, it means that this cur_page was generated after the base backup. To repair cur_page, it is necessary to replay the XLOG log starting from the base backup (real_recovery_begin = b_recovery_begin). If there is no base backup, then this data page cannot be repaired, and an error prompt can be issued.

[0080] In an alternative embodiment, referring to Figure 4 , at least repairing the valid page to the same version as the incomplete data page may include the following steps:

[0081] Step S402, obtain the sequence number of the transaction log that last modified the valid page from the valid page.

[0082] Step S404, start redoing the corresponding transaction log from the actual recovery start point of the base backup.

[0083] Step S406, check whether the sequence number of the last redone transaction log is greater than or equal to the sequence number corresponding to the incomplete data page. If so, execute Step S408. If not, execute Step S410.

[0084] Step S408, determine that the incomplete data page has been successfully repaired.

[0085] Step S410, the repair fails.

[0086] It can be understood that in Step S410, the reason for the repair failure is that the replay of the transaction log stopped before cur_lsn, so it is impossible to determine whether cur_page has been repaired.

[0087] In an alternative embodiment, the steps of starting to redo the corresponding transaction log from the actual recovery start point (real_recovery_begin) of the base backup can be to read a transaction log from the actual recovery start point of the base backup, and then check whether the transaction log involves the valid page. If so, apply the modification to the valid page recorded in the transaction log to the valid page, thereby updating the valid page.

[0088] Further, after the step of applying the modifications to the valid pages recorded in the transaction log to the valid pages, it is also possible to check whether the sequence number of the transaction log is greater than or equal to the sequence number corresponding to the incomplete data page. If so, the incomplete data page has been repaired again, record the sequence number of the last redo transaction log (last_redo_lsn), and then execute the step of checking whether the sequence number of the last redo transaction log is greater than or equal to the sequence number corresponding to the incomplete data page. If not, continue to read the next transaction log.

[0089] Further, before the step of reading the next transaction log, it is also possible to check whether there is a next transaction log. If so, execute the step of reading the next transaction log, and then execute the step of checking whether the transaction log involves a valid page. If not, record the sequence number of the last redo transaction log, and then execute the step of checking whether the sequence number of the last redo transaction log is greater than or equal to the sequence number corresponding to the incomplete data page.

[0090] Figure 5 is a flowchart for at least repairing the valid pages to the same version as the incomplete data pages, as Figure 5 shown, which may include the following steps S500 to step S

[0091] Step S500, obtain the XLOG log LSN (denoted as last_pd_lsn) of the last modification to the valid page from the valid page, and real_recovery_begin = last_pd_lsn.

[0092] Step S502, read the first XLOG log from real_recovery_begin;

[0093] Step S504, check whether the content of the XLOG log involves a valid page. If so, execute step S506. If not, execute step S508.

[0094] Step S506, apply the modifications to the valid page recorded in the XLOG log to the valid page, and then execute step S508.

[0095] Step S508, check whether the current XLOG log lsn is greater than or equal to cur_lsn. If so, execute step S514. If not, execute step S510.

[0096] Step S510, check whether there is a next XLOG log. If so, execute step S512. If not, execute step S514.

[0097] Step S512, read the next XLOG log, and return to step S504.

[0098] Step S514, record the LSN (last_redo_lsn) of the last replayed XLOG log.

[0099] Step S516, check whether last_redo_lsn is greater than or equal to cur_lsn. If so, execute Step S518; if not, execute Step S520.

[0100] Step S518, the repair is successful, end.

[0101] Step S520, the repair fails.

[0102] In an optional embodiment, after the step of repairing an incomplete data page, it is also possible to determine whether the transaction log traversal is completed. If so, end the redo process of the transaction log; if not, continue to read the next transaction log. This process can be relatively easily determined based on the sequence number of the current transaction log and the sequence number corresponding to the recovery target (i.e., recovery_target).

[0103] The technical solution of the present invention provides a relatively appropriate starting point for replaying the XLOG log and a relatively appropriate ending point for replaying the XLOG log for the update of valid pages. In the case where the page data file is missing, there is no need to start the recovery from the base backup, but to start the recovery from the redo point recorded in the nearest checkpoint to the crash point.

[0104] In addition, the present invention provides a relatively general repair process for data pages. In fact, in addition to the incomplete data pages encountered during the database recovery process, even for incomplete data pages found in other scenarios, the data page repair method provided by the present invention can also repair them.

[0105] This embodiment also provides a machine-readable storage medium 10 and a computer device 20. Figure 6 It is a schematic diagram of the machine-readable storage medium 10 according to an embodiment of the present invention. Figure 7 It is a schematic diagram of the computer device 20 according to an embodiment of the present invention.

[0106] The machine-readable storage medium 10 stores a machine-executable program 11. When the machine-executable program 11 is executed by the processor 210, the processing method of the transaction log in any of the above embodiments is implemented.

[0107] The computer device 20 may include a memory 220, a processor 210, and a machine-executable program 11 stored in the memory 220 and running on the processor 210. When the processor 210 executes the machine-executable program 11, the processing method of the transaction log in any of the above embodiments is implemented.

[0108] Note that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any machine-readable storage medium 10 for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor 210, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in combination with these instruction execution systems, apparatuses, or devices.

[0109] For the description of this embodiment, the machine-readable storage medium 10 can be any device that can contain, store, communicate, propagate, or transmit a program for use by an instruction execution system, apparatus, or device or in combination with these instruction execution systems, apparatuses, or devices. More specific examples (non-exhaustive list) of computer-readable media include the following: electrical connection parts with one or more wirings (electronic devices), portable computer disk cartridges (magnetic devices), random access memory 220 (RAM), read-only memory 220 (ROM), erasable programmable read-only memory 220 (EPROM or flash memory 220), optical fiber devices, and portable compact disc read-only memory 220 (CDROM). Additionally, the machine-readable storage medium 10 can even be paper or other suitable media on which a program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other suitable processing when necessary, and then stored in the computer memory 220.

[0110] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented by software or firmware stored in the memory 220 and executed by a suitable instruction execution system.

[0111] The computer device 20 can be, for example, a server, a desktop computer, a laptop computer, a tablet computer, or a smartphone. In some examples, the computer device 20 can be a cloud computing node. The computer device 20 can be described in the general context of computer system-executable instructions (such as program modules) executed by a computer system. Generally, program modules can include routines, programs, object programs, components, logics, data structures, etc. that perform specific tasks or implement specific abstract data types. The computer device 20 can be implemented in a distributed cloud computing environment where tasks are executed by remote processing devices linked through a communication network. In the distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0112] The computer device 20 may include a processor 210 adapted to execute stored instructions and a memory 220 that provides temporary storage space for the operation of the instructions during operation. The processor 210 may be a single-core processor 210, a multi-core processor 210, a computing cluster, or any number of other configurations. The memory 220 may include random access memory 220 (RAM), read-only memory 220, flash memory, or any other suitable storage system.

[0113] The processor 210 may be connected via a system interconnect (such as PCI, PCI-Express, etc.) to an I / O interface (input / output interface) adapted to connect the computer device 20 to one or more I / O devices (input / output devices). The I / O devices may include, for example, a keyboard and a pointing device, where the pointing device may include a touchpad or a touch screen, etc. The I / O devices may be built-in components of the computer device 20 or may be devices externally connected to the computing device.

[0114] The processor 210 may also be linked via a system interconnect to a display interface adapted to connect the computer device 20 to a display device. The display device may include a display screen as a built-in component of the computer device 20. The display device may also include a computer monitor, a television, a projector, etc. externally connected to the computer device 20. In addition, a network interface controller (NIC) may be adapted to connect the computer device 20 to a network via a system interconnect. In some embodiments, the NIC may use any suitable interface or protocol (such as Internet Small Computer System Interface, etc.) to transmit data. The network may be a cellular network, a radio network, a wide area network (WAN), a local area network (LAN), or the Internet, etc. Remote devices may be connected to the computing device via the network.

[0115] At this point, those skilled in the art should recognize that although numerous exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications that conform to the principles of the present invention can still be directly determined or derived from the content disclosed in the present invention without departing from the spirit and scope of the present invention. Therefore, the scope of the present invention should be understood and determined to cover all such other variations or modifications.

Claims

1. A method for processing transaction logs, comprising: Reading a transaction log from the redo point; Obtaining each data page corresponding to the transaction log; Checking whether each of the data pages is complete; If not, repairing the incomplete data pages.

2. The method for processing a transaction log according to claim 1, wherein, The steps of repairing the incomplete data pages include: Preventing the database from modifying and reading the incomplete data pages; Searching in the database for valid pages corresponding to the incomplete data pages; Restoring at least the valid pages to the same version as the incomplete data pages.

3. The method for processing a transaction log according to claim 2, wherein, The steps of searching in the database for valid pages corresponding to the incomplete data pages include: Sequentially searching in the primary and standby database clusters of the database, in the page mirror files, and in the base backup for valid pages corresponding to the incomplete data pages.

4. The method for processing a transaction log according to claim 2, wherein, The steps of restoring at least the valid pages to the same version as the incomplete data pages include: Obtaining the sequence number of the transaction log that last modified the valid page from the valid page; Redoing the corresponding transaction logs starting from the actual recovery start point of the base backup; Checking whether the sequence number of the last redone transaction log is greater than or equal to the sequence number corresponding to the incomplete data page; If so, determining that the incomplete data page has been successfully repaired.

5. The method for processing a transaction log according to claim 4, wherein, The steps of redoing the corresponding transaction logs starting from the actual recovery start point of the base backup include: Reading a transaction log from the actual recovery start point of the base backup; Checking whether the transaction log involves the valid page; If so, applying the modification to the valid page recorded in the transaction log to the valid page.

6. The method for processing a transaction log according to claim 5, wherein, After the step of applying the modification to the valid page recorded in the transaction log to the valid page, it further includes: Checking whether the sequence number of the transaction log is greater than or equal to the sequence number corresponding to the incomplete data page; If so, recording the sequence number of the last redone transaction log, and then performing the step of checking whether the sequence number of the last redone transaction log is greater than or equal to the sequence number corresponding to the incomplete data page; If not, reading the next transaction log.

7. The method for processing a transaction log according to claim 6, wherein, Before the step of reading the next transaction log, it further includes: Checking whether there is a next transaction log; If so, performing the step of reading the next transaction log, and then performing the step of checking whether the transaction log involves the valid page; If not, recording the sequence number of the last redone transaction log, and then performing the step of checking whether the sequence number of the last redone transaction log is greater than or equal to the sequence number corresponding to the incomplete data page.

8. The method for processing a transaction log according to claim 1, wherein, After the step of repairing the incomplete data pages, it further includes: Judging whether the traversal of the transaction log is completed; If so, ending the redo process of the transaction log; If not, reading the next transaction log.

9. A machine-readable storage medium, on which a machine-executable program is stored, and when the machine-executable program is executed by a processor, it implements the method for processing transaction logs according to any one of claims 1 to 8.

10. A computer device, comprising a memory, a processor, and a machine-executable program stored on the memory and running on the processor, and when the processor executes the machine-executable program, implementing the processing method of the transaction log according to any one of claims 1 to 8.