Method, device, equipment and product for adjusting fault recovery replay parallelism degree of standby library

By determining and dynamically adjusting the fault recurrence parallelism based on the conventional and fault parallelism parameters in the backup library, the problem of high parallelism settings causing the backup library to be unavailable is solved, ensuring the high availability of the backup library in the fault recurrence task.

CN120144362APending Publication Date: 2025-06-13SHANGHAI DAMENG DATABASE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510215194.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

In the main and standby cluster environment, if the user directly sets the parallelism parameter to be greater than 1, the standby library cannot provide data query services, thereby reducing the availability of the standby library.

Method used

The fault recurrence parallelism of the backup library is determined based on the conventional parallelism parameters and the fault parallelism parameters, and the parallelism is dynamically adjusted when the preset conditions are met to perform the fault recurrence task.

Benefits of technology

It realizes that high availability is maintained when the backup library performs fault recurrence tasks, avoiding the problem of parallelism setting that directly affects the backup library query service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144362A_ABST
    Figure CN120144362A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a method, a device, equipment and a product for adjusting the fault recovery replay parallelism degree of a standby library. The method comprises the following steps: determining the fault replay parallelism degree of the standby library based on a conventional parallelism degree parameter and a fault parallelism degree parameter; under the condition that the replay task is a fault replay task, determining whether the conventional parallelism degree parameter and the fault parallelism degree parameter meet a preset condition or not; if the conventional parallelism degree parameter and the fault parallelism degree parameter meet preset conditions, executing a fault replay task according to the fault replay parallelism degree; and if the conventional parallelism degree parameter and the fault parallelism degree parameter do not meet the preset condition, executing a fault replay task according to the conventional parallelism degree parameter. According to the technical scheme, the fault replay parallelism degree of the standby library is determined based on the conventional parallelism degree parameter and the fault parallelism degree parameter, whether the fault replay task is executed according to the fault replay parallelism degree is determined according to whether the conventional parallelism degree parameter and the fault parallelism degree parameter meet the preset conditions, and it is guaranteed that the standby library has high availability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the technical field of databases, and in particular, to a method, apparatus, device, and product for adjusting the parallelism of standby database failure recovery replay. Background Art

[0002] In a database management system, a redo log (REDO log) is used to record the modifications of physical transactions to data. When a failure causes data loss, the data can be restored by replaying the REDO log. A log packet is a data unit in which the database stores the REDO log, and multiple log records can be stored in one log packet.

[0003] In a master-slave cluster environment, the master database provides the main database services, and the standby database is used for data backup and also supports simple data query services. During the operation of the standby database, it is necessary to replay the logs in the log packets sent by the master database at irregular intervals to ensure that the data on the standby database and the master database are consistent. This replay task can be called a daily replay task.

[0004] When the standby database replays the logs, it can replay them serially or in parallel. Serial replay means that only one working thread executes the replay task, and parallel replay means that multiple working threads execute the replay task simultaneously. Generally, the replay strategy is controlled by a parallelism parameter, and the parameter value is the parallelism (i.e., the number of working threads executing the replay task).

[0005] When the parallelism parameter value is greater than 1: The parallel replay strategy is enabled, and the replay speed is fast. The transaction isolation level needs to be set to the read uncommitted level, and the standby database does not support the data query function during operation. When the parallelism parameter value is equal to 1: The serial replay strategy is enabled, and the replay speed is slow. The transaction isolation level needs to be set to the read committed level, and the standby database supports the data query function during operation.

[0006] When the standby database executes the failure replay task, there are high efficiency requirements. However, if the user directly sets the parallelism parameter to a value greater than 1, it will cause the standby database to be unable to provide data query services during operation, thereby reducing the availability of the standby database. Summary of the Invention

[0007] Embodiments of the present disclosure provide a method, apparatus, device, and product for adjusting the parallelism of standby database failure recovery replay, ensuring high availability of the standby database.

[0008] In a first aspect, a method for adjusting the parallelism of standby database failure recovery replay is provided. The method includes:

[0009] Determining the failure replay parallelism of the standby database based on a regular parallelism parameter and a failure parallelism parameter;

[0010] In the case where the replay task is a fault replay task, determine whether the conventional parallelism parameter and the fault parallelism parameter meet the preset conditions;

[0011] If the conventional parallelism parameter and the fault parallelism parameter meet the preset conditions, execute the fault replay task according to the fault replay parallelism;

