Transaction log synchronization method and computing device

By grouping and directly waking up threads with semaphores, the resource waste caused by queues and sorting in the existing technology is solved, and the efficiency and resource utilization of transaction log synchronization are improved.

CN119166602APending Publication Date: 2024-12-20HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310738373.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-20
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The existing transaction log synchronization method has a high overhead when creating global queues and sorting log sequence numbers, resulting in wasted resources.

Method used

By grouping, the thread corresponding to the fallen transaction log is awakened, and the thread is directly awakened using the semaphore of the sequence number group, avoiding queue and sorting operations and reducing resource overhead.

Benefits of technology

It realizes the reduction of transaction log synchronization resource overhead, improves wake-up efficiency, reduces the number of thread wake-up times, and improves transaction commit efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166602A_ABST
    Figure CN119166602A_ABST
Patent Text Reader

Abstract

The transaction log synchronization method comprises the following steps: after a first computing device writes transaction logs in a log cache of the first computing device by using a plurality of threads, modifying the states of the plurality of threads from a working state to a waiting state and determining a sequence number group where a log sequence number of each transaction log is located, and after sending the log file obtained from the disk to the second computing device, determining an ending sequence number group and a starting sequence number group according to the first log synchronization progress sequence number sent by the second computing device, and then waking up the thread according to the log sequence numbers from the starting sequence number group to the ending sequence number group. According to the method, the log sequence numbers corresponding to the threads in the waiting state do not need to be added into the log sequence number queue and are sorted according to the sizes of the log sequence numbers, so that the synchronization overhead of the transaction logs can be reduced. The invention further provides a computing device capable of realizing the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of databases, and in particular to a transaction log synchronization method and a computing device. Background Art

[0002] The database system can use multiple threads to process transactions concurrently. Each thread processes a transaction and generates a transaction log, and then writes the transaction log to the storage device in chronological order. In order to achieve transaction log synchronization, the thread is set to a waiting state during the process of writing the transaction log to the storage device.

[0003] Currently, there is a transaction log synchronization method comprising: after a first computing device uses multiple threads to write a transaction log into a log cache, each thread inserts a log sequence number of a transaction log into a global queue, sorts the log sequence numbers in the global queue in ascending order, and then multiple threads enter a waiting state, after the transaction log in the log cache is written to disk, the log file obtained by writing to disk is sent to a second computing device, after the second computing device completes the backup according to the log file, the log sequence number of the disk writing progress of the standby database is sent to the first computing device, the first computing device traverses the queue according to the log sequence number of the disk writing progress of the standby database, dequeues the log sequence number of the backed up transaction log, and wakes up their corresponding threads.

[0004] The above method needs to create a global queue and sort according to the log sequence number, and the overhead of the above operation is relatively large. Summary of the invention

[0005] In view of this, the present application provides a transaction log synchronization method, which can wake up the threads corresponding to the transaction logs that have been written to the disk in groups, without creating a log sequence number queue and log sequence number sorting, thereby saving computing resources. The present application also provides a computing device that can implement the above transaction log synchronization method.

[0006] In a first aspect, a transaction log synchronization method is provided. The method includes: after a first computing device uses multiple threads to write transaction logs in a log cache of the first computing device, the state of the multiple threads is changed from a working state to a waiting state and the sequence number group where the log sequence number of each transaction log is located is determined, and then the transaction logs in the log cache are written to a disk; then the log files written to the disk are sent to a second computing device, and after the first computing device receives the first log synchronization progress sequence number sent by the second computing device, the first computing device determines the end sequence number group where the first log synchronization progress sequence number is located, when the first log synchronization progress sequence number is the log sequence number of the last transaction log in the first batch of transaction logs, the first computing device determines the start sequence number group as the first sequence number group, when the first log synchronization progress sequence number is not the log sequence number of the last transaction log in the first batch of transaction logs, the first computing device determines the start sequence number group as the sequence number group where the second log synchronization progress sequence number is located, and then wakes up the thread according to the log sequence numbers from the start sequence number group to the end sequence number group. The second log synchronization progress sequence number is the previous log sequence number of the first log synchronization progress sequence number.

[0007] According to this implementation, the waiting thread corresponding to the synchronized transaction log can be awakened according to the log sequence number in the starting sequence number group to the ending sequence number group. This method does not need to add the log sequence number corresponding to the waiting thread to the log sequence number queue, nor does it need to sort according to the size of the log sequence number, thereby reducing the resource overhead of transaction log synchronization.

[0008] In another possible implementation, after the first computing device uses the first thread to send the log file obtained by writing to the disk to the second computing device, the first computing device uses the second thread to receive the first log synchronization progress number sent by the second computing device. The first thread that sends the log file is different from the second thread that receives the log synchronization progress number. Compared with using one thread to send the log file and receive the log synchronization progress number, the process of receiving the log synchronization progress number does not need to wait for the log file to be sent, so the thread wake-up can be accelerated.

[0009] In another possible implementation, the first computing device wakes up the thread according to the log sequence numbers from the starting sequence number group to the ending sequence number group, including: using a single thread to obtain the semaphore of each sequence number group from the starting sequence number group to the ending sequence number group; using the semaphore of each sequence number group to wake up the thread corresponding to the log sequence number in the sequence number group. Specifically, a single thread may be used to send the semaphore of each sequence number group to the threads corresponding to all the log sequence numbers in the sequence number group, thereby waking up the threads in the order of the sequence number groups.

[0010] In another possible implementation, the first computing device wakes up the thread according to the log sequence numbers from the starting sequence number group to the ending sequence number group, including: for each sequence number group from the starting sequence number group to the ending sequence number group, wake up the thread corresponding to the first log sequence number in the sequence number group according to the semaphore of the sequence number group; wake up the thread corresponding to the i-th log sequence number according to the thread corresponding to the i-1th log sequence number. Compared with a single thread sending a semaphore to wake up a thread, using the previous thread to wake up the next thread can reduce the load of the single thread.

[0011] The second aspect provides a transaction log synchronization method, which includes: after the second computing device receives the log file sent by the first computing device, it writes the transaction log of the log file to the disk, then plays back the log according to the log file, and uses the target thread to send the first log synchronization progress number to the first computing device. Among them, the target thread is a log receiving thread, a log disk thread or a redo thread. The target thread can be used to timely feed back the disk progress log number to the first computing device, so that the first computing device wakes up the thread corresponding to the log number in at least one sequence group according to the first log synchronization progress number, thereby improving the wake-up efficiency. In addition, there is no need to put the log numbers of all transaction logs in a queue and then read the log synchronization progress number from the queue, so the resource overhead of establishing the queue can be saved.