[0012] If the conventional parallelism parameter and the fault parallelism parameter do not meet the preset conditions, execute the fault replay task according to the conventional parallelism parameter.

[0013] In a second aspect, there is provided an adjustment device for the parallelism of standby database fault recovery replay, including:

[0014] A fault replay parallelism determination module, configured to determine the fault replay parallelism of the standby database based on a conventional parallelism parameter and a fault parallelism parameter;

[0015] A judgment module, configured to determine whether the conventional parallelism parameter and the fault parallelism parameter meet the preset conditions in the case where the replay task is a fault replay task;

[0016] A first execution module, configured to execute the fault replay task according to the fault replay parallelism if the conventional parallelism parameter and the fault parallelism parameter meet the preset conditions;

[0017] A second execution module, configured to execute the fault replay task according to the conventional parallelism parameter if the conventional parallelism parameter and the fault parallelism parameter do not meet the preset conditions.

[0018] In a third aspect, there is provided an electronic device, including:

[0019] At least one processor; and

[0020] A memory communicatively connected to the at least one processor; wherein,

[0021] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the adjustment method for the parallelism of standby database fault recovery replay as described in the first aspect above.

[0022] In a fourth aspect, there is provided a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the adjustment method for the parallelism of standby database fault recovery replay as described in the first aspect above is implemented.

[0023] Fifth aspect, a computer program product is provided, the computer program product includes a computer program which, when executed by a processor, implements the method for adjusting the parallelism of standby database failure recovery replay as described in the first aspect above.

[0024] Embodiments of the present disclosure disclose a method, apparatus, device and product for adjusting the parallelism of standby database failure recovery replay. The method includes: determining the failure replay parallelism of the standby database based on a regular parallelism parameter and a failure parallelism parameter; when the replay task is a failure replay task, determining whether the regular parallelism parameter and the failure parallelism parameter meet a preset condition; if the regular parallelism parameter and the failure parallelism parameter meet the preset condition, executing the failure replay task according to the failure replay parallelism; if the regular parallelism parameter and the failure parallelism parameter do not meet the preset condition, executing the failure replay task according to the regular parallelism parameter. This technical solution determines the failure replay parallelism of the standby database based on the regular parallelism parameter and the failure parallelism parameter, and determines whether to execute the failure replay task according to the failure replay parallelism based on whether the regular parallelism parameter and the failure parallelism parameter meet the preset condition, ensuring high availability of the standby database.

[0025] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the embodiments of the present disclosure. Other features of the embodiments of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.

[0027] Figure 1 is a flowchart of a method for adjusting the parallelism of standby database failure recovery replay provided in Embodiment 1 of the present disclosure;

[0028] Figure 2 is a schematic diagram of the adjustment process of the parallelism of standby database failure recovery replay provided in Embodiment 1 of the present disclosure;

[0029] Figure 3 is a schematic diagram of the structure of an apparatus for adjusting the parallelism of standby database failure recovery replay provided in Embodiment 2 of the present disclosure;

[0030] Figure 4 is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0031] To enable those skilled in the art to better understand the solutions of the embodiments of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the scope of protection of the embodiments of the present disclosure.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned accompanying drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that such used data may be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these process, method, product or device.

[0033] Embodiment 1

[0034] Figure 1 It is a flowchart of a method for adjusting the parallelism of standby database failure recovery replay provided in Embodiment 1 of the present disclosure. This embodiment is applicable to determining the parallelism of standby database failure recovery replay. This method can be executed by a device for adjusting the parallelism of standby database failure recovery replay. The device for adjusting the parallelism of standby database failure recovery replay can be implemented in the form of hardware and / or software. The device for adjusting the parallelism of standby database failure recovery replay can be configured in an electronic device, and the electronic device includes but is not limited to devices with data processing capabilities such as computers, laptops, terminals, and servers. As Figure 1 shown, the method includes:

[0035] S110. Determine the failure replay parallelism of the standby database based on the regular parallelism parameter and the failure parallelism parameter.

[0036] In this embodiment, the normal parallelism parameter can be understood as the parallelism parameter used by the primary database and the standby database during the daily data synchronization process. During the operation of the standby database, it is necessary to replay the logs in the log packets sent by the primary database irregularly to ensure that the data on the standby database and the primary database are consistent. The fault parallelism parameter can be the parallelism parameter used during the synchronization process to synchronize the data of the primary database and the standby database after a failure occurs in the primary-standby replication. Based on the original normal parallelism parameter, this technical solution adds a fault parallelism parameter. The values of the normal parallelism parameter and the fault parallelism parameter can be determined by the user and can default to 1.