[0012] In a possible implementation, the second computing device uses the target thread to send the first log synchronization progress sequence number to the first computing device, including: counting the transaction logs executed by the target thread; when the number of transaction logs executed by the target thread reaches a preset number, the second computing device determines that the first log synchronization progress sequence number is the log sequence number of the last transaction log executed by the target thread, and sends the first log synchronization progress sequence number to the first computing device; when the number of transaction logs executed by the target thread is less than the preset number and the idle time of the target thread reaches the preset time, the second computing device determines that the first log synchronization progress sequence number is the log sequence number of the last transaction log executed by the target thread, and sends the first log synchronization progress sequence number to the first computing device. In this way, the log synchronization progress sequence number can be sent once after receiving multiple transaction logs, thereby reducing the number of times the log synchronization progress sequence number is fed back and reducing resource overhead. The log synchronization progress sequence number can also be fed back when the thread is idle, which can reduce the time overhead of waking up the thread.

[0013] A third aspect provides a transaction log synchronization method, the method comprising: after a computing device uses multiple threads to write transaction logs in a log cache of the computing device, the state of the multiple threads is changed from a working state to a waiting state, the sequence number group where the log sequence number of each transaction log is located is determined, and the transaction logs in the log cache are written to disk; after obtaining the first disk-written progress log sequence number, the ending sequence number group where the first disk-written progress log sequence number is located is determined; when the first disk-written progress log sequence number is the log sequence number of the last transaction log in the first batch of transaction logs, the computing device determines that the starting sequence number group is the first sequence number group; when the first disk-written progress log sequence number is not the log sequence number of the last transaction log in the first batch of transaction logs, the computing device determines that the starting sequence number group is the sequence number group where the second disk-written progress log sequence number is located, and the computing device wakes up the thread according to the log sequence numbers from the starting sequence number group to the ending sequence number group. The first disk-written progress log sequence number is the log sequence number of the last transaction log in the nth batch of transaction logs, and the second disk-written progress log sequence number is the log sequence number of the last transaction log in the n-1th batch of transaction logs.

[0014] According to this implementation, the waiting thread corresponding to the transaction log that has been written to the disk can be awakened according to the log sequence number in the starting sequence number group to the ending sequence number group, which can reduce the number of times the waiting thread corresponding to the transaction log that has not been written to the disk is awakened, thereby saving the resource overhead of waking up the thread, thereby reducing the overhead of transaction log synchronization.

[0015] In a possible implementation, the computing device wakes up the thread according to the log sequence numbers from the starting sequence number group to the ending sequence number group, including: using a single thread to obtain the semaphore of each sequence number group from the starting sequence number group to the ending sequence number group; using the semaphore of each sequence number group to wake up the thread corresponding to the log sequence number in the sequence number group. Specifically, a single thread may be used to send the semaphore of each sequence number group to the threads corresponding to all the log sequence numbers in the sequence number group, thereby waking up the threads in the order of the sequence number groups.

[0016] In a possible implementation, the computing device wakes up the thread according to the log sequence numbers from the starting sequence number group to the ending sequence number group, including: for each sequence number group from the starting sequence number group to the ending sequence number group, wake up the thread corresponding to the first log sequence number in the sequence number group according to the semaphore of the sequence number group; wake up the thread corresponding to the i-th log sequence number according to the thread corresponding to the i-1th log sequence number. Compared with a single thread sending a semaphore to wake up a thread, using the previous thread to wake up the next thread can reduce the load of the single thread.

[0017] A fourth aspect provides a computing device, which is used to execute the method in the first aspect or any possible implementation of the first aspect. Specifically, the computing device includes a module or unit for executing the method in the first aspect or any possible implementation of the first aspect, such as: a sending module, a processing module, and a receiving module.

[0018] A fifth aspect provides a computing device, which is used to execute the method in the second aspect or any possible implementation of the second aspect. Specifically, the computing device includes a module or unit for executing the method in the second aspect or any possible implementation of the second aspect, such as: a sending module, a processing module, and a receiving module.

[0019] A sixth aspect provides a computing device, which is used to execute the method in the third aspect or any possible implementation of the third aspect. Specifically, the computing device includes a module or unit, such as a processing module, for executing the method in the third aspect or any possible implementation of the third aspect.

[0020] The seventh aspect provides a computing device, comprising a processor and a memory, wherein the memory is used to store programs; the processor is used to implement the method of the first aspect, the second aspect or the third aspect by executing the program.

[0021] The eighth aspect provides a computing device cluster, which includes at least one computing device, each computing device includes a processor and a memory, and the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster performs the method of the first aspect, the second aspect or the third aspect.

[0022] The ninth aspect provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the methods of the above aspects.

[0023] The tenth aspect provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the methods of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 This is a schematic diagram of a single-machine scenario in an embodiment of the present application;

[0025] Figure 2 A schematic diagram of a primary-backup replication scenario in an embodiment of the present application;

[0026] Figure 3 A flow chart of a transaction log synchronization method in an embodiment of the present application;

[0027] Figure 4 A schematic diagram of a sequence number group corresponding to a wake-up thread in an embodiment of the present application;

[0028] Figure 5 A schematic diagram of a thread corresponding to a log sequence number in a wake-up sequence number group in an embodiment of the present application;

[0029] Figure 6 Another flow chart of the transaction log synchronization method in the embodiment of the present application;

[0030] Figure 7 A schematic diagram of a transaction log synchronization method executed by a thread in an embodiment of the present application;

[0031] Figure 8 A comparison chart of the number of transactions submitted by the existing method in the embodiment of the present application and the number of transactions submitted by the method of the present application;

[0032] Fig. 9 Another comparison chart of the number of transactions submitted by the existing method in the embodiment of the present application and the number of transactions submitted by the method of the present application;

[0033] Fig.10 A structural diagram of a computing device in an embodiment of the present application;

[0034] Fig.11 Another structural diagram of a computing device in an embodiment of the present application;

[0035] Fig.12 A structural diagram of a database system in an embodiment of the present application;

[0036] Fig.13 A structural diagram of a computing device in an embodiment of the present application;

[0037] Fig.14 A structural diagram of a computing device cluster in an embodiment of the present application;

[0038] Fig.15 This is another structural diagram of a computing device cluster in an embodiment of the present application. DETAILED DESCRIPTION

[0039] The transaction log synchronization method of the present application can be applied to database systems, such as Gaussian database and postgreSQL database.

[0040] See also Figure 1 In one example, the database system includes a computing device 11, which is used to manage a main database. The computing device 11 includes a main thread pool and a log thread group. The main thread pool includes multiple threads 111, and the log thread group includes a log disk thread 112.

[0041] In the process of submitting transactions in a single-machine scenario, thread 111 generates a transaction log after processing the transaction, writes the transaction log to the log cache, and then thread 111 enters a waiting state. After the log-to-disk thread 112 writes a batch of transaction logs in the log cache to the disk, it wakes up the waiting threads 111 one by one, and thread 111 obtains the log sequence number of the last transaction log in the batch of transaction logs from the log-to-disk thread 112 (i.e., the log sequence number of the disk progress), and compares the log sequence number of the last transaction log with the log sequence number of the transaction processed by thread 111. When the log sequence number of the transaction processed by thread 111 is less than or equal to the log sequence number of the last transaction log, it indicates that the transaction log corresponding to thread 111 has been written to the disk, and the transaction log submission is complete. When the log sequence number of the transaction processed by thread 111 is greater than the log sequence number of the last transaction log, it indicates that the transaction log corresponding to thread 111 has not been written to the disk, and thread 111 re-enters the waiting state.

[0042] See also Figure 2 In another example, the database system includes a computing device 11, a computing device 12, and a computing device 13. The computing device 11 is used to manage the primary database, and the computing device 11 includes a main thread pool, a log thread group, and a primary-standby replication thread group. The main thread pool includes multiple threads 111, the log thread group includes a log disk thread 112 and a redo thread 113, and the primary-standby replication thread group includes multiple sending threads 114 and a response thread 115. The computing devices 12 and 13 are used to manage the standby database. The computing devices 12 and 13 both include a receiving playback thread group, and the receiving playback thread group of the computing device 12 includes a receiving thread 121, a log disk thread 122, and a redo thread 123, and the receiving playback thread group of the computing device 13 includes a receiving thread 131, a log disk thread 132, and a redo thread 133.

[0043] In the master-slave replication scenario, thread 111 generates a transaction log when processing a transaction and writes the transaction log into the log cache. Log disk thread 112 writes a batch of transaction logs in the log cache to the disk to obtain a log file. During the master-slave replication process, sending thread 114 can send log files to computing device 12 and computing device 13. After receiving thread 121 receives the log file, log disk thread 122 writes the received log file to the disk, and redo thread 122 performs log playback based on the log file to back up data. After the data is backed up, receiving thread 121 sends the log sequence number of the last transaction log that has been written to the disk to computing device 11. After receiving the log sequence number sent by computing device 12, response thread 115 of computing device 11 wakes up thread 111 in waiting state. Thread 111 compares the log sequence number from computing device 12 with the log sequence number of the transaction log processed by the thread. When the log sequence number of the transaction processed by thread 111 is less than or equal to the log sequence number from computing device 12, it indicates that the transaction log corresponding to thread 111 in the standby database has been written to disk and the transaction submission is complete. When the log sequence number of the transaction processed by thread 111 is greater than the log sequence number from computing device 12, it indicates that the transaction log corresponding to thread 111 in the standby database has not been written to disk, and thread 111 re-enters waiting state. Similarly, for the log sequence number from computing device 13, after computing device 11 receives the log sequence number sent by computing device 13, it can wake up thread 111 corresponding to the transaction log that has been written to disk or reset thread 111 corresponding to the transaction log that has not been written to disk to waiting state according to the log sequence number.

[0044] In actual cloud computing scenarios, large-scale concurrent transactions will generate a large number of threads in a waiting state. When a large number of threads are in a waiting state, the threads corresponding to the transaction logs that have not been written to the disk are woken up and waited for many times, which will waste computing resources. The wake-up method of this application can wake up threads in groups, thereby reducing resource overhead. Figure 3 , an embodiment of the transaction log synchronization method in the present application includes:

[0045] Step 301: The computing device uses multiple threads to write a transaction log in a log cache of the computing device.

[0046] In this embodiment, when writing a log, each thread processes a transaction log, so the thread, the transaction log and the log sequence number of the transaction log are one-to-one corresponding.

[0047] Step 302: The computing device changes the states of multiple threads from a working state to a waiting state.

[0048] Step 303: The computing device determines the sequence number group to which the log sequence number of each transaction log belongs.

[0049] This application can pre-set continuous group_len sequence number groups, and the sequence number group can be considered as a sequence number interval. The sequence number interval where the log sequence number is located is the sequence number group where the log is located. The length of each sequence number interval is equal, and the length of each sequence number interval can be set according to actual conditions.

[0050] Specifically, the log sequence number is divided by the size of the sequence group, and the quotient obtained by the division operation and the total number of sequence groups are modulo-operated to obtain the identifier of the sequence group to which the log sequence number belongs. The identifier of the sequence group is recorded as group_id, the size of the sequence group is recorded as group_size, and the total number of sequence groups is recorded as group_len, which satisfy the following formula:

[0051] group_id=((LSN / group_size)%group_len).

[0052] Step 304: The computing device writes the transaction log in the log cache to the disk.

[0053] Step 305: The computing device obtains the first disk-push progress log serial number.

[0054] Filing to disk means using the log flushing thread to read a batch of transaction logs from the log cache and write the read transaction logs to disk. When the first flushing progress log sequence number is the log sequence number of the last transaction log in the nth batch of transaction logs, the first flushing progress log sequence number is used to identify the flushing progress of the nth flushing.

[0055] Step 306: The computing device determines the end sequence number group to which the first disk-push progress log sequence number belongs.

[0056] Step 307: When the first disk-push progress log sequence number is the log sequence number of the last transaction log in the first batch of transaction logs, the computing device determines that the starting sequence number group is the first sequence number group.

[0057] Step 308: When the first disk-written progress log sequence number is not the log sequence number of the last transaction log in the first batch of transaction logs, the computing device determines that the starting sequence number group is the sequence number group where the second disk-written progress log sequence number is located.