[0037] It can be known that the fault replay parallelism of the standby database can be determined based on the normal parallelism parameter and the fault parallelism parameter. Among them, the fault replay parallelism can be the parallelism parameter actually used during the data synchronization process between the primary database and the standby database. The most important function of the fault replay parallelism is that when the standby database processes the fault replay task, it can be switched dynamically from the original serial replay (the original parallelism is 1) to the parallel replay (the parallelism is the newly added fault replay parallelism), thereby improving the efficiency of the standby database in processing the fault replay task.

[0038] Exemplarily, the larger of the normal parallelism parameter and the fault parallelism parameter can be used as the fault replay parallelism.

[0039] S120. When the replay task is a fault replay task, determine whether the normal parallelism parameter and the fault parallelism parameter meet the preset conditions.

[0040] Specifically, after a failure occurs in the standby database, the data synchronization between the standby database and the primary database will be interrupted. When the standby database returns to normal, it is necessary to replay the logs sent by the primary database in a timely manner to complete the data synchronization. This replay task can be called a fault replay task. When the replay task is a fault replay task, it can be determined whether the normal parallelism parameter and the fault parallelism parameter meet the preset conditions.

[0041] Among them, the preset condition can be that the value of the normal parallelism parameter is the first preset value and the value of the fault parallelism parameter is greater than the second preset value. The first preset value can be a value set by the user, and the second preset value can be a value set by the user. The first preset value and the second preset value can be different. Exemplarily, the preset condition can be that the value of the normal parallelism parameter is equal to 1 and the value of the fault parallelism parameter is greater than 1.

[0042] S130. If the normal parallelism parameter and the fault parallelism parameter meet the preset conditions, execute the fault replay task according to the fault replay parallelism.

[0043] Specifically, if the normal parallelism parameter and the fault parallelism parameter meet the preset conditions, the fault replay task can be executed according to the fault replay parallelism.

[0044] S140. If the conventional parallelism parameter and the fault parallelism parameter do not meet the preset conditions, execute the fault replay task according to the conventional parallelism parameter.

[0045] Specifically, if the conventional parallelism parameter and the fault parallelism parameter do not meet the preset conditions, the fault replay task can be executed according to the conventional parallelism parameter.

[0046] This embodiment provides a method for adjusting the parallelism of standby database fault recovery replay, including: determining the fault replay parallelism of the standby database based on the conventional parallelism parameter and the fault parallelism parameter; when the replay task is a fault replay task, determining whether the conventional parallelism parameter and the fault parallelism parameter meet the preset conditions; if the conventional parallelism parameter and the fault parallelism parameter meet the preset conditions, execute the fault replay task according to the fault replay parallelism; if the conventional parallelism parameter and the fault parallelism parameter do not meet the preset conditions, execute the fault replay task according to the conventional parallelism parameter, ensuring that the standby database has high availability.

[0047] As an optional implementation manner of this embodiment, the method for adjusting the parallelism of standby database fault recovery replay provided in this embodiment further includes:

[0048] 1) If the type of the log packet received by the standby database is a synchronous packet, determine that the replay task is a daily replay task.

[0049] In this embodiment, the replay task can be determined as a daily replay task or a fault replay task based on the type of the data packet received by the standby database. Specifically, when the primary and standby clusters are synchronizing normally, the primary database sends synchronous packets. After the standby database fails, the primary database asynchronously recovers the standby database, and the primary database sends asynchronous log packets to the standby database at this time. Therefore, the type of the replay task can be determined by the type of the log packet received by the standby database. Among them, the synchronous packet can be that when the primary database commits a transaction, it sends the data change information in the binary log to the standby database in a synchronous manner. This method requires the primary database to wait for the standby database to confirm the reception and application of these logs before returning a successful response after committing the transaction. The asynchronous log packet means that after the primary database commits a transaction, it immediately sends the log to the standby database without waiting for the confirmation of the standby database, and the standby database will receive and apply these logs asynchronously in the background.

[0050] According to the above description, if the type of the log packet received by the standby database is a synchronous packet, determine that the replay task is a daily replay task.

[0051] 2) If the type of the log packet received by the standby database is an asynchronous log packet, determine that the replay task is a fault replay task.

[0052] Specifically, if the type of the log package received by the standby database is an asynchronous log package, it is determined that the replay task is a failure replay task.