[0058] There is no fixed order among step 306, step 307 and step 308. The second disk-stacked progress log sequence number is the previous disk-stacked progress log sequence number of the first disk-stacked progress log sequence number. When the first disk-stacked progress log sequence number is the log sequence number of the last transaction log in the nth batch of transaction logs of the primary database, the second disk-stacked progress log sequence number is the log sequence number of the last transaction log in the n-1th batch of transaction logs of the primary database, where n is an integer greater than 1.

[0059] Step 309: The computing device wakes up the thread according to the log sequence numbers from the start sequence number group to the end sequence number group.

[0060] In this embodiment, for log numbers before the first disk-stacked progress log number, the corresponding transaction logs have all been stored. For log numbers after the end sequence number group, the corresponding transaction logs have not been stored. For log numbers before the start sequence number group, the corresponding threads have all been awakened. For log numbers after the start sequence number group, the corresponding threads have not yet been awakened.

[0061] For transaction logs corresponding to log numbers from the start sequence number group to the end sequence number group, all or part of the threads corresponding to the transaction logs have not been awakened, and the threads can be awakened according to this method. For threads corresponding to log numbers after the end sequence number group, they will not be awakened repeatedly. Compared with awakening all threads, this method can save the resource overhead used for awakening and improve the awakening efficiency.

[0062] The present application can use a single thread to wake up the thread corresponding to the log sequence number in at least one sequence number group, or can use a multicast cascade solution to wake up the thread corresponding to the log sequence number in at least one sequence number group. The following introduces a method for synchronizing transaction logs with a single thread. In one embodiment, step 309 includes: using a single thread to obtain the semaphore of each sequence number group from the start sequence number group to the end sequence number group; using the semaphore of each sequence number group to wake up the thread corresponding to the log sequence number in the sequence number group.

[0063] In this embodiment, the sequence number group corresponds to the semaphore one-to-one. A single thread can send a semaphore to the thread corresponding to the log sequence number in each sequence number group in the order of the sequence number group, and the thread in the waiting state changes the waiting state to the working state according to the received semaphore. When the log sequence number corresponding to the thread is less than or equal to the first disk-stacked progress log sequence number, it is determined that the transaction log corresponding to the thread has been stored on the disk. When the log sequence number corresponding to the thread is greater than the first disk-stacked progress log sequence number, it is determined that the transaction log corresponding to the thread has not been stored on the disk.

[0064] It should be noted that all the transaction logs corresponding to the log numbers in the above end sequence number group may be written to the disk, or some of the transaction logs corresponding to the log numbers in the above end sequence number group may not be written to the disk. Since the number of transaction logs not written to the disk is small, compared with the prior art of waking up all threads, this application can effectively reduce the wake-up overhead.

[0065] For ease of understanding, refer to Figure 4In one example, multiple equal sequence number groups are preconfigured, and each sequence number group is a sequence number interval. Since the log sequence number is the address of the log cache, the sequence number interval can also be considered as an address segment, for example, sequence number group 1 is 0x100010 to 0x100020, sequence number group 2 is 0x100020 to 0x100030, and other sequence number groups can be deduced in the same way.

[0066] The threads in the waiting state include thread 1 to thread 6. The log sequence number corresponding to thread 1 is 401, the log sequence number corresponding to thread 2 is 402, the log sequence number corresponding to thread 3 is 403, the log sequence number corresponding to thread 4 is 404, the log sequence number corresponding to thread 5 is 405, and the log sequence number corresponding to thread 6 is 406. The log sequence number of the first batch of transaction logs is 402, and the log sequence number of the second batch of transaction logs is 406.

[0067] During the first wake-up, it can be determined according to 402 that both the starting sequence number group and the ending sequence number group are sequence number group 1, and the semaphore of sequence number group 1 is used to wake up the threads corresponding to all log sequence numbers in sequence number group 1.

[0068] During the second wake-up, the starting sequence group can be determined as sequence group 1 according to 402, and the ending sequence group can be determined as sequence group 5 according to 406. The semaphores of each sequence group are sent to sequence group 1 to sequence group 5 to wake up the threads corresponding to all log sequence numbers in sequence group 1 to sequence group 5.

[0069] It can be seen that each wake-up will only wake up the threads corresponding to some sequence number groups, which can reduce the number of threads corresponding to transaction logs that have not been written to the disk being woken up, thereby reducing the wake-up overhead. It should be understood that the total number of threads, the number of threads included in each sequence number group, and the number of sequence number groups are all illustrative examples, which can be set according to actual conditions and are not limited in this application.

[0070] The multicast cascade wake-up method is introduced below. In another embodiment, step 309 includes: for each sequence number group from the starting sequence number group to the ending sequence number group, waking up the thread corresponding to the first log sequence number in the sequence number group according to the semaphore of the sequence number group; waking up the thread corresponding to the i-th log sequence number according to the thread corresponding to the i-1th log sequence number, where i is an integer greater than 1.

[0071] In this embodiment, the sequence number groups correspond to the semaphores one by one. The semaphores are sent to the threads corresponding to the log sequence numbers in each sequence number group in the order of the sequence number groups. After the first thread of each sequence number group is awakened according to the semaphore of the sequence number group, the i-th thread is awakened by the i-1th thread, so that multiple threads assume the awakening function. Compared with a single thread awakening all threads, this can reduce the load of a single thread and reduce the problem of slow task response caused by excessive load on a single thread.

[0072] The transaction log synchronization method can be implemented through locks or critical sections. For example, lock the first thread, wake up the first thread according to the semaphore, unlock the first thread and then lock the second thread, unlock the second thread and then lock the third thread, until the last thread is unlocked.

[0073] Combine the following Figure 5 For an introduction to the wake-up process, see Figure 5 In one example, the threads corresponding to a sequence number group include thread 1, thread 2, and thread 3. After thread 1 is locked, it waits for a semaphore. After receiving the semaphore, thread 1 is awakened according to the semaphore and then unlocked. After thread 1 is unlocked, it locks thread 2. After thread 2 is unlocked, it locks thread 3, and then thread 3 is unlocked. In this way, threads 1 to 3 in the sequence number group can be awakened in sequence.

[0074] In the existing transaction log synchronization method, the first computing device adds the log sequence number corresponding to the thread in the waiting state to the log sequence number queue and sorts the log sequence number according to the size. After the first computing device receives the log sequence number of the disk progress sent by the second computing device, it determines the log sequence number in the log sequence number queue that is less than or equal to the log sequence number of the disk progress, and then wakes up the thread corresponding to the determined sequence number. In this method, establishing a log sequence number queue requires resource overhead. The present application provides a transaction log synchronization method that does not require the establishment of a queue and can reduce resource overhead. Figure 6 Another embodiment of the transaction log synchronization method in the present application includes:

[0075] Step 601: A first computing device uses multiple threads to write a transaction log into a log cache of the first computing device.

[0076] Step 602: The first computing device changes the states of multiple threads from a working state to a waiting state.

[0077] Step 603: The first computing device determines the sequence number group to which the log sequence number of each transaction log belongs.

[0078] Step 604: The first computing device writes the transaction log in the log cache to a disk.

[0079] Steps 601 to 604 are similar to steps 301 to 304. For details, please refer to Figure 3 The embodiments shown are described accordingly.

[0080] Step 605: The first computing device sends the log file obtained by writing to the disk to the second computing device.

[0081] Specifically, the first computing device sends the log file written to the disk to the second computing device through the first thread, and the second computing device can use the receiving thread to receive the log file sent by the first computing device. The first thread can be but is not limited to the sending thread.

[0082] Step 606: The second computing device writes the transaction log of the log file to a disk.

[0083] Specifically, the second computing device may use a log-to-disk thread to write the transaction log of the log file to the disk.

[0084] Step 607: The second computing device plays back the log according to the log file.

[0085] Specifically, the second computing device may use a redo thread to replay the log file.

[0086] Step 608: The second computing device uses the target thread to send the first log synchronization progress sequence number to the first computing device.

[0087] The target thread is a log receiving thread, a log disk writing thread, or a redo thread. When the target thread is a log receiving thread, the first log synchronization progress sequence number is the log sequence number of the last transaction log in the nth batch of transaction logs received by the receiving thread. When the target thread is a log disk writing thread, the first log synchronization progress sequence number is the log sequence number of the last transaction log in the nth batch of transaction logs received by the log disk writing thread. When the target thread is a redo thread, the first log synchronization progress sequence number is the log sequence number of the last transaction log in the nth batch of transaction logs received by the redo thread, and n is a positive integer.

[0088] The first computing device may receive the first log synchronization progress sequence number through a second thread, and the second thread may be, but is not limited to, a response thread.

[0089] Step 609: The first computing device determines the end sequence number group where the first log synchronization progress sequence number is located.

[0090] Step 610: When the first log synchronization progress sequence number is the log sequence number of the last transaction log in the first batch of transaction logs, determine that the starting sequence number group is the first sequence number group.

[0091] Step 611: When the first log synchronization progress sequence number is not the log sequence number of the last transaction log in the first batch of transaction logs, the first computing device determines that the starting sequence number group is the sequence number group where the second log synchronization progress sequence number is located.

[0092] The first log synchronization progress serial number is the log serial number of the last transaction log in the nth batch of transaction logs of the standby database, and the second log synchronization progress serial number is the log serial number of the previous disk progress serial number of the first log synchronization progress serial number. When n is an integer greater than 1, the second log synchronization progress serial number is the log serial number of the last transaction log in the n-1th batch of transaction logs of the standby database.

[0093] Step 612: The first computing device wakes up the thread according to the log sequence numbers from the start sequence number group to the end sequence number group.

[0094] The specific implementation of step 612 is similar to that of step 309 and will not be repeated here.

[0095] In this embodiment, the log sequence numbers corresponding to the threads in the waiting state are grouped, and then the threads corresponding to the transaction logs that have been written to the disk in the standby database are determined according to the first log synchronization progress sequence number and the second log synchronization progress sequence number, and then the above threads are awakened. Since there is no need to establish a log sequence number queue, resource overhead can be saved.

[0096] Combine the following Figure 7 right Figure 6 The threads involved in the illustrated embodiment are introduced, see Figure 7 In one example, the transaction log synchronization method of the present application includes:

[0097] Step 701: The log-writing thread of the first computing device writes a batch of transaction logs to disk.

[0098] Step 702: The log write-to-disk thread of the first computing device sends a master-slave synchronization instruction to the sending thread.

[0099] Step 703: The sending thread of the first computing device reads the log file.

[0100] Step 704: The sending thread of the first computing device sends the log file to the receiving thread of the second computing device.

[0101] Step 705: The log writing thread of the second computing device obtains the transaction log from the receiving thread.

[0102] Step 706: The log disk write thread of the second computing device aggregates multiple transaction logs in real time.

[0103] After multiple transaction logs are written to disk, the last transaction log aggregated in real time is used as the log sequence number of the write progress.

[0104] Step 707: The log disk write thread of the second computing device sends the log synchronization progress sequence number to the response thread of the first computing device.

[0105] Step 708: The response thread of the first computing device multicasts and wakes up multiple transaction processing threads.

[0106] The response thread group of the first computing device determines the transaction processing thread to be awakened according to the log synchronization progress sequence number. The sequence number group corresponding to the transaction processing thread to be awakened includes all sequence number groups from the starting sequence number group to the ending sequence number group. Then, a semaphore is sent to the transaction processing thread to be awakened using multicast to wake up the transaction processing thread.

[0107] See also Figure 8 In one example, Figure 2 Taking the database system shown as an example, multiple threads of the computing device 11 concurrently execute transactions, each transaction includes an insert statement. The number of concurrent transactions, the number of transactions per second (TPS) of the existing method, the TPS of the method of the present application, and the efficiency improvement ratio can be found in Table 1.

[0108] Concurrency TPS of existing methods TPS of this application method Efficiency improvement ratio 1 753 3492 364% 2 3430 6785 98% 3 6302 9802 56%

[0109] Table 1

[0110] The TPS change curve of the existing method and the TPS change curve of the present application method can be found in Figure 8 From Table 1 and Figure 8 It can be seen that the transaction log synchronization method of the present application can improve transaction submission efficiency.

[0111] Under the condition of more concurrent numbers, the TPS of the existing method and the TPS of the method of this application are shown in Table 2:

[0112] Concurrency TPS of existing methods TPS of this application method Efficiency improvement ratio 60 95543 154703 52% 120 104555 282393 170% 200 103173 392614 281% 250 101391 447369 341% 300 100820 467679 364% 351 97102 504544 420%