[0053] As an optional implementation manner of this embodiment, the method for adjusting the parallelism of standby database failure recovery replay provided in this embodiment further includes:

[0054] In the case where the replay task is a daily replay task, the standby database is used to execute the daily replay task according to the conventional parallelism parameter value.

[0055] It should be noted that if the replay task is a daily replay task, the standby database can be used to execute the daily replay task according to the conventional parallelism parameter value.

[0056] As an optional implementation manner of this embodiment, the executing the failure replay task according to the failure replay parallelism includes:

[0057] 1) Close the query function of the standby database and set the transaction isolation level of the standby database to the read uncommitted level.

[0058] Specifically, when executing the failure replay task according to the failure replay parallelism, it is necessary to temporarily prohibit users from querying the standby database to avoid interfering with the ongoing maintenance task. At the same time, the transaction isolation level of the standby database can also be set to the read uncommitted level.

[0059] Among them, the transaction isolation level of the database determines which data of other transactions a transaction can see. Common isolation levels include read uncommitted, read committed, repeatable read, and serialization. In this embodiment, the transaction isolation level of the standby database is set to the read uncommitted level to improve operation efficiency and avoid lock conflicts. Among them, read uncommitted allows a transaction to read data that has not been committed by other transactions.

[0060] 2) After the failure replay task is completed, set the transaction isolation level of the standby database to the read committed level.

[0061] It can be known that after the failure replay task is completed. The transaction isolation level of the standby database can be set to the read committed level. Among them, the read committed level allows a transaction to only read data that has been committed by other transactions, avoiding dirty reads and ensuring data consistency and reliability..

[0062] 3) Re-open the query function of the standby database.

[0063] It should be noted that after the transaction isolation level of the standby database is set to the read committed level, the query function of the standby database can be restarted.

[0064] As an optional implementation manner of this embodiment, after determining the fault replay parallelism of the standby database based on the conventional parallelism parameter and the fault parallelism parameter, the method further includes:

[0065] Create a corresponding number of worker threads based on the fault replay parallelism, so that the standby database processes the fault replay tasks in parallel during the fault recovery process.

[0066] Specifically, a corresponding number of worker threads can be created based on the fault replay parallelism, so that when the standby database processes the fault replay tasks, there are enough worker threads to execute the tasks when switching from serial to parallel. Exemplarily, if the value of the fault replay parallelism is 3, 3 parallel worker threads can be created, so that the standby database processes the fault replay tasks in parallel during the fault recovery process.

[0067] In this technical solution, the conventional parallelism parameter and the fault parallelism parameter can be obtained when the standby database is started, and the larger of the two parameter values is used as the fault replay parallelism, and an equal number of worker threads are initialized according to the fault replay parallelism; during the normal operation of the primary and standby clusters, the standby database executes daily replay tasks according to the conventional parallelism parameter value. If the standby database fails, it is judged whether the value of the conventional parallelism parameter is equal to 1 and the value of the fault parallelism parameter is greater than 1. If so, the replay parallelism is dynamically adjusted; otherwise, the fault replay tasks are still executed according to the conventional parallelism parameter value. The above method for dynamically adjusting the replay parallelism: close the query function of the standby database (an error is reported when the user executes a data query statement on the standby database), set the transaction isolation level to the read uncommitted level, execute the fault replay tasks according to the value of the fault parallelism parameter, and after the fault replay tasks are completed, set the transaction isolation level to the read committed level and reopen the query function of the standby database (the user can successfully execute a data query statement on the standby database). The method for adjusting the replay parallelism of the standby database proposed in this technical solution adds a fault parallelism parameter. When the standby database executes the fault replay tasks and the value of the conventional parallelism parameter is equal to 1 and the value of the fault parallelism parameter is greater than 1, the data query function is temporarily closed, and the fault replay tasks are executed in parallel according to the value of the fault parallelism parameter to improve the replay efficiency, and the data query function is reopened after the fault replay tasks are completed to ensure high availability of the standby database.