[0113] Table 2

[0114] Under the condition of more concurrent numbers, the TPS change curve of the existing method and the TPS change curve of the method of the present application can be found in Fig. 9 From Table 2 and Fig. 9 It can be seen that the transaction log synchronization method of the present application can improve transaction submission efficiency.

[0115] The following is an introduction to a computing device that can implement the transaction log synchronization method of the present application. Fig.10In one embodiment, the computing device 1000 includes a processing module 1001, which is used to use multiple threads to write transaction logs in the log cache of the first computing device; change the status of the multiple threads from a working state to a waiting state; determine the sequence number group where the log sequence number of each transaction log is located; write the transaction logs in the log cache to the disk; obtain the first log synchronization progress sequence number and then determine the end sequence number group where the first log synchronization progress sequence number is located; when the first log synchronization progress sequence number is the log sequence number of the last transaction log in the first batch of transaction logs, determine the starting sequence number group as the first sequence number group; when the first log synchronization progress sequence number is not the log sequence number of the last transaction log in the first batch of transaction logs, determine the starting sequence number group as the sequence number group where the second log synchronization progress sequence number is located; wake up the thread according to the log sequence numbers from the starting sequence number group to the end sequence number group.

[0116] As an example of a software functional unit, the processing module 1001 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the processing module 1001 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code can be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code can be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with similar geographical locations. Among them, usually a region can include multiple AZs.

[0117] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.

[0118] As an example of a hardware functional unit, the processing module 1001 may include at least one computing device, such as a server, etc. Alternatively, the processing module 1001 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0119] The multiple computing devices included in the processing module 1001 can be distributed in the same region or in different regions. The multiple computing devices included in the processing module 1001 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the processing module 1001 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0120] It should be noted that, in other embodiments, the processing module 1001 may be used to execute Figure 3 Any steps executed by the computing device in the illustrated embodiment implement the full functions of the computing device.

[0121] See also Fig.11In another embodiment, the computing device 1100 includes a receiving module 1101, a processing module 1102 and a sending module 1103, wherein the processing module 1102 is used to use multiple threads to write transaction logs in the log cache of the computing device 1100; change the status of the multiple threads from the working state to the waiting state; determine the sequence number group to which the log sequence number of each transaction log belongs; write the transaction log in the log cache to the disk; the sending module 1103 is used to send the log file obtained by writing to the disk to the second computing device; the receiving module 1101 is used to receive the first log synchronization progress sequence number sent by the second computing device ; The processing module 1102 is also used to determine the ending sequence number group where the first log synchronization progress sequence number is located; when the first log synchronization progress sequence number is the log sequence number of the last transaction log in the first batch of transaction logs, the starting sequence number group is determined to be the first sequence number group; when the first log synchronization progress sequence number is not the log sequence number of the last transaction log in the first batch of transaction logs, the starting sequence number group is determined to be the sequence number group where the second log synchronization progress sequence number is located, and the second log synchronization progress sequence number is the previous disk progress log sequence number of the first log synchronization progress sequence number; wake up the thread according to the log sequence numbers from the starting sequence number group to the ending sequence number group.

[0122] As an example of a software functional unit, the processing module 1102 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the processing module 1102 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code can be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code can be distributed in the same AZ or in different AZs, and each AZ includes a data center or multiple data centers with close geographical locations. Among them, usually a region can include multiple AZs.

[0123] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same VPC or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.

[0124] As an example of a hardware functional unit, the processing module 1102 may include at least one computing device, such as a server, etc. Alternatively, the processing module 1102 may also be a device implemented using ASIC or PLD, etc. The PLD may be implemented using CPLD, FPGA, GAL or any combination thereof.

[0125] The multiple computing devices included in the processing module 1102 can be distributed in the same region or in different regions. The multiple computing devices included in the processing module 1102 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the processing module 1102 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0126] It should be noted that, in other embodiments, the receiving module 1101 may be used to execute Figure 6 In the embodiment shown, the processing module 1102 may be used to perform any step performed by the first computing device. Figure 6 In any step performed by the first computing device in the embodiment shown, the sending module 1103 can be used to perform Figure 6 For any steps executed by the first computing device in the illustrated embodiment, the steps that the receiving module 1101, the processing module 1102 and the sending module 1103 are responsible for implementing can be specified as needed, and all functions of the first computing device can be realized by respectively implementing different steps in the transaction log synchronization method through the receiving module 1101, the processing module 1102 and the sending module 1103.

[0127] In other embodiments, the receiving module 1101 may be used to execute Figure 6 In the embodiment shown, the processing module 1102 may be used to perform any step performed by the second computing device. Figure 6 In any step performed by the second computing device in the embodiment shown, the sending module 1103 can be used to perform Figure 6 For any steps executed by the second computing device in the illustrated embodiment, the steps that the receiving module 1101, the processing module 1102 and the sending module 1103 are responsible for implementing can be specified as needed, and all functions of the second computing device can be realized by respectively implementing different steps in the transaction log synchronization method through the receiving module 1101, the processing module 1102 and the sending module 1103.

[0128] In one embodiment, the database system of the present application includes a computing device 1000. In another embodiment, the database system of the present application includes multiple computing devices 1100, one or more computing devices 1100 are used to execute the steps executed by the first computing device, and another one or more computing devices 1100 are used to execute the steps executed by the second computing device, such as Fig.12 shown.

[0129] The present application also provides a computing device 1300. Fig.13 As shown, in one embodiment, the computing device 1300 includes: a bus 1302, a processor 1304, a memory 1306, and a communication interface 1308. The processor 1304, the memory 1306, and the communication interface 1308 communicate through the bus 1302. The computing device 1300 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 1300.

[0130] The bus 1302 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.13 The bus 1304 may include a path for transmitting information between various components of the computing device 1300 (eg, the memory 1306, the processor 1304, and the communication interface 1308).

[0131] The processor 1304 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0132] The memory 1306 may include a volatile memory, such as a random access memory (RAM). The processor 1304 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0133] The memory 1306 stores executable program codes. Optionally, the processor 1304 executes the executable program codes to respectively implement Fig.11 In the embodiment shown, the functions of the receiving module, the processing module and the sending module are implemented to realize the transaction log synchronization method. Alternatively, the processor 1304 executes the executable program code to respectively implement Fig.10 The functions of the processing module in the illustrated embodiment are used to implement the transaction log synchronization method. That is, the memory 1306 stores instructions for executing the transaction log synchronization method.

[0134] The communication interface 1308 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1300 and other devices or communication networks.

[0135] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.

[0136] like Fig.14 As shown, the computing device cluster includes at least one computing device 1300. Instructions for executing the transaction log synchronization method may be stored in the memory 1306 of one or more computing devices 1300 in the computing device cluster.

[0137] In some possible implementations, the memory 1306 of one or more computing devices 1300 in the computing device cluster may also store partial instructions for executing the transaction log synchronization method. In other words, the combination of one or more computing devices 1300 may jointly execute instructions for executing the transaction log synchronization method.

[0138] It should be noted that the memory 1306 in different computing devices 1300 in the computing device cluster may store different instructions, which are respectively used to execute the functions of the computing device 1100. That is, the instructions stored in the memory 1306 in different computing devices 1300 may implement the functions of one or more modules in the computing device 1100.

[0139] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.15 A possible implementation is shown. Fig.15 As shown, two computing devices 1300A and 1300B are connected via a network. Specifically, they are connected to the network via a communication interface in each computing device. In this type of possible implementation, the memory 1306 in the computing device 1300A stores instructions for executing the functions of the receiving module. At the same time, the memory 1306 in the computing device 1300B stores instructions for executing the functions of the processing module and the sending module.

[0140] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes a transaction log synchronization method.

[0141] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computer or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computer to execute the transaction log synchronization method.

[0142] The present application also provides a chip system, which includes a processor and a memory coupled to each other. The memory is used to store computer programs or instructions, and the processor is used to execute the computer programs or instructions stored in the memory, so that the computer executes the steps performed by the receiving module, the processing module or the sending module in the above embodiment. Optionally, the memory is a memory in the chip, such as a register, a cache, etc., and the memory can also be a memory located outside the chip in the site, such as a read-only memory or other types of static storage devices that can store static information and instructions, a random access memory, etc. The processor mentioned in any of the above places can be a general-purpose central processing unit, a microprocessor, a dedicated integrated circuit or one or more integrated circuits for implementing the above-mentioned transaction log synchronization method.

[0143] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A transaction log synchronization method, characterized in that: The method is applied to a database system, the database system comprising a first computing device and a second computing device, the first computing device being used to manage a primary database, the second computing device being used to manage a standby database, the method comprising: The first computing device writes a transaction log in a log cache of the first computing device using a plurality of threads; The first computing device modifies the states of the plurality of threads from a working state to a waiting state; The first computing device determines the sequence number group to which the log sequence number of each of the transaction logs belongs; The first computing device writes the transaction log in the log cache to a disk; The first computing device sends the log file obtained by writing to the disk to the second computing device; The first computing device receives a first log synchronization progress sequence number sent by the second computing device; The first computing device determines the end sequence number group where the first log synchronization progress sequence number belongs; When the first log synchronization progress sequence number is the log sequence number of the last transaction log in the first batch of transaction logs, the first computing device determines that the starting sequence number group is the first sequence number group; When the first log synchronization progress sequence number is not the log sequence number of the last transaction log in the first batch of transaction logs, the first computing device determines that the starting sequence number group is the sequence number group where the second log synchronization progress sequence number is located, and the second log synchronization progress sequence number is the log sequence number of the previous disk-written progress of the first log synchronization progress sequence number; The first computing device wakes up threads according to log sequence numbers from the start sequence number group to the end sequence number group.

2. The method according to claim 1, characterized in that The first computing device sending the log file obtained by writing to the disk to the second computing device includes: the first computing device uses the first thread to send the log file obtained by writing to the disk to the second computing device; The first computing device receiving the first log synchronization progress sequence number sent by the second computing device includes: the first computing device uses a second thread to receive the first log synchronization progress sequence number sent by the second computing device, and the first thread is different from the second thread.

3. The method according to any one of claims 1 to 2, characterized in that The first computing device wakes up the thread according to the log sequence numbers from the starting sequence number group to the ending sequence number group, including: For each sequence number group from the starting sequence number group to the ending sequence number group, wake up the thread corresponding to the first log sequence number in the sequence number group according to the semaphore of the sequence number group; The thread corresponding to the i-th log sequence number is woken up according to the thread corresponding to the i-1th log sequence number, where i is an integer greater than 1.

4. The method according to any one of claims 1 to 2, characterized in that The first computing device wakes up the thread according to the log sequence numbers from the starting sequence number group to the ending sequence number group, including: Acquire the semaphore of each sequence number group from the starting sequence number group to the ending sequence number group through a single thread; The semaphore of each sequence number group is used to wake up the thread corresponding to the log sequence number in the sequence number group.

5. A transaction log synchronization method, characterized in that: The method is applied to a database system, the database system comprising a first computing device and a second computing device, the first computing device being used to manage a primary database, the second computing device being used to manage a standby database, the method comprising: The second computing device receives the log file sent by the first computing device; The second computing device writes the transaction log of the log file to a disk; The second computing device performs log playback according to the log file; The second computing device uses a target thread to send a first log synchronization progress sequence number to the first computing device, where the target thread is a log receiving thread, a log disk thread, or a redo thread. The first log synchronization progress sequence number is used to wake up a thread corresponding to a log sequence number in at least one sequence number group.

6. The method according to claim 5, characterized in that The second computing device sending the first log synchronization progress sequence number to the first computing device using the target thread includes: Counts the number of transaction logs executed using the target thread; When the number of transaction logs executed using the target thread reaches a preset number, the second computing device determines that the first log synchronization progress sequence number is the log sequence number of the last transaction log executed using the target thread, and sends the first log synchronization progress sequence number to the first computing device; When the number of transaction logs executed using the target thread is less than a preset number and the idle time of the target thread reaches a preset time, the second computing device determines that the first log synchronization progress number is the log number of the last transaction log executed using the target thread, and sends the first log synchronization progress number to the first computing device.