[0068] Figure 2 It is a schematic diagram of the adjustment process of the fault recovery replay parallelism of the standby database provided in this embodiment, as Figure 2As shown, the user can set the normal parallelism parameter and the failure parallelism parameter, and then start the standby database. Obtain the larger parameter value among the normal parallelism parameter and the failure parallelism parameter, and determine this value as the failure replay parallelism. Initialize an equal number of worker threads according to this value to prepare for subsequent replay tasks. When starting to execute the replay task, it can be determined whether the currently executed replay task is a failure replay task. If it is a failure replay task, then determine whether the normal parallelism parameter value is equal to 1 and the failure parallelism parameter value is greater than 1; if the normal parallelism parameter value is equal to 1 and the failure parallelism parameter value is greater than 1, then close the query function of the standby database to ensure that the standby database will not be interfered by other query operations during the failure replay process; and set the transaction isolation level to the read uncommitted level to allow reading of data not yet committed by other transactions. Execute the failure replay task according to the failure replay parallelism. After the execution is completed, restore the transaction isolation level to read committed to ensure data consistency for subsequent operations, and restart the query function of the standby database to make the standby database resume normal service. If the condition that the normal parallelism parameter value is equal to 1 and the failure parallelism parameter value is greater than 1 is not satisfied, then execute the replay task according to the normal parallelism parameter. If the currently executed task is not a failure replay task but an ordinary daily replay task, then execute the daily replay task according to the normal parallelism parameter.

[0069] Embodiment 2

[0070] Figure 3 is a schematic structural diagram of an adjustment device for the failure recovery replay parallelism of a standby database provided in Embodiment 2 of the present disclosure; as Figure 3 shown, the device includes: a failure replay parallelism determination module 210, a judgment module 220, a first execution module 230, and a second execution module 240.

[0071] Among them, the failure replay parallelism determination module 210 is used to determine the failure replay parallelism of the standby database based on the normal parallelism parameter and the failure parallelism parameter;

[0072] The judgment module 220 is used to determine whether the normal parallelism parameter and the failure parallelism parameter meet a preset condition when the replay task is a failure replay task;

[0073] The first execution module 230 is used to execute the failure replay task according to the failure replay parallelism if the normal parallelism parameter and the failure parallelism parameter meet the preset condition;

[0074] The second execution module 240 is used to execute the failure replay task according to the normal parallelism parameter if the normal parallelism parameter and the failure parallelism parameter do not meet the preset condition.

[0075] Embodiment 2 of the present disclosure provides an adjustment device for the parallelism of standby database failure recovery replay, ensuring high availability of the standby database.

[0076] Further, the first execution module 230 is further configured to:

[0077] Close the query function of the standby database and set the transaction isolation level of the standby database to the read uncommitted level;

[0078] After the to-be-failure-replayed task is completed, set the transaction isolation level of the standby database to the read committed level;

[0079] Re-open the query function of the standby database.

[0080] Further, the device further includes:

[0081] A working thread creation module, configured to create a corresponding number of working threads based on the parallelism of the failure replay, so that the standby database processes the failure replay task in parallel during the failure recovery process.

[0082] Further, the preset condition is that the value of the conventional parallelism parameter is the first preset value and the value of the failure parallelism parameter is greater than the second preset value.

[0083] Further, the device further includes:

[0084] A daily replay task determination module, configured to determine that the replay task is a daily replay task if the type of the log packet received by the standby database is a synchronization packet;

[0085] A failure replay task determination module, configured to determine that the replay task is a failure replay task if the type of the log packet received by the standby database is an asynchronous log packet.

[0086] Further, the device further includes:

[0087] A daily replay task execution module, configured to, when the replay task is a daily replay task, use the standby database to execute the daily replay task according to the value of the conventional parallelism parameter.

[0088] The adjustment device for the parallelism of standby database failure recovery replay provided by the embodiments of the present disclosure can execute the adjustment method for the parallelism of standby database failure recovery replay provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0089] Embodiment 3

[0090] Figure 4The structure diagram of an electronic device 10 that can be used to implement the embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of the present disclosure described and / or claimed herein.

[0091] As Figure 4 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. Among them, the memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0092] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0093] The processor 11 can be various general-purpose and / or dedicated processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microprocessor, etc. The processor 11 executes the various methods and processes described above, such as the method for adjusting the parallelism of standby library failure recovery replay.

[0094] In some embodiments, the method for adjusting the parallelism of standby database failure recovery replay can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for adjusting the parallelism of standby database failure recovery replay described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the method for adjusting the parallelism of standby database failure recovery replay by any other suitable means (e.g., by means of firmware).