7. A transaction log synchronization method, characterized in that: include: The computing device writes a transaction log in a log cache of the computing device using a plurality of threads; The computing device changes the states of the plurality of threads from a working state to a waiting state; The computing device determines the sequence number group to which the log sequence number of each transaction log belongs; The computing device writes the transaction log in the log cache to a disk; The computing device obtains a first disk placement progress log sequence number; The computing device determines the end sequence number group where the first disk-transfer progress log sequence number belongs; When the first disk-stacked progress log sequence number is the log sequence number of the last transaction log in the first batch of transaction logs, the computing device determines that the starting sequence number group is the first sequence number group; When the first disk-push progress log sequence number is not the log sequence number of the last transaction log in the first batch of transaction logs, the computing device determines that the starting sequence number group is the sequence number group where the second disk-push progress log sequence number is located, and the second disk-push progress log sequence number is the previous disk-push progress log sequence number of the first disk-push progress log sequence number; The computing device wakes up the thread according to the log sequence numbers from the start sequence number group to the end sequence number group.

8. The method according to claim 7, characterized in that The computing device wakes up the thread according to the log sequence numbers from the starting sequence number group to the ending sequence number group, including: For each sequence number group from the starting sequence number group to the ending sequence number group, the computing device wakes up the thread corresponding to the first log sequence number in the sequence number group according to the semaphore of the sequence number group; The thread corresponding to the i-th log sequence number is woken up according to the thread corresponding to the i-1th log sequence number, where i is an integer greater than 1.

9. The method according to claim 7, characterized in that: The computing device wakes up the thread according to the log sequence numbers from the starting sequence number group to the ending sequence number group, including: The computing device uses a single thread to obtain the semaphore of each sequence number group from the starting sequence number group to the ending sequence number group; The semaphore of each sequence number group is used to wake up the thread corresponding to the log sequence number in the sequence number group.

10. A computing device, characterized in that: include: A processing module, configured to use a plurality of threads to write a transaction log into a log cache of a first computing device; modify the states of the plurality of threads from a working state to a waiting state; and determine a sequence number group to which a log sequence number of each of the transaction logs belongs; Writing the transaction log in the log cache to a disk; a sending module, configured to send the log file obtained by writing to the disk to the second computing device; A receiving module, configured to receive a first log synchronization progress sequence number sent by the second computing device; The processing module is further used to determine the ending sequence number group where the first log synchronization progress sequence number is located; when the first log synchronization progress sequence number is the log sequence number of the last transaction log in the first batch of transaction logs, determine the starting sequence number group to be the first sequence number group; when the first log synchronization progress sequence number is not the log sequence number of the last transaction log in the first batch of transaction logs, determine the starting sequence number group to be the sequence number group where the second log synchronization progress sequence number is located, and the second log synchronization progress sequence number is the previous disk progress log sequence number of the first log synchronization progress sequence number; wake up the thread according to the log sequence numbers from the starting sequence number group to the ending sequence number group.

11. The device according to claim 10, characterized in that The sending module is specifically used to send the log file obtained by writing to the disk to the second computing device by using the first thread; The receiving module is specifically configured to use a second thread to receive a first log synchronization progress sequence number sent by a second computing device, wherein the first thread is different from the second thread.

12. The device according to any one of claims 10 to 11, characterized in that The processing module is specifically used to wake up the thread corresponding to the first log sequence number in each sequence number group from the starting sequence number group to the ending sequence number group according to the semaphore of the sequence number group; wake up the thread corresponding to the i-th log sequence number according to the thread corresponding to the i-1th log sequence number, where i is an integer greater than 1.

13. The device according to any one of claims 10 to 11, characterized in that The processing module is specifically used to use a single thread to obtain the semaphore of each sequence number group from the starting sequence number group to the ending sequence number group; and use the semaphore of each sequence number group to wake up the thread corresponding to the log sequence number in the sequence number group.

14. A computing device, characterized in that: include: A receiving module, configured to receive a log file sent by the first computing device; A processing module, used for writing the transaction log of the log file to a disk; Perform log playback according to the log file; A sending module is used to use a target thread to send a first log synchronization progress sequence number to the first computing device, where the target thread is a log receiving thread, a log disk thread or a redo thread, and the first log synchronization progress sequence number is used to wake up a thread corresponding to a log sequence number in at least one sequence number group.

15. The device according to claim 14, characterized in that The sending module is specifically used to count the transaction logs executed by the target thread; when the number of the transaction logs executed by the target thread reaches a preset number, determine that the first log synchronization progress number is the log sequence number of the last transaction log executed by the target thread, and send the first log synchronization progress number to the first computing device; When the number of transaction logs executed using the target thread is less than a preset number and the idle time of the target thread reaches a preset time, the first log synchronization progress number is determined to be the log number of the last transaction log executed using the target thread, and the first log synchronization progress number is sent to the first computing device.

16. A computing device, characterized in that: include: A processing module, used to use multiple threads to write transaction logs in the log cache of a computing device; change the status of the multiple threads from a working status to a waiting status; determine the sequence number group where the log sequence number of each transaction log is located; write the transaction logs in the log cache to a disk; obtain a first disk-written progress log sequence number; determine the ending sequence number group where the first disk-written progress log sequence number is located; when the first disk-written progress log sequence number is the log sequence number of the last transaction log in the first batch of transaction logs, determine the starting sequence number group to be the first sequence number group; when the first disk-written progress log sequence number is not the log sequence number of the last transaction log in the first batch of transaction logs, determine the starting sequence number group to be the sequence number group where the second disk-written progress log sequence number is located, and the second disk-written progress log sequence number is the previous disk-written progress log sequence number of the first disk-written progress log sequence number; wake up the thread according to the log sequence numbers from the starting sequence number group to the ending sequence number group.

17. The device according to claim 16, characterized in that The processing module is specifically used to wake up the thread corresponding to the first log sequence number in each sequence number group from the starting sequence number group to the ending sequence number group according to the semaphore of the sequence number group; wake up the thread corresponding to the i-th log sequence number according to the thread corresponding to the i-1th log sequence number, where i is an integer greater than 1.

18. The device according to claim 16, characterized in that The processing module is specifically used to use a single thread to obtain the semaphore of each sequence number group from the starting sequence number group to the ending sequence number group; and use the semaphore of each sequence number group to wake up the thread corresponding to the log sequence number in the sequence number group.

19. A computing device cluster, characterized in that: The method comprises at least one computing device, each computing device comprises a processor and a memory, and the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 9.

20. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, and when the computer program instructions are executed by a computing device, the computing device performs the method according to any one of claims 1 to 9.

21. A computer program product comprising instructions, characterized in that When the instructions are executed by a computer device, the computer device is caused to perform the method according to any one of claims 1 to 9.