[0095] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems on a chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0096] The computer programs for implementing the methods of the embodiments of the present disclosure can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer programs are executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0097] In the context of the embodiments of the present disclosure, a computer-readable storage medium may be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium may be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0098] In order to provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0099] The systems and techniques described herein can be implemented in a computing system that includes backend components (such as, for example, a data server), or a computing system that includes middleware components (such as, for example, an application server), or a computing system that includes frontend components (such as, for example, a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (such as, for example, a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.

[0100] A computing system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The relationship between the client and the server is created by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.

[0101] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the embodiments of the present disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions of the embodiments of the present disclosure can be achieved. No limitation is imposed herein.

[0102] The above specific embodiments do not constitute a limitation on the protection scope of the embodiments of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the embodiments of the present disclosure shall be included within the protection scope of the embodiments of the present disclosure.

[0103] The embodiments of the present disclosure also provide a computer program product, including a computer program and / or instructions, which, when executed by a processor, implement the method for adjusting the parallelism of backup library failure recovery replay as provided in any embodiment of the present application.

[0104] In the process of implementing the computer program product, computer program code for performing the operations of the embodiments of the present disclosure can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network - including a local area network (LAN) or a wide area network (WAN) - or can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).

[0105] Note that the above are only the preferred embodiments of the present disclosure and the technical principles applied. Those skilled in the art will understand that the embodiments of the present disclosure are not limited to the specific embodiments here, and various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the embodiments of the present disclosure. Therefore, although the embodiments of the present disclosure have been described in more detail through the above embodiments, the embodiments of the present disclosure are not limited to the above embodiments only. Without departing from the concept of the embodiments of the present disclosure, more other equivalent embodiments can be included, and the scope of the embodiments of the present disclosure is determined by the scope of the appended claims.

Claims

1. A method for adjusting the parallelism of standby database fault recovery replay, characterized in that: include: Determine the fault replay parallelism of the standby database based on the normal parallelism parameter and the fault parallelism parameter; In the case where the replay task is a fault replay task, determining whether the conventional parallelism parameter and the fault parallelism parameter meet a preset condition; If the conventional parallelism parameter and the fault parallelism parameter meet the preset conditions, the fault replay task is executed according to the fault replay parallelism; If the conventional parallelism parameter and the fault parallelism parameter do not satisfy a preset condition, the fault replay task is executed according to the conventional parallelism parameter.

2. The method according to claim 1, characterized in that The executing the fault replay task according to the fault replay parallelism includes: Disable the query function of the standby database and set the transaction isolation level of the standby database to the read uncommitted level; After the fault replay task is completed, the transaction isolation level of the standby database is set to a read committed level; Re-enable the query function of the standby database.

3. The method according to claim 1, characterized in that After determining the fault replay parallelism of the standby database based on the normal parallelism parameter and the fault parallelism parameter, the method further includes: A corresponding number of working threads are created based on the fault replay parallelism, so that the standby database processes the fault replay tasks in parallel during the fault recovery process.

4. The method according to claim 3, characterized in that The method further includes: the preset condition is that the value of the normal parallelism parameter is a first preset value and the value of the fault parallelism parameter is greater than a second preset value.

5. The method according to claim 1, characterized in that The method further comprises: If the type of the log package received by the standby database is a synchronization package, determining that the replay task is a daily replay task; If the type of the log package received by the standby database is an asynchronous log package, it is determined that the replay task is a fault replay task.

6. The method according to claim 5, characterized in that The method further comprises: In the case where the replay task is a daily replay task, the daily replay task is executed using the standby database according to the conventional parallelism parameter value.

7. A device for adjusting the parallelism of backup database fault recovery replay, characterized in that: include: A fault replay parallelism determination module is used to determine the fault replay parallelism of the standby database based on a conventional parallelism parameter and a fault parallelism parameter; A judgment module, used for determining whether the conventional parallelism parameter and the fault parallelism parameter meet a preset condition when the replay task is a fault replay task; A first execution module, configured to execute the fault replay task according to the fault replay parallelism if the conventional parallelism parameter and the fault parallelism parameter meet a preset condition; The second execution module is used to execute the fault replay task according to the conventional parallelism parameter if the conventional parallelism parameter and the fault parallelism parameter do not meet a preset condition.

8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for adjusting the parallelism of fault recovery replay of a standby database as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for adjusting the parallelism of fault recovery replay of a standby database as described in any one of claims 1 to 6 is implemented.

10. A computer program product, characterized in that The computer program product includes a computer program, and when the computer program is executed by a processor, the method for adjusting the parallelism of fault recovery replay of a standby database according to any one of claims 1 to 6 is implemented.