WO2022001723A1 - 一种数据同步方法及装置 - Google Patents

一种数据同步方法及装置 Download PDF

Info

Publication number
WO2022001723A1
WO2022001723A1 PCT/CN2021/101223 CN2021101223W WO2022001723A1 WO 2022001723 A1 WO2022001723 A1 WO 2022001723A1 CN 2021101223 W CN2021101223 W CN 2021101223W WO 2022001723 A1 WO2022001723 A1 WO 2022001723A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
queue
identifier
completion queue
host
Prior art date
Application number
PCT/CN2021/101223
Other languages
English (en)
French (fr)
Inventor
江建宇
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP21834339.0A priority Critical patent/EP4170519A4/en
Publication of WO2022001723A1 publication Critical patent/WO2022001723A1/zh
Priority to US18/146,955 priority patent/US20230137609A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2097Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements maintaining the standby controller/processing unit updated
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1464Management of the backup or restore process for networked environments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/80Database-specific techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Definitions

  • the present application relates to the field of computer databases, and in particular, to a data backup method and device.
  • a standby machine is generally provided to synchronize the data including the data operation records, and perform the same data operations as the host computer based on the data including the data operation records.
  • the main machine fails, it can be switched to the standby machine to provide external services.
  • the data synchronization methods of the master (master) and the standby machine (standby) are generally divided into two types.
  • One is synchronous replication.
  • the master transaction is submitted, the data including the data operation record is written to the file synchronously in the local machine. It is also necessary to synchronize the files written to the standby machine before the transaction can be considered to be committed.
  • the other is asynchronous replication. After the transaction completes the writing of the local file including the data of the data operation record, it directly declares that the transaction commit is completed without waiting for the synchronization of the standby machine to complete.
  • synchronous replication needs to wait synchronously for the standby machine to synchronize, resulting in significantly increased transaction commit delays, so its performance is significantly weaker than asynchronous replication.
  • asynchronous replication may cause the committed transaction to not complete synchronization on the standby machine.
  • information may be lost, which is problematic. Therefore, for scenarios requiring high reliability and high availability, synchronous replication technology is generally used.
  • the data synchronization process of the host can trigger the standby machine to synchronize data, and when the standby machine is synchronizing data, the transaction process related to the host is in a sleep state. After the standby machine completes the synchronization, the data synchronization process of the host needs to follow Wake up the corresponding transaction process. After the wake-up of the transaction process is completed, the data synchronization process can continue to trigger the standby machine to synchronize data.
  • the data synchronization process needs to wake up many transaction processes.
  • the data synchronization process needs to spend a lot of time to wake up the transaction process, which in turn makes the transaction process that enters the sleep state due to waiting for the synchronization machine to perform data synchronization. More, which increases the delay of transaction processing by the transaction process.
  • an embodiment of the present application provides a data synchronization method, the method comprising:
  • the data synchronization process sends the first data to the standby machine, and the first data is generated by the first process; wherein, the first process can be a transaction process running on the host computer, and the host computer reads the operation instruction issued by the user after receiving the operation instruction.
  • a corresponding transaction process can be generated, the transaction process includes operations corresponding to the operation instructions issued by the user, and the transaction process can perform corresponding operations on the storage devices in the database, wherein the operations can include adding data, Delete data, modify data, query data, etc.
  • the first data may be, but not limited to, a transaction log (database transaction log for dealing with crash recovery, XLOG) for processing failure recovery.
  • the standby machine can obtain the operations performed by the transaction process of the host machine, and perform the same operations, thereby realizing the data synchronization of the host machine on the backup machine.
  • the data synchronization process wakes up the second process based on the completion of the synchronization of the first data by the standby machine; after receiving the synchronization progress sent by the standby machine, the data synchronization process can wake up the second process, and the second process wakes up the The first process, the transaction process is awakened by the second process.
  • the data synchronization process may traverse the waiting queue, separate the completed transaction process (including the first process) from the waiting queue according to the completion progress, and generate a completion queue (including the first process).
  • This completion queue can be generated temporarily, and after all transaction processes in this completion queue are awakened, this completion queue can no longer exist.
  • the data synchronization process can wake up the second process, and the second process can wake up the first process in the completion queue, that is, the second process wakes up the transaction process. It should be noted that the data synchronization process can first generate a completion queue including the first process, and then wake up the second process; or wake up the second process first, and then generate a completion queue including the first process, which is not limited to the generation of the completion queue. and the sequence in which the second process wakes up.
  • the above-mentioned queues are just an implementation manner, and other data structures having the same or similar data structures may also be used to replace the queues in the embodiments of the present application.
  • the second process may not be a transaction process, but a process that is solely used to wake up the transaction process.
  • the second process may be started when the database service is started, and the second process needs to be woken up when there is no transaction process.
  • the second process In the sleep state, the second process can wake up the transaction process after being woken up by the data synchronization process, and can enter the sleep state after completing the wakeup of the transaction process.
  • the data synchronization process does not need to wake up the transaction process whose data synchronization has been completed, but only needs to wake up a process specially used to wake up the completed data synchronization, so that the data synchronization process can be more focused on triggering the backup machine to perform data synchronization. Synchronize and receive the synchronization progress of the backup machine, thereby relieving the pressure of the data synchronization process and reducing the time for the data synchronization process to wake up the transaction process.
  • the method further includes: before the data synchronization process sends the first data to the standby machine, the data synchronization process receives a data synchronization request corresponding to the first process.
  • the first process is configured to perform a first operation on the database, and the first data includes an operation record corresponding to the first operation.
  • the method further includes: the data synchronization process sends second data to the standby machine, where the second data is generated by the second process; the data synchronization process After the standby machine completes the synchronization of the first data and the second data, the second process is woken up.
  • the second process is configured to perform a second operation on the database, and the second data includes an operation record corresponding to the second operation.
  • the host includes a completion queue, and the identifier of the second process is located in the first element of the completion queue; the waking up the second process includes:
  • a completion queue is generated at least according to the identifier of the second process, wherein the The identification of the second process is located in the first element of the completion queue.
  • the first element is the head element of the completion queue.
  • the identifier of the first process is located in a second element of the completion queue, and in the completion queue, the second element is located after the first element; the The second process wakes up the process corresponding to the identifier included in the second element.
  • the second process may wake up processes corresponding to identifiers included in multiple elements located after the first element in the completion queue.
  • the second process may replace the data synchronization process to wake up other processes in the completion queue. Specifically, the second process needs to detect whether the subsequent elements of the completion queue contain other transaction processes, and if so, it needs to be responsible for waking up the remaining transaction processes in the completion queue.
  • the second element is adjacent to the first element; the second process may wake up in the completion queue adjacent to the first element and located at the first element The element after the element includes the process.
  • the host includes a waiting queue, and before the standby machine completes the synchronization, the identifier of the second process is located in a third element in the waiting queue, and the first process The identifier of is located in the fourth element in the waiting queue, and the fourth element is after the third element; wherein, the completion queue is generated according to the waiting queue.
  • the generated completion queue maintains the sequence of processes in the original waiting queue, which ensures the first-in, first-out of transaction processing.
  • the completion queue is all or a part of the waiting queue.
  • the relative positions of the third element and the fourth element in the waiting queue, and the relative positions of the first element and the second element in the completion queue Same location. That is, the interval and the sequence between the element where the second process is located and the element where the first process is located remain unchanged.
  • the identifier of the second process is located in a head element of the waiting queue, and the identifier of the first process is located in an element other than the head element in the waiting queue.
  • the data synchronization process can wake up the process included in the head element, and the processes corresponding to the identifiers included in successive adjacent elements, until the second process is woken up.
  • the host includes a completion queue, the identifier of the first process is located in a first element of the completion queue, and the second process is located outside the completion queue; the second process is located outside the completion queue;
  • the process of waking up the first process includes: waking up, by the second process, the process corresponding to the identifier included in the first element.
  • the second process may not be a transaction process, but a process solely used to wake up the transaction process.
  • the first process is a process corresponding to an identifier included in any element in the waiting queue (waiting queue).
  • the completion queue is generated at least according to the first process, and the identifier of the first process is located in the first element of the completion queue; the second process wakes up the first element The process corresponding to the ID included in .
  • the method further includes:
  • a completion queue is generated at least according to the identifier of the first process, wherein the first process's The identifier is in the first element of the completion queue.
  • the host includes a waiting queue, and before the standby machine completes the synchronization, the identifier of the first process is located in the fourth element of the waiting queue; wherein, the completion The queue is generated according to the waiting queue.
  • the completion queue is all or a part of the waiting queue.
  • the first process and the second process run on a host, the host includes multiple NUMA nodes, and the second process and the first process belong to the same NUMA node Included process.
  • the first process and the second process run on a host, the host includes multiple NUMA nodes, and at least one of the second process and the first process , which belongs to the same NUMA node as the completion queue.
  • the first process and the second process run on a host
  • the host includes multiple NUMA nodes, and at least one of the second process and the first process , and the waiting queue belongs to the same NUMA node; and/or, the completion queue and the waiting queue belong to the same NUMA node.
  • the completion queue and the waiting queue belong to the same NUMA node.
  • the data related to the second process and the first process occupies memory resources under the same NUMA node.
  • the data related to the completion queue and the waiting queue occupy the memory resources under the same NUMA node.
  • a corresponding waiting queue may be allocated to each NUMA node, and transaction processes (the second process and the first process) may be allocated to the waiting queue of the node.
  • transaction processes the second process and the first process
  • the completion queue detached from the waiting queue also needs to be located at this node. Based on this, when the completion queue traverses and wakes up the transaction process, the process and the accessed data are located in the same NUMA node, which avoids expensive remote memory access and further improves the efficiency of the parallel wake-up mechanism.
  • the present application provides a method for writing data, the method comprising: a data writing process wakes up a second process based on completing the writing operation on first data, wherein the first data is the first process generated; and, the second process wakes up the first process.
  • the second process can be woken up, and then the second process can complete the wake-up of the process or complete the wake-up of the process in conjunction with other processes in the completion queue.
  • the time that the local data writing process spends on waking up the transaction process can be reduced, thereby improving the efficiency of the file writing operation.
  • the first process is configured to perform a first operation on the database, and the first data includes an operation record corresponding to the first operation.
  • the data writing process wakes up the second process based on completing the writing operation to the first data, including:
  • the data writing process wakes up the second process based on the completion of the writing operation on the first data and the second data; wherein, the second data is generated by the second process.
  • the second process is configured to perform a second operation on the database, and the second data includes an operation record corresponding to the second operation.
  • the host includes a completion queue, and the identifier of the second process is located in the first element of the completion queue; the waking up the second process includes:
  • the method further includes:
  • the data writing process Before waking up the second process, after the data writing process completes the writing operation of the first data, the data writing process generates a completion queue at least according to the identifier of the second process, wherein the The identification of the two processes is located in the first element of the completion queue.
  • the first element is the head element of the completion queue.
  • the identifier of the first process is located in a second element of the completion queue, and in the completion queue, the second element is located after the first element;
  • waking up the first process by the second process includes:
  • the second process wakes up the process corresponding to the identifier included in the second element.
  • the second process wakes up a process included in the second element, including:
  • the second process wakes up processes corresponding to identifiers included in a plurality of elements located after the first element in the completion queue.
  • the second element is adjacent to the first element; correspondingly, the second process wakes up a process included in the second element, including:
  • the second process wakes up processes included in elements adjacent to and subsequent to the first element in the completion queue.
  • the host includes a waiting queue, and before the data writing process completes the writing operation to the first data, the identifier of the second process is located in a third element in the waiting queue , the identifier of the first process is located in the fourth element in the waiting queue, and the fourth element is after the third element; wherein, the completion queue is generated according to the waiting queue.
  • the completion queue is all or a part of the waiting queue.
  • the relative positions of the third element and the fourth element in the waiting queue, and the relative positions of the first element and the second element in the completion queue Same location.
  • the identifier of the second process is located in a head element of the waiting queue, and the identifier of the first process is located in an element other than the head element in the waiting queue.
  • the host includes a completion queue, the identifier of the first process is located in a first element of the completion queue, and the second process is located outside the completion queue; the second process is located outside the completion queue;
  • the process wakes up the first process, including:
  • the second process wakes up the process corresponding to the identifier included in the first element.
  • the method further includes:
  • a completion queue is generated at least according to the identifier of the first process, wherein the first process's The identifier is in the first element of the completion queue.
  • the host includes a waiting queue, and before the data writing process completes the writing operation to the first data, the identifier of the first process is located in the fourth element in the waiting queue ; wherein, the completion queue is generated according to the waiting queue.
  • the completion queue is all or a part of the waiting queue.
  • the first process and the second process run on a host, the host includes multiple NUMA nodes, and the second process and the first process belong to the same NUMA node Included process.
  • the first process and the second process run on a host, the host includes multiple NUMA nodes, and at least one of the second process and the first process , which belongs to the same NUMA node as the completion queue.
  • the first process and the second process run on a host
  • the host includes multiple NUMA nodes, and at least one of the second process and the first process , and the waiting queue belongs to the same NUMA node; and/or, the completion queue and the waiting queue belong to the same NUMA node.
  • the present application provides a data synchronization device, which may include a processor, the processor is coupled with a memory, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the above-mentioned first aspect and any one of the method described.
  • a data synchronization device which may include a processor, the processor is coupled with a memory, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the above-mentioned first aspect and any one of the method described.
  • the present application provides a data writing device, which may include a processor, the processor is coupled to a memory, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, any one of the above-mentioned second aspects is implemented. the method described. For the steps performed by the processor in the second aspect and each possible implementation manner thereof, reference may be made to the second aspect for details, and details are not repeated here.
  • the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, which, when executed on a computer, causes the computer to execute any of the methods described in the first aspect above. .
  • the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, which, when executed on a computer, causes the computer to execute any of the methods described in the second aspect above. .
  • the present application provides a circuit system, the circuit system comprising a processing circuit configured to perform the above-mentioned first aspect and any one of the methods.
  • the present application provides a circuit system, the circuit system comprising a processing circuit configured to perform the above-mentioned second aspect and any one of the methods.
  • the present application provides a computer program that, when executed on a computer, causes the computer to execute the method described in any one of the above-mentioned first aspects.
  • the present application provides a computer program, which, when executed on a computer, causes the computer to execute the method described in any one of the above-mentioned second aspects.
  • the present application provides a chip system
  • the chip system includes a processor for supporting a server or a threshold value obtaining device to implement the functions involved in the above aspects, for example, sending or processing the functions involved in the above methods data and/or information.
  • the chip system further includes a memory for storing necessary program instructions and data of the server or the communication device.
  • the chip system may be composed of chips, or may include chips and other discrete devices.
  • FIG. 1 is a schematic structural diagram of a NUMA system according to an embodiment of the present application
  • Fig. 2 is a schematic diagram of the connection of two nodes in a NUMA architecture
  • FIG. 3 is a schematic diagram of a process processing flow
  • Figure 4a is a schematic diagram of a waiting queue structure
  • Figure 4b is a schematic diagram of a waiting queue structure
  • Figure 4c is a schematic diagram of a waiting queue structure
  • Fig. 5a is a kind of structure representation of waiting queue and completion queue
  • Figure 5b is a schematic diagram of the structure of a waiting queue and a completion queue
  • Figure 5c is a schematic structural representation of a waiting queue and a completion queue
  • 6a is a schematic diagram of a process processing flow
  • Figure 6b is a schematic diagram of a process processing flow
  • Figure 6c is a schematic diagram of a process processing flow
  • Figure 6d is a schematic diagram of a process processing flow
  • FIG. 7 is a schematic diagram of a process processing flow
  • FIG. 8 is a schematic diagram of a process processing flow
  • FIG. 9 is a schematic diagram of a process processing flow
  • FIG. 10 is a schematic diagram of a process processing flow
  • FIG. 11 is a schematic diagram of a process processing flow
  • FIG. 12 is a schematic diagram of a process processing flow
  • FIG. 13 is a schematic diagram of a process processing flow
  • 15 is a schematic structural diagram of a data synchronization device
  • 16 is a schematic structural diagram of a computer program product
  • FIG. 17 is a schematic diagram of the structure of a host.
  • the database system in the embodiment of the present application may include a host computer and a standby computer.
  • the application scenario of the present application is first introduced below.
  • the host computer and the standby computer in the embodiment of the present application may be a NUMA-based system, where in the architecture of the NUMA system 100 , which may be a multi-slot system 100.
  • FIG. 1 is a schematic diagram of a schematic architecture of a NUMA system 100 provided by an embodiment of the present application.
  • the NUMA system 100 includes a slot (socket ) 101a and slot 101b.
  • the socket 101a and the socket 101b may be collectively referred to herein as sockets, and may be used to install a central processing unit (CPU).
  • CPU central processing unit
  • the sockets may be communicatively coupled to each other through an interconnect 104 .
  • each slot may be connected to each of the other slots via a point-to-point quick path interconnect (QPI) link.
  • QPI is an interconnection architecture
  • the interconnection between the various slots in this embodiment of the present application may also be implemented through other interconnection architectures, such as other point-to-point architectures, ring architectures, and bus architectures, which are not limited here.
  • the number of slots depicted in NUMA system 100 is only one example, and those skilled in the art will understand that there may be different numbers of slots.
  • NUMA system 100 may include a number of slots such as six, four, or less, or NUMA system 100 may include a number of slots such as sixteen, thirty-two, or more.
  • a slot may include a plurality of nodes (nodes), each node has its own CPU and memory, and the nodes are connected and communicated through the interconnection 104.
  • the slot 101a includes the nodes 102a and 102a.
  • Node 102b, socket 101b includes node 103a and node 103b, each node includes one memory and six CPUs.
  • each socket may include other numbers of nodes, and each node may include other numbers of nodes CPU.
  • the software of the host machine involves transaction process, data synchronization process, waiting queue, etc.; the software of the standby machine mainly involves the data synchronization process.
  • the main process of data synchronization is as follows:
  • the host transaction process When the host transaction process is ready to submit a transaction, it first completes the local data submission, then sends a synchronization request to the host's data synchronization process, and adds itself to the waiting queue.
  • the host data synchronization process sends data to the standby machine in response to the request;
  • the data synchronization process of the standby machine receives and writes to the file system of the standby machine
  • the host data synchronization process traverses the waiting queue according to the synchronization progress, and wakes up the transaction processes that have completed synchronization one by one. At this point, the transaction process can complete the transaction commit operation.
  • the host data synchronization process has been performing the following steps in a loop:
  • the process wake-up operation is performed in the data synchronization process of the host.
  • the concurrency of the supported transaction processes is also sharply increased, so the number of processes in the waiting queue at the same time is also greatly increased, and the time for waiting for the queue to traverse and wake up operations is also significantly longer. This results in a longer processing cycle for the host data synchronization process.
  • the wake-up of the transaction process will also be inefficient. Even if the data synchronization of the standby machine has been completed, the transaction process at the end of the queue needs to wait for a long time before being woken up.
  • the access to the waiting queue involves a large amount of memory access across NUMA nodes, and the access cost will be further expanded compared to a single-node server.
  • FIG. 2 is a schematic flowchart of a data backup method provided by an embodiment of the present application.
  • An embodiment of the present application provides a data synchronization method, such as As shown in Figure 2, the data synchronization method provided by the present application specifically includes:
  • the data synchronization process sends first data to the standby machine, where the first data is generated by the first process.
  • the first process is configured to perform a first operation on the database, and the first data includes operation records corresponding to the first operation.
  • the first process is a transaction process
  • the first process is a transaction process.
  • a data can be, but is not limited to, a transaction log (database transaction log for dealing with crash recovery, XLOG) for processing failure recovery.
  • the standby machine can obtain the operations performed by the transaction process of the host machine, and perform the same operations, thereby realizing the data synchronization of the host machine on the backup machine.
  • the second process may be configured to perform a second operation on the database and generate a second log including operation records corresponding to the second operation
  • the second process and the first process may be hosts
  • the transaction process of For the operation corresponding to the operation instruction the transaction process may perform corresponding operations on the storage device in the database, wherein the operations may include adding data, deleting data, modifying data, querying data, etc., which are not limited in this application.
  • the transaction process After the transaction process completes the corresponding operation, it can generate data including the operation record corresponding to the operation, and through the data, the standby machine can perform the same operation on the storage device as the host machine.
  • the log may be, but is not limited to, a transaction log (database transaction log for dealing with crash recovery, XLOG) that handles failure recovery.
  • XLOG database transaction log for dealing with crash recovery
  • the standby machine can obtain the operations performed by the transaction process of the host machine, and perform the same operations, thereby realizing the backup of the host machine on the backup machine.
  • the first process and the second process may be transaction processes, wherein the second process is configured to perform a second operation on the database (storage device or memory in the database system, etc.), and generating second data including an operation record corresponding to the second operation, wherein the second process is configured to perform a second operation on a database, and the second data includes an operation record corresponding to the second operation.
  • the first process is configured to perform a first operation on the database and generate first data including an operation record corresponding to the first operation.
  • the second process and the first process may be different transaction processes on the host, and are respectively generated in response to different user operation instructions.
  • the data can be stored in the cache, and the data writing process can write the data from the cache to the corresponding file.
  • the data writing process may be a transaction process that competes for a lock, or a separate process dedicated to data writing, which is not limited here.
  • the data writing process may write the second data into the corresponding file; the first process is generated After the first data recorded in the operation corresponding to the first operation is included, the first data may be written into the corresponding file by the data writing process.
  • the data writing process may be the second process, the first process, or other transaction processes, or other processes specially used for data writing.
  • the transaction process After the transaction process generates data, it can be added to a specific waiting queue; among them, the transaction process can be sorted in the waiting queue based on the data queue number LSN (LOG sequence number) where the data is located, and added to the corresponding queue elements in turn.
  • LSN Log sequence number
  • the codes are T1 to T4 respectively, and the data positions LSN of the data T1 to T4 are sequentially identified as 10 to 40, as shown in FIG. 3 .
  • the transaction processes T1 to T4 When the transaction processes T1 to T4 are added to the waiting queue, they can be sorted according to LSN and added to the waiting queue in turn.
  • the identifiers of the second process and the first process may be added to the waiting queue; specifically, after the second process generates the second data, the second process may The identifier corresponding to the second process is added to the waiting queue; after the first process generates the first data, the identifier corresponding to the first process may be added to the waiting queue.
  • the identifier of the first process may uniquely indicate the first process
  • the identifier of the second process may uniquely indicate the second process
  • the identifier may be a process pointer or other character string, which is not limited in this application.
  • the identifier of the second process is located in the third element in the waiting queue
  • the identifier of the first process is located in the fourth element in the waiting queue
  • the fourth element is after the third element .
  • the waiting queue can include multiple elements in series, the next pointer of the head element points to the adjacent element, and so on, the next pointer of each element points to the adjacent element in the queue, until the tail element, in a kind of In the implementation, the next pointer of the tail element can point to empty NULL.
  • the waiting queue is a bidirectional loopback queue, it is used to support other operations more conveniently, such as when a transaction process needs to be temporarily cancelled, so the tail element can also point to other Queue element.
  • the fourth element is after the third element, that is, there is a next pointer path in the waiting queue, and the third element can point to the fourth element.
  • the waiting queue may include multiple elements, wherein each element may include an identifier of a process, and the identifier of the second process is located in the waiting queue except for the head element. element, the fourth element is adjacent to the third element, that is, the next pointer of the third element points to the fourth element.
  • the identifier of the second process is located in the element (the third element) other than the head element of the waiting queue, and the identifier of the first process is located in the element (fourth element) adjacent to the third element, wherein the first The identity of a process can also be located in the tail element of the waiting queue.
  • the waiting queue may include multiple elements, wherein each element may include an identifier of a process, and the identifier of the second process is located in the head element of the waiting queue, and the first The identity of a process is located in elements other than the head element in the waiting queue.
  • head element here refers to the head head in the queue.
  • the identifier of the second process is located at the head element of the waiting queue, and the identifier of the first process is located at an element other than the head element in the waiting queue, wherein the element where the identifier of the second process is located and Other elements may exist between the elements where the identifier of the first process is located, and the identifier of the first process may also be located at the tail element of the waiting queue.
  • the waiting queue may include multiple elements, wherein each element may include an identifier of a process, and the identifier of the second process is located in the waiting queue except for the head elements other than the element, the identifier of the first process is located in the elements other than the head element in the waiting queue, and the fourth element is not adjacent to the third element, that is, the fourth element There are also elements including other processes between the third element and the third element.
  • the transaction process after the transaction process generates data, in addition to entering the waiting queue, it can also send a data synchronization request to the data synchronization process of the host to instruct the data synchronization process to trigger the standby machine to perform data synchronization.
  • data synchronization After receiving the synchronization request, if the process is in an idle state, it can send the data that needs to be synchronized currently to the standby machine, and the data synchronization process of the standby machine can receive the data and write it to the corresponding file system of the standby machine. And after completing the data writing (ie, completing the data synchronization), the data synchronization process of the standby machine can feed back the synchronization progress to the host to indicate which data synchronization has been completed.
  • the data synchronization process may be the above-mentioned data synchronization process.
  • the data (the first data and the second data) that needs to be synchronized currently can be stored.
  • the data synchronization process of the backup machine can receive the first data and the second data and write them into the corresponding file system of the backup machine.
  • the data synchronization process of the standby machine can feed back the synchronization progress to the data synchronization process of the host to indicate that the first data synchronization process is completed. Synchronization of a data and a second data.
  • the data synchronization process wakes up the second process based on the standby machine completing the synchronization of the first data.
  • the data synchronization process can wake up the second process. Specifically, the data synchronization process may traverse the waiting queue, separate the completed transaction process from the waiting queue according to the completion progress, and generate a completion queue. This completion queue can be generated temporarily, and after all transaction processes in this completion queue are awakened, this completion queue can no longer exist. It should be noted that if the data synchronization process is fast enough, the same waiting queue may be separated from multiple completion queues and coexist.
  • the data synchronization process triggers the standby machine to synchronize the second data and the first data; and based on the standby machine to complete the synchronization of the second data and the first data, A completion queue is generated at least according to the second process, wherein the identifier of the second process is located in the first element of the completion queue, and the data synchronization process can wake up the process corresponding to the identifier included in the first element .
  • the completion queue is generated based on at least the second process and the first process, and the identifier of the first process is located in the second element of the completion queue, and is in the completion queue , the second element is located after the first element.
  • the completion queue may be generated by the data synchronization process based on the waiting queue.
  • the completion queue is all or a part of the waiting queue. Among them, if only the logs corresponding to a part of the processes in the waiting queue have been backed up on the standby machine, the next pointer of the element where the process at the end of the waiting queue is located in the above part of the processes can be changed from the original to the adjacent one. process, becomes a pointer to empty NULL. At this time, among the above-mentioned part of the processes, the element where the process at the end of the waiting queue is located becomes the tail element.
  • the relative positions of the third element and the fourth element in the waiting queue are the same as the relative positions of the first element and the second element in the completion queue. That is, the interval and the sequence between the element where the second process is located and the element where the first process is located remain unchanged.
  • the identifier of the second process is located in the element (the third element) other than the head element of the waiting queue, and the identifier of the first process is located in the element (fourth element) adjacent to the third element, wherein the first A process can also be located in the tail element of the waiting queue, that is, the next pointer of the element where the first process is located points to NULL.
  • the completion queue is part of the waiting queue.
  • the third element is adjacent to the fourth element, and the fourth element is located after the third element.
  • the completion queue the third element and the fourth element are adjacent to each other. The elements are adjacent, and the fourth element follows the third element.
  • the identification of the second process is located in the head element of the waiting queue
  • the identification of the first process is located in elements other than the head element in the waiting queue, wherein the element where the second process is located and the element where the first process is located There can be other elements in between, and the first process can also be located at the tail element of the waiting queue, that is, the next pointer of the element where the first process is located points to NULL.
  • the completion queue is a part of the waiting queue.
  • the third element is the head element, there is an interval of N elements between the third element and the fourth element, and the fourth element is located after the third element.
  • the completion queue the third element is the head element, there is an interval of N elements between the third element and the fourth element, and the fourth element is located after the third element.
  • the identifier of the second process is located in an element other than the head element in the waiting queue
  • the identifier of the first process is located in an element other than the head element in the waiting queue
  • all The fourth element is not adjacent to the third element, that is, there are elements including other processes between the fourth element and the third element.
  • the completion queue is a part of the waiting queue. In the waiting queue, there is an interval of N elements between the third element and the fourth element, and the fourth element is located after the third element.
  • the N elements are spaced between the third element and the fourth element, and the fourth element is located after the third element.
  • the data synchronization process can wake up the second process in the completion queue, that is, the data synchronization process can wake up the process corresponding to the identifier included in the first element in the completion queue, where the first element includes the first element in the completion queue.
  • the ID of the second process is not limited to the first process in the completion queue.
  • the identifier of the second process is located in the head element of the completion queue, and the data synchronization process can wake up the process corresponding to the identifier included in the head element of the completion queue.
  • the data synchronization process can wake up the process included in the head element, and the identifiers included in successive adjacent elements The corresponding process until the second process is awakened.
  • the second process wakes up the first process.
  • the first process may be awakened.
  • the second process wakes up processes included in one or more elements located after the first element in the completion queue.
  • the second process may replace the data synchronization process to wake up other processes in the completion queue.
  • the second process needs to detect whether the subsequent elements of the completion queue contain other transaction processes, and if so, it needs to be responsible for waking up the remaining transaction processes in the completion queue.
  • the identifier of the second process is located in the head element of the completion queue.
  • the second process can wake up the Nth process (the The N process may or may not exist.
  • the element where the second process is located is adjacent to the element where the first process is located, and the number of the Nth process is not limited, that is, between the second process and the first process There can be one or more elements)
  • the first process can be woken up, and the processes after the first process can be woken up (if the first process's identity is located in the tail element of the completion queue, it is not required ).
  • the identifier of the second process is located in an element other than the head element in the completion queue.
  • the data synchronization process needs to first wake up the Nth process (the number of the Nth process and the Not limited, that is, there may be one or more elements before the second process), after that, the data synchronization process can wake up the second process, and then the second process can wake up the first process, and wake up the processes after the first process (if the first process Not required if the identity of a process is at the tail element of the completion queue).
  • the second element is adjacent to the first element; then the second process wakeup is adjacent to the first element in the completion queue and is located in the first element Elements after the element include the process corresponding to the identifier.
  • the identifier of the second process is located in the head element of the completion queue. Specifically, referring to FIG. 6c, after the data synchronization process wakes up the second process, the second process can wake up adjacent elements including The first process, after that, the first process can wake up the Nth process adjacent to it, and so on, until the transaction process included in the tail element is woken up.
  • the identifier of the second process is located in an element other than the head element in the completion queue.
  • the data synchronization process needs to first wake up the Nth process (the number of the Nth process and the Not limited, that is, there may be one or more elements before the second process), after that, the Nth process can wake up the second process, and then the second process can wake up the first process, and so on, until the transaction included in the tail element is woken up process.
  • the wake-up of subsequent processes of the second process is not performed by the data synchronization process (may be performed by the first The second process or the subsequent process of the second process), so that the data synchronization process (data synchronization process) only needs to wake up a part of the process that has completed the data synchronization, so that the data synchronization process can focus more on triggering the backup machine to synchronize and receive data.
  • the synchronization progress of the backup machine can relieve the pressure of the data synchronization process and reduce the time for the data synchronization process to wake up the transaction process.
  • the data synchronization process (data synchronization process) only needs to wake up one process (the second process), thereby further reducing the pressure on the data synchronization process and reducing the time for the data synchronization process to wake up the transaction process.
  • the backup machine may be triggered to perform data synchronization, and other transaction processes may be completed by the second process.
  • FIG. 8 in the existing implementation, after the data synchronization process wakes up the second process, it needs to wake up the remaining transaction processes, and the backup machine can be triggered to perform data synchronization until the wake-up of the remaining transaction processes is completed. At this time, the waiting queue There may be many transaction processes waiting to wake up in the data synchronization process, which makes the process wake-up efficiency of the data synchronization process poor.
  • the data synchronization process does not need to wake up all the processes that have completed the data synchronization, but only needs to wake up a part of the processes that have completed the data synchronization, so that the data synchronization process can focus more on triggering the backup machine to perform data synchronization and receiving the backup machine. This reduces the pressure on the data synchronization process and reduces the time it takes for the data synchronization process to wake up the transaction process.
  • the second process may not be a transaction process, but a process solely used to wake up the transaction process.
  • the first process is a process corresponding to an identifier included in any element in the waiting queue (waiting queue).
  • the completion queue is generated at least according to the first process, and the identifier of the first process is located in the first element of the completion queue; the second process wakes up the first element The process corresponding to the ID included in .
  • a completion queue may be generated at least according to the first process, where the identifier of the first process is located in the first element of the completion queue.
  • the host includes a waiting queue, and the method further includes: before the standby machine completes the backup, adding the first process to the waiting queue, wherein the completion queue is generated according to the waiting queue of.
  • the completion queue may be all or a part of the waiting queue.
  • the second process can wake up the transaction process included in all elements in the completion queue; or, when the identifier of the first process is located at the head element of the completion queue, the second process can wake up the first process. , the first process wakes up the transaction process included in the remaining elements in the completion queue.
  • the second process can wake up the process corresponding to the identifier included in the element before the element where the first process is located, until the first process is woken up, and the first process wakes up the remaining elements in the completion queue. business process.
  • the second process can wake up the first process, and the first process wakes up the process corresponding to the identifier included in the adjacent and subsequent elements, Afterwards, the process corresponding to the identifier included in the adjacent and subsequent elements awakened above completes the transaction process included in the remaining elements in the queue; or, when the identifier of the first process is located at the head element of the completion queue, the second process The first process can be woken up, and the first process wakes up the process corresponding to the identification included in the adjacent and subsequent elements, and then wakes up the adjacent elements by the process corresponding to the identification included in the adjacent and subsequent elements. The process corresponding to the included identifier, and so on, until the transaction process included by the element in the completion queue is awakened.
  • the data synchronization process does not need to wake up the process that has completed the data synchronization, but only needs to wake up a process specially used to wake up the completed data synchronization, so that the data synchronization process can be more focused on triggering the backup machine to perform data synchronization and Receive the synchronization progress of the backup machine, thereby relieving the pressure of the data synchronization process and reducing the time for the data synchronization process to wake up the transaction process.
  • the host includes multiple NUMA nodes, and the second process and the first process belong to processes included in the same NUMA node.
  • the data related to the second process and the first process occupies memory resources under the same NUMA node.
  • the host includes multiple NUMA nodes, and at least one of the second process and the first process and the completion queue belong to the same NUMA node.
  • the data related to at least one of the second process and the first process, and the completion queue occupy memory resources under the same NUMA node.
  • the host includes multiple NUMA nodes, and at least one of the second process and the first process and the waiting queue belong to the same NUMA node.
  • the data related to at least one of the second process and the first process, and the waiting queue occupy the memory resources under the same NUMA node.
  • the completion queue and the waiting queue belong to the same NUMA node.
  • the data related to the second process and the first process occupies memory resources under the same NUMA node.
  • the data related to the completion queue and the waiting queue occupy the memory resources under the same NUMA node.
  • a corresponding waiting queue may be allocated to each NUMA node, and transaction processes (the second process and the first process) may be allocated to the waiting queue of the node.
  • transaction processes the second process and the first process
  • the completion queue detached from the waiting queue also needs to be located at this node. Based on this, when the completion queue traverses and wakes up the transaction process, the process and the accessed data are located in the same NUMA node, which avoids expensive remote memory access and further improves the efficiency of the parallel wake-up mechanism.
  • two waiting queues should be prepared for the data synchronization process, which belong to node 1 and node 2.
  • the transaction process starts, it can be bound to different NUMA nodes according to the equalization strategy. It is assumed here that the odd-numbered process is bound to node 1, and the even-numbered process is bound to node 2.
  • the transaction process When the transaction process is ready to commit and has completed writing to the local log file, it sends a request to the data synchronization process and adds it to the corresponding waiting queue. For example, the process numbered 1/3/5/7/9 is added to the waiting queue under node 1; the process numbered 2/4/6/8/10 is added to the waiting queue under node 2;
  • the data synchronization process of the host sends logs to the standby server, and receives log processing progress messages from the standby server.
  • the host data synchronization process finds that the synchronization progress of the standby machine has been refreshed, it is ready to wake up the relevant transaction process.
  • waking up traverse each waiting queue, and disconnect the queue according to the position information of the synchronization completion, that is, separate the completed transaction queue; this step needs to hold a lock to protect the waiting queue.
  • transaction processes numbered 1/3/5 and transaction processes numbered 2/4/6 are separated into different completion queues (completion queues), respectively.
  • the data synchronization process can wake up the first transaction process of each completion queue and is no longer responsible for waking up other processes.
  • Only processes numbered 1 and 2 are awakened. Then the data synchronization process immediately enters the next round of work, and no longer processes the remaining processes.
  • Each process that completes the head element of the queue (the processes numbered 1 and 2) is responsible for completing the process wake-up task of this queue. Among them, the process wake-up operations numbered 1 and 2 are executed concurrently.
  • FIG. 14 is a schematic flowchart of a data writing method provided by an embodiment of the present application. As shown in FIG. 14, the data writing method provided by an embodiment of the present application includes:
  • the data writing process wakes up the second process based on the completion of the writing operation on the first data, where the first data is generated by the first process.
  • the second process wakes up the first process.
  • the first process is configured to perform a first operation on the database, and the first data includes an operation record corresponding to the first operation.
  • this embodiment is applied in a data writing scenario, where the data may be of the same type as the first data and the second data in the embodiment corresponding to FIG. 2 .
  • Data the data of the database system is written to the local file is a very important processing step, in which, in order to avoid the extra consumption caused by competition, a special data service process is used to write data for other transaction processes (that is, the data writing process).
  • the first process needs to be woken up. It takes a long time to wake up the transaction process, and the data writing process can only write the data corresponding to the remaining transaction processes after the wake-up of the transaction process is completed, which is inefficient.
  • the second process can be woken up, and then the second process can complete the wake-up of the process or complete the wake-up of the process in conjunction with other processes in the completion queue.
  • the second process can complete the wake-up of the process or complete the wake-up of the process in conjunction with other processes in the completion queue.
  • the time spent by the local data writing process on the wake-up of the transaction process can be reduced, so that the efficiency of the file writing operation can be improved.
  • the first process is configured to perform a first operation on the database, and the first data includes an operation record corresponding to the first operation.
  • the data writing process wakes up the second process based on completing the write operation to the first data, including:
  • the data writing process wakes up the second process based on the completion of the writing operation on the first data and the second data; wherein, the second data is generated by the second process.
  • the second process is configured to perform a second operation on the database, and the second data includes an operation record corresponding to the second operation.
  • the host includes a completion queue, and the identifier of the second process is located in the first element of the completion queue; the waking up the second process includes:
  • the method further includes:
  • the data writing process Before waking up the second process, after the data writing process completes the writing operation of the first data, the data writing process generates a completion queue at least according to the identifier of the second process, wherein the The identification of the two processes is located in the first element of the completion queue.
  • the first element is the head element of the completion queue.
  • the identifier of the first process is located in a second element of the completion queue, and in the completion queue, the second element is located after the first element;
  • waking up the first process by the second process includes:
  • the second process wakes up the process corresponding to the identifier included in the second element.
  • the second process wakes up a process included in the second element, including:
  • the second process wakes up processes corresponding to identifiers included in a plurality of elements located after the first element in the completion queue.
  • the second element is adjacent to the first element; correspondingly, the second process wakes up a process included in the second element, including:
  • the second process wakes up processes included in elements adjacent to and subsequent to the first element in the completion queue.
  • the host includes a waiting queue, and before the data writing process completes the writing operation to the first data, the identifier of the second process is located in a third element in the waiting queue , the identifier of the first process is located in the fourth element in the waiting queue, and the fourth element is after the third element; wherein, the completion queue is generated according to the waiting queue.
  • the completion queue is all or a part of the waiting queue.
  • the relative positions of the third element and the fourth element in the waiting queue, and the relative positions of the first element and the second element in the completion queue Same location.
  • the identifier of the second process is located in a head element of the waiting queue, and the identifier of the first process is located in an element other than the head element in the waiting queue.
  • the host includes a completion queue, the identifier of the first process is located in a first element of the completion queue, and the second process is located outside the completion queue; the second process is located outside the completion queue;
  • the process wakes up the first process, including:
  • the second process wakes up the process corresponding to the identifier included in the first element.
  • the method further includes:
  • a completion queue is generated at least according to the identifier of the first process, wherein the first process's The identifier is in the first element of the completion queue.
  • the host includes a waiting queue, and before the data writing process completes the writing operation to the first data, the identifier of the first process is located in the fourth element in the waiting queue ; wherein, the completion queue is generated according to the waiting queue.
  • the completion queue is all or a part of the waiting queue.
  • the first process and the second process run on a host, the host includes multiple NUMA nodes, and the second process and the first process belong to the same NUMA node Included process.
  • the first process and the second process run on a host, the host includes multiple NUMA nodes, and at least one of the second process and the first process , which belongs to the same NUMA node as the completion queue.
  • the first process and the second process run on a host
  • the host includes multiple NUMA nodes, and at least one of the second process and the first process , and the waiting queue belongs to the same NUMA node; and/or, the completion queue and the waiting queue belong to the same NUMA node.
  • the present application also provides a data synchronization apparatus 1500, the apparatus 1500 includes: a processing circuit 1501 and a communication interface 1502; wherein,
  • the processing circuit 1501 is configured to execute the actions related to data processing in the embodiments corresponding to FIG. 2 and FIG. 14 ; the above-mentioned communication interface 1502 is configured to execute the sending actions or receiving actions related to the interaction between the standby machines in the above-mentioned embodiments. action.
  • the present application also provides a computer-readable storage medium.
  • the methods disclosed in FIGS. 2 to 14 may be implemented as being encoded on the computer-readable storage medium in a machine-readable format. or encoded on other non-transitory media or article of manufacture computer program instructions.
  • 16 schematically illustrates a conceptual partial view of an example computer program product including a computer program for executing a computer process on a computing device, arranged in accordance with at least some embodiments presented herein.
  • example computer program product 1600 is provided using signal bearing medium 1601 .
  • Signal bearing medium 1601 may include one or more program instructions 1602 that, when executed by one or more processors, may provide the functions, or portions thereof, described above with respect to FIGS. 2-14 .
  • one or more features of blocks 201-203 may be undertaken by one or more instructions associated with the signal bearing medium 1601, with reference to the embodiment shown in FIG. 14.
  • one or more features of blocks 1401 - 1402 may be undertaken by one or more instructions associated with signal bearing medium 1601 .
  • program instructions 1602 in Figure 16 also describe example instructions.
  • the signal bearing medium 1601 may include a computer-readable medium 1603, such as, but not limited to, a hard drive, a compact disc (CD), a digital video disc (DVD), a digital tape, a memory, a read only memory (Read) -Only Memory, ROM) or random access memory (Random Access Memory, RAM) and so on.
  • the signal bearing medium 1601 may include a computer recordable medium 1604, such as, but not limited to, memory, read/write (R/W) CDs, R/W DVDs, and the like.
  • the signal bearing medium 1601 may include a communication medium 1605, such as, but not limited to, digital and/or analog communication media (eg, fiber optic cables, waveguides, wired communication links, wireless communication links, etc.).
  • a communication medium 1605 such as, but not limited to, digital and/or analog communication media (eg, fiber optic cables, waveguides, wired communication links, wireless communication links, etc.).
  • the signal bearing medium 1601 may be conveyed by a wireless form of communication medium 1605 (eg, a wireless communication medium that conforms to the IEEE 802.11 standard or other transmission protocol).
  • the one or more program instructions 1602 may be, for example, computer-executable instructions or logic-implemented instructions.
  • a computing device of a computing device may be configured to respond to program instructions 1602 communicated to the computing device through one or more of computer readable media 1603 , computer recordable media 1604 , and/or communication media 1605 , which provides various operations, functions, or actions.
  • program instructions 1602 communicated to the computing device through one or more of computer readable media 1603 , computer recordable media 1604 , and/or communication media 1605 , which provides various operations, functions, or actions.
  • an embodiment of the present invention provides a host.
  • the host 1700 includes: a transmitter 1703 , a receiver 1704 , a memory 1702 , and a processor 1701 coupled to the memory 1702 .
  • the transmitter 1703, the receiver 1704, the memory 1702 and the processor 1701 may be connected by a bus or in other ways (in FIG. 17, the connection by a bus is taken as an example). in:
  • the processor 1701 may be one or more central processing units (Central Processing Units, CPUs). In FIG. 17, a processor is used as an example. If the processor 1701 is a CPU, the CPU may be a single-core CPU. It can also be a multi-core CPU.
  • CPUs Central Processing Units
  • Memory 1702 including but not limited to random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, EPROM), Or portable read-only memory (Compact Disc Read-Only Memory, CD-ROM), this memory 1702 is used for relevant instruction and data, also is used for storing program code, and described program code is specifically used for realizing the implementation in Fig. 2 to Fig. 14 the method described in the example;
  • the transmitter 1703 is used to send data to the outside (for example, the standby machine);
  • the receiver 1704 is used to receive data from the outside (eg, standby).
  • the host may be an independent device in the database system, for example, the host is an independent physical server.
  • the host can also be a non-independent device.
  • the host in an application scenario, the host can be built into the host, or exist as a functional module of the host (for example, the host and the host are different virtual machines, through the I /O interface connection, coexisting on the same physical server); in another application scenario, the host can be built into a standby machine, or exist as a functional module of a standby machine (for example, a standby machine and As different virtual machines, the hosts are connected through I/O interfaces and coexist on the same physical server).
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of units is only a logical function division.
  • there may be other division methods for example, multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium.
  • the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions to cause a computer device (which may be a personal computer, a server, or other network device, etc.) to execute all or part of the steps of the method described in the embodiment of FIG. 2 of the present application.
  • the aforementioned storage medium includes: U disk, removable hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请实施例提供了一种数据同步方法,可以应用于数据库相关领域,本申请提供的数据同步方法包括:主机通过数据同步进程将第一进程生成的第一数据发送给备机,所述备机同步所述第一数据;所述数据同步进程基于所述备机完成所述第一数据的同步,唤醒第二进程,进而由所述第二进程唤醒所述第一进程以执行后续操作。本申请中的数据同步进程不需要唤醒已完成数据同步的第一进程,只需要唤醒第二进程,并由第二进程唤醒已完成数据同步的第一进程,使得数据同步进程可以更专注于触发备份机进行数据的同步以及接收备份机的同步进度,从而缓解数据同步进程的压力,减少了数据同步进程唤醒事务进程的时间。

Description

一种数据同步方法及装置
本申请要求于2020年06月30日提交中国专利局、申请号为202010617593.1、发明名称为“一种数据同步方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机数据库领域,尤其涉及一种数据备份方法及装置。
背景技术
为了提高数据库系统的可用性,一般会提供备机来同步包括数据操作记录的数据,并基于包括数据操作记录的数据进行与主机相同的数据操作。当主机发生故障时,可以切换为由备机对外提供服务。
其中,主机(master)和备机(standby)的数据同步方法一般分为两种,一种是同步复制,主机事务提交时包括数据操作记录的数据除了在本机同步写入到文件之外,还得同步写入到备机的文件,然后才能认为事务可以提交。另一种是异步复制,事务完成包括数据操作记录的数据的本地文件写入后,不等备机同步完成就直接宣称事务提交完成。
相比较而言,同步复制由于需要同步等待备机同步,导致事务提交时延明显加大,因此性能上明显弱于异步复制。但是异步复制在主机发生故障时,有可能导致已提交的事务在备机上还没有完成同步,当发生故障切换时可能会丢失信息,存在问题。因此对于要求高可靠性和高可用性的场景,一般采用同步复制技术。
具体的,主机的数据同步进程可以触发备机进行数据的同步,且在备机进行数据的同步时,主机相关的事务进程处于睡眠状态,当备机完成同步后,主机的数据同步进程需要依次唤醒对应的事务进程,在完成事务进程的唤醒之后,数据同步进程可以继续触发备机进行数据的同步。
然而,在一些场景中,数据同步进程需要唤醒的事务进程较多,此时,数据同步进程需要花费大量的时间进行事务进程唤醒,进而使得由于等待同步机进行数据同步而进入睡眠状态的事务进程较多,增加了事务进程进行事务处理的时延。
发明内容
第一方面,本申请实施例提供了一种数据同步方法,所述方法包括:
数据同步进程将第一数据发送给备机,所述第一数据为第一进程生成的;其中,第一进程可以为运行在主机上的事务进程,主机在接收用户所发出的操作指令进行读写等操作的事务时,可以生成对应的事务进程,该事务进程包括与用户发出的操作指令对应的操作,事务进程可以对数据库中的存储设备进行相应的操作,其中,操作可以包括增加数据、删除数据、修改数据以及查询数据等等。第一数据可以但不限于是处理故障恢复的事务日志(database transaction log for dealing with crash recovery,XLOG)。基于该数据,备机可以获取到主机的事务进程进行的操作,进行执行相同的操作,从而在备份机上实现了主机的数据同步。所述数据同步进程基于所述备机完成所述第一数据的同步,唤醒第二进程;数据同步进程在接收到备机发送同步进度之后,可以唤醒第二进程,由第二进程唤醒所述第一 进程,既由第二进程唤醒事务进程。具体的,数据同步进程可以遍历等待队列,根据完成进度从等待队列中分离出已完成的事务进程(包括第一进程),并生成完成队列(包括第一进程)。此完成队列可以是临时生成的,在这个完成队列中的所有事务进程被唤醒后,此完成队列可以不再存在。数据同步进程可以唤醒第二进程,由第二进程可以唤醒完成队列中的第一进程,既由第二进程唤醒事务进程。需要说明的是,数据同步进程可以先生成包括第一进程的完成队列,然后唤醒第二进程;或者先唤醒第二进程,然后再生成包括第一进程的完成队列,这里并不限定完成队列生成和第二进程唤醒的先后顺序。上述的队列(完成队列和等待队列)只是一种实现方式,本申请实施例中还可以通过其他具有相同或相似的数据结构来代替队列。
本实施例中,第二进程可以不为事务进程,而是单独用于唤醒事务进程的进程,具体的,可以在数据库服务启动的时候启动第二进程,第二进程在没有事务进程需要唤醒时处于睡眠状态,第二进程在被数据同步进程唤醒后,可以唤醒事务进程,在完成事务进程的唤醒后,可以进入睡眠状态。
本申请实施例中,数据同步进程不需要唤醒数据同步已被完成的事务进程,只需要唤醒一个专门用于唤醒已完成数据同步的进程,使得数据同步进程可以更专注于触发备份机进行数据的同步以及接收备份机的同步进度,从而缓解数据同步进程的压力,减少了数据同步进程唤醒事务进程的时间。
在一种可选的实现中,所述方法还包括:所述数据同步进程将第一数据发送给备机之前,所述数据同步进程接收所述第一进程对应的数据同步请求。
在一种可选的实现中,所述第一进程被配置对数据库进行第一操作,所述第一数据包括所述第一操作对应的操作记录。
在一种可选的实现中,所述方法还包括:所述数据同步进程将第二数据发送给所述备机,所述第二数据为所述第二进程生成的;所述数据同步进程基于所述备机完成所述第一数据和所述第二数据的同步,唤醒所述第二进程。
在一种可选的实现中,所述第二进程被配置对数据库进行第二操作,所述第二数据包括所述第二操作对应的操作记录。
在一种可选的实现中,所述主机包括完成队列,所述第二进程的标识位于所述完成队列的第一元素中;所述唤醒所述第二进程,包括:
唤醒所述第一元素中包括的标识所对应的进程。
在一种可选的实现中,在唤醒所述第二进程之前,在所述备机完成所述第一数据的同步之后,至少根据所述第二进程的标识生成完成队列,其中,所述第二进程的标识位于所述完成队列的第一元素中。
在一种可选的实现中,所述第一元素为所述完成队列的头部元素。
在一种可选的实现中,所述第一进程的标识位于所述完成队列的第二元素中,且在所述完成队列中,所述第二元素位于所述第一元素之后;所述第二进程唤醒所述第二元素包 括的标识所对应的进程。
在一种可选的实现中,所述第二进程可以唤醒所述完成队列中位于所述第一元素之后的多个元素包括的标识所对应的进程。
本申请实施例中,第二进程可以代替数据同步进程来唤醒完成队列中的其它进程。具体的,第二进程需要检测完成队列的后续元素中是否含有其他事务进程,如果有,则需要负责唤醒完成队列中的剩余事务进程。
在一种可选的实现中,所述第二元素与所述第一元素相邻;所述第二进程可以唤醒在所述完成队列中与所述第一元素相邻且位于所述第一元素之后的元素包括的进程。
在一种可选的实现中,所述主机包括等待队列,在所述备机完成所述同步之前,所述第二进程的标识位于所述等待队列中的第三元素,所述第一进程的标识位于所述等待队列中的第四元素,所述第四元素在所述第三元素之后;其中,所述完成队列为根据所述等待队列生成的。
本实施例中,生成的完成队列保持了原有的等待队列中进程的先后顺序,保证了事务处理的先入先出。
在一种可选的实现中,所述完成队列为所述等待队列的全部或一部分。
在一种可选的实现中,所述第三元素和所述第四元素在所述等待队列中的相对位置,和所述第一元素和所述第二元素在所述完成队列中的相对位置相同。即,第二进程所在的元素和第一进程所在的元素之间的间隔和前后顺序不变。
在一种可选的实现中,所述第二进程的标识位于所述等待队列的头部元素,所述第一进程的标识位于所述等待队列中除头部元素之外的元素。
本实施例中,第二进程的标识位于完成队列中除头部元素之外的元素,则数据同步进程可以唤醒头部元素包括的进程,以及依次相邻的元素包括的标识所对应的进程,直到唤醒第二进程。
在一种可选的实现中,所述主机包括完成队列,所述第一进程的标识位于所述完成队列的第一元素中,所述第二进程位于所述完成队列外;所述第二进程唤醒所述第一进程,包括:所述第二进程唤醒所述第一元素中包括的标识所对应的进程。
本实施例中,第二进程可以不为事务进程,而是单独用于唤醒事务进程的进程。第一进程为等待队列(等待队列)中的任意一个元素包括的标识所对应的进程。本申请实施例中,所述完成队列为至少根据所述第一进程生成的,所述第一进程的标识位于所述完成队列的第一元素中;所述第二进程唤醒所述第一元素中包括的标识所对应的进程。
在一种可选的实现中,所述方法还包括:
在所述第二进程唤醒所述第一进程之前,在所述备机完成所述第一数据的同步之后,至少根据所述第一进程的标识生成完成队列,其中,所述第一进程的标识位于所述完成队列的第一元素中。
在一种可选的实现中,所述主机包括等待队列,在所述备机完成所述同步之前,所述第一进程的标识位于所述等待队列中的第四元素;其中,所述完成队列为根据所述等待队列生成的。
在一种可选的实现中,所述完成队列为所述等待队列的全部或一部分。
在一种可选的实现中,所述第一进程以及所述第二进程运行在主机上,所述主机包括多个NUMA节点,所述第二进程和所述第一进程属于同一个NUMA节点包括的进程。
在一种可选的实现中,所述第一进程以及所述第二进程运行在主机上,所述主机包括多个NUMA节点,所述第二进程和所述第一进程中的至少一个进程,与所述完成队列属于同一个NUMA节点。
在一种可选的实现中,所述第一进程以及所述第二进程运行在主机上,所述主机包括多个NUMA节点,所述第二进程和所述第一进程中的至少一个进程,与所述等待队列属于同一个NUMA节点;和/或,所述完成队列和所述等待队列属于同一个NUMA节点。
可选的,本申请实施例中,所述完成队列和所述等待队列属于同一个NUMA节点。其中,与第二进程和第一进程相关的数据,占用同样的NUMA节点下的内存资源。其中,完成队列以及等待队列相关的数据,占用同样的NUMA节点下的内存资源。
本申请实施例中,在数据库系统初始化时,可以为每个NUMA节点分配对应的等待队列,以及将事务进程(第二进程和第一进程)分配到该节点的等待队列中,同理,从等待队列中分离出来的完成队列(完成队列)也需要位于该节点。基于此,完成队列在遍历和唤醒事务进程时进程和访问的数据位于相同的NUMA节点,避免了代价较高的远端访存,进一步提升了并行唤醒机制的效率。
第二方面,本申请提供了一种数据写入方法,所述方法包括:数据写入进程基于完成对第一数据的写操作,唤醒第二进程,其中,所述第一数据为第一进程生成的;以及,所述第二进程唤醒所述第一进程。
本申请实施例中,数据写入进程在完成对所述第一数据的写操作之后,可以唤醒第二进程,之后由第二进程完成或者结合完成队列中的其余进程完成进程的唤醒。进而可以减少本地数据写入进程花费在事务进程唤醒上的时间,从而可以提高写文件操作的效率。
在一种可选的实现中,所述第一进程被配置对数据库进行第一操作,所述第一数据包 括所述第一操作对应的操作记录。
在一种可选的实现中,所述数据写入进程基于完成对第一数据的写操作,唤醒第二进程,包括:
所述数据写入进程基于完成对第一数据和第二数据的写操作,唤醒第二进程;其中,所述第二数据为所述第二进程生成的。
在一种可选的实现中,所述第二进程被配置对数据库进行第二操作,所述第二数据包括所述第二操作对应的操作记录。
在一种可选的实现中,所述主机包括完成队列,所述第二进程的标识位于所述完成队列的第一元素中;所述唤醒所述第二进程,包括:
唤醒所述第一元素中包括的标识所对应的进程。
在一种可选的实现中,所述方法还包括:
在唤醒所述第二进程之前,在所述数据写入进程完成对第一数据的写操作之后,所述数据写入进程至少根据所述第二进程的标识生成完成队列,其中,所述第二进程的标识位于所述完成队列的第一元素中。
在一种可选的实现中,所述第一元素为所述完成队列的头部元素。
在一种可选的实现中,所述第一进程的标识位于所述完成队列的第二元素中,且在所述完成队列中,所述第二元素位于所述第一元素之后;
相应的,所述第二进程唤醒所述第一进程,包括:
所述第二进程唤醒所述第二元素包括的标识所对应的进程。
在一种可选的实现中,所述第二进程唤醒所述第二元素包括的进程,包括:
所述第二进程唤醒所述完成队列中位于所述第一元素之后的多个元素包括的标识所对应的进程。
在一种可选的实现中,所述第二元素与所述第一元素相邻;相应的,所述第二进程唤醒所述第二元素包括的进程,包括:
所述第二进程唤醒在所述完成队列中与所述第一元素相邻且位于所述第一元素之后的元素包括的进程。
在一种可选的实现中,所述主机包括等待队列,在所述数据写入进程完成对第一数据的写操作之前,所述第二进程的标识位于所述等待队列中的第三元素,所述第一进程的标 识位于所述等待队列中的第四元素,所述第四元素在所述第三元素之后;其中,所述完成队列为根据所述等待队列生成的。
在一种可选的实现中,所述完成队列为所述等待队列的全部或一部分。
在一种可选的实现中,所述第三元素和所述第四元素在所述等待队列中的相对位置,和所述第一元素和所述第二元素在所述完成队列中的相对位置相同。
在一种可选的实现中,所述第二进程的标识位于所述等待队列的头部元素,所述第一进程的标识位于所述等待队列中除头部元素之外的元素。
在一种可选的实现中,所述主机包括完成队列,所述第一进程的标识位于所述完成队列的第一元素中,所述第二进程位于所述完成队列外;所述第二进程唤醒所述第一进程,包括:
所述第二进程唤醒所述第一元素中包括的标识所对应的进程。
在一种可选的实现中,所述方法还包括:
在所述第二进程唤醒所述第一进程之前,在所述备机完成所述第一数据的同步之后,至少根据所述第一进程的标识生成完成队列,其中,所述第一进程的标识位于所述完成队列的第一元素中。
在一种可选的实现中,所述主机包括等待队列,在所述数据写入进程完成对第一数据的写操作之前,所述第一进程的标识位于所述等待队列中的第四元素;其中,所述完成队列为根据所述等待队列生成的。
在一种可选的实现中,所述完成队列为所述等待队列的全部或一部分。
在一种可选的实现中,所述第一进程以及所述第二进程运行在主机上,所述主机包括多个NUMA节点,所述第二进程和所述第一进程属于同一个NUMA节点包括的进程。
在一种可选的实现中,所述第一进程以及所述第二进程运行在主机上,所述主机包括多个NUMA节点,所述第二进程和所述第一进程中的至少一个进程,与所述完成队列属于同一个NUMA节点。
在一种可选的实现中,所述第一进程以及所述第二进程运行在主机上,所述主机包括多个NUMA节点,所述第二进程和所述第一进程中的至少一个进程,与所述等待队列属于同一个NUMA节点;和/或,所述完成队列和所述等待队列属于同一个NUMA节点。
第三方面,本申请提供了一种数据同步装置,可以包括处理器,处理器和存储器耦合,存储器存储有程序指令,当存储器存储的程序指令被处理器执行时实现上述第一方面以及任一所述的方法。对于处理器执行第一方面的各个可能实现方式中执行的步骤,具体均可以参阅第一方面,此处不再赘述。
第四方面,本申请提供了一种数据写入装置,可以包括处理器,处理器和存储器耦合,存储器存储有程序指令,当存储器存储的程序指令被处理器执行时实现上述第二方面任一所述的方法。对于处理器执行第二方面以及其各个可能实现方式中执行的步骤,具体均可以参阅第二方面,此处不再赘述。
第五方面,本申请提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面任一所述的方法。
第六方面,本申请提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行上述第二方面任一所述的方法。
第七方面,本申请提供了一种电路系统,所述电路系统包括处理电路,所述处理电路配置为执行上述第一方面以及任一所述的方法。
第八方面,本申请提供了一种电路系统,所述电路系统包括处理电路,所述处理电路配置为执行上述第二方面以及任一所述的方法。
第九方面,本申请提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面任一所述的方法。
第十方面,本申请提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第二方面任一所述的方法。
第十一方面,本申请提供了一种芯片系统,该芯片系统包括处理器,用于支持服务器或门限值获取装置实现上述方面中所涉及的功能,例如,发送或处理上述方法中所涉及的数据和/或信息。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器,用于保存服务器或通信设备必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。
附图说明
图1为本申请实施例提供的一种NUMA系统的示意性架构示意图;
图2为一种NUMA架构中两个节点的连接示意图;
图3为一种进程处理流程示意;
图4a为一种等待队列结构示意;
图4b为一种等待队列结构示意;
图4c为一种等待队列结构示意;
图5a为一种等待队列和完成队列的结构示意;
图5b为一种等待队列和完成队列的结构示意;
图5c为一种等待队列和完成队列的结构示意;
图6a为一种进程处理流程示意;
图6b为一种进程处理流程示意;
图6c为一种进程处理流程示意;
图6d为一种进程处理流程示意;
图7为一种进程处理流程示意;
图8为一种进程处理流程示意;
图9为一种进程处理流程示意;
图10为一种进程处理流程示意;
图11为一种进程处理流程示意;
图12为一种进程处理流程示意;
图13为一种进程处理流程示意;
图14为一种进程处理流程示意;
图15为一种数据同步装置的结构示意;
图16为一种计算机程序产品的结构示意;
图17为一种主机的结构示意。
具体实施方式
下面结合附图,对本申请的实施例进行描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。本领域普通技术人员可知,随着技术的发展和新场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或模块的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或模块,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或模块。在本申请中出现的对步骤进行的命名或者编号,并不意味着必须按照命名或者编号所指示的时间或逻辑先后顺序执行方法流程中的步骤,已经命名或者编号的流程步骤可以根据要实现的技术目的变更执行次序,只要能达到相同或者相类似的技术效果即可。
本申请实施例中的数据库系统可以包括主机以及备机,下面首先介绍一下本申请的应用场景,本申请实施例中的主机和备机可以为基于NUMA的系统,其中在NUMA系统100的架构中,可以为多插槽系统100,参照图1,图1为本申请实施例提供的一种NUMA系统100的示意性架构示意图,如图1中示出的那样,NUMA系统100包括插槽(socket)101a和插槽101b。插槽101a和插槽101b在本文中可被统称为插槽,可以用于安装中央处理器(central processing unit,CPU)。插槽可以通过互联(interconnect)104彼此通信地耦合。示例性的,每个插槽可经由点对点快速路径互连(quick path interconnect,QPI)链路来连接至其他插槽中的每一个。需要说明的是,QPI是一种互连架构,本申请实施例中各个插槽之间的互联还可以通过其他互连架构实现,诸如其他点对点架构、环架构以及总线架构,这 里并不限定。NUMA系统100中所描绘插槽的数量仅为一种示例,并且本领域技术人员将理解,可存在不同数量的插槽。例如,NUMA系统100可包括诸如,六个、四个或更少数量的插槽,又或者NUMA系统100可以包括诸如,十六个、三十二个或更多数量的插槽。
插槽可以包括多个节点(node),每个节点有自己的CPU和内存,节点和节点之间通过互联104进行连接和通信,如图1中示出的那样,插槽101a包括节点102a和节点102b,插槽101b包括节点103a和节点103b,每个节点包括一个内存和六个CPU。需要说明的是,NUMA系统100中所描绘的节点和CPU的数量仅为一种示例,并且本领域技术人员将理解,每个插槽可以包括其他数量的节点,每个节点可以包括其他数量的CPU。
本申请实施例中,主机的软件涉及到事务进程、数据同步进程、等待队列等;备机软件主要涉及到数据同步进程。在一种现有的实现中,数据同步的主要流程如下:
1、主机事务进程在准备提交事务时,先完成本机数据提交,然后向主机的数据同步进程发送同步请求,并将自己加入到等待队列。
2、主机数据同步进程响应请求发送数据给备机;
3、备机的数据同步进程接收并写入备机文件系统;
4、备机数据同步进程向主机反馈同步进度;
5、主机数据同步进程根据同步进度遍历等待队列,逐个唤醒已经完成同步的事务进程。至此,事务进程就可以完成事务提交操作了。
其中,主机数据同步进程一直在循环执行如下步骤:
1、被事务进程唤醒,读取未同步的数据,通过网络发送给备机;
2、等待备机发送的进度指示;
3、根据当前进度,遍历等待队列,从队列中唤醒已经完成的事务进程。
然而随着中央处理器(central processing unit,CPU)核数和非统一内存访问(non-uniform memory access,NUMA)节点数目的不断增多,单机能力越来越强,逐步暴露出一些不足之处:事务进程的唤醒时间较长,影响了主机数据同步进程的效率。
这些不足的产生原因包括:
1、进程唤醒操作是放在主机的数据同步进程中执行的。随着单机多核能力的提升,支持的事务进程并发度也是急剧提升,所以同一时间内等待队列中的进程数也是大幅增加,用于等待队列遍历并唤醒操作的时间也明显变长。这就导致主机数据同步进程处理的周期变长。
2、受上述第一点的影响,事务进程的唤醒也会比较低效。即使备机数据同步已经完成,但是在队列尾部的事务进程需要等待较长的时间才能被唤醒。
3、对于多NUMA节点的服务器,此等待队列的访问涉及到跨NUMA节点的大量内存访问,相比单节点服务器来说,访问代价将会进一步扩大。
为了解决上述问题,本申请提供了一种数据备份方法,参照图2,图2为本申请实施例提供的一种数据备份方法的流程示意图,本申请实施例提供了一种数据同步方法,如图 2示出的那样,本申请提供的数据同步方法,具体包括:
201、数据同步进程将第一数据发送给备机,所述第一数据为第一进程生成的。
本申请实施例中,所述第一进程被配置对数据库进行第一操作,所述第一数据包括所述第一操作对应的操作记录,在一种实现中,第一进程为事务进程,第一数据可以但不限于是处理故障恢复的事务日志(database transaction log for dealing with crash recovery,XLOG)。基于该数据,备机可以获取到主机的事务进程进行的操作,进行执行相同的操作,从而在备份机上实现了主机的数据同步。
本申请实施例中,所述第二进程可以被配置为进行对数据库的第二操作,并生成包括所述第二操作对应的操作记录的第二日志,第二进程和第一进程可以为主机中的事务进程,其中,主机可以存在一个或多个事务进程,主机在接收用户所发出的操作指令进行读写等操作的事务时,可以生成对应的事务进程,该事务进程包括与用户发出的操作指令对应的操作,事务进程可以对数据库中的存储设备进行相应的操作,其中,操作可以包括增加数据、删除数据、修改数据以及查询数据等等,本申请并不限定。事务进程在完成相应的操作之后,可以生成包括该操作对应的操作记录的数据,通过该数据,备机可以进行与主机相同的对存储设备的操作。在一种实现中,日志可以但不限于是处理故障恢复的事务日志(database transaction log for dealing with crash recovery,XLOG)。基于该日志,备机可以获取到主机的事务进程进行的操作,进行执行相同的操作,从而在备份机上实现了主机的备份。
可选的,本申请实施例中,第一进程和第二进程可以为事务进程,其中,第二进程被配置为进行对数据库(数据库系统中的存储设备或者内存等)的第二操作,并生成包括所述第二操作对应的操作记录的第二数据,其中,所述第二进程被配置对数据库进行第二操作,所述第二数据包括所述第二操作对应的操作记录。所述第一进程被配置为进行对数据库的第一操作,并生成包括所述第一操作对应的操作记录的第一数据。其中,第二进程和第一进程可以为主机上不同的事务进程,分别响应于不同的用户操作指令生成。
事务进程在生成数据之后,可以将数据存入缓存,并由数据写入进程将数据由缓存写入到对应的文件中。其中,数据写入进程可以为某一个竞争到锁的事务进程,或者是单独的专门用于进行数据写入的进程,这里并不限定。
本申请实施例中,第二进程在生成包括所述第二操作对应的操作记录的第二数据之后,可以由数据写入进程将第二数据写入到对应的文件中;第一进程被生成包括所述第一操作对应的操作记录的第一数据之后,可以由数据写入进程将第一数据写入到对应的文件中。其中,数据写入进程可以为第二进程、第一进程或者是其他事务进程,或者是其他专门用于进行数据写入的进程。
事务进程在生成数据之后,可以加入到特定的等待队列;其中,事务进程可以基于数据所在的数据队列号LSN(LOG sequence number)在等待队列中进行排序,并依次加入到对应的队列元素中。示例性的,参照图3,假设有4个事务进程加入等待队列,代号分别为T1~T4,数据T1~T4的数据位置LSN按顺序标识为10~40,如图3中示出的那样,事务进程T1~T4在加入到等待队列时,可以按照LSN进行排序,依次加入到等待队列中。
本申请实施例中,第二进程和第一进程在生成数据之后,可以将第二进程和第一进程的标识加入到等待队列中;具体的,第二进程在生成第二数据之后,可以将第二进程对应的标识加入到等待队列中;第一进程在生成第一数据之后,可以将第一进程对应的标识加入到等待队列中。需要说明的是,第一进程的标识可以唯一指示第一进程,第二进程的标识可以唯一指示第二进程,上述标识可以为进程的指针或者是其他字符串,本申请并不限定。
其中,所述第二进程的标识位于所述等待队列中的第三元素,所述第一进程的标识位于所述等待队列中的第四元素,所述第四元素在所述第三元素之后。其中,等待队列可以包括串接的多个元素,头部元素的next指针指向相邻的元素,以此类推,各个元素的next指针都指向队列中相邻的元素,直到尾部元素,在一种实现中,尾部元素的next指针可以指向空NULL,若等待队列是双向环回队列,用于更便利地支持其他的一些操作,比如需要临时取消某个事务进程时,因此尾部元素也可以指向其它队列元素。本申请实施例中,所述第四元素在所述第三元素之后,即在等待队列中存在一个next指针通路,可以由所述第三元素指向所述第四元素。
其中,在一种可选的实现中,等待队列可以包括多个元素,其中每个元素可以包括一个进程的标识,所述第二进程的标识位于所述等待队列中除头部元素之外的元素,所述第四元素与所述第三元素相邻,即第三元素的next指针指向第四元素。参照图4a,第二进程的标识位于等待队列除头部元素之外的元素(第三元素),第一进程的标识位于与第三元素相邻的元素(第四元素)中,其中,第一进程的标识也可以位于等待队列的尾部元素。
其中,在一种可选的实现中,等待队列可以包括多个元素,其中每个元素可以包括一个进程的标识,所述第二进程的标识位于所述等待队列的头部元素,所述第一进程的标识位于所述等待队列中除头部元素之外的元素。需要说明的是,这里的头部元素是指队列中的头部head。示例性的,参照图4b,第二进程的标识位于等待队列的头部元素,第一进程的标识位于等待队列中除头部元素之外的元素,其中,第二进程的标识所在的元素和第一进程的标识所在的元素之间可以存在其他元素,第一进程的标识也可以位于等待队列的尾部元素。
其中,在一种可选的实现中,参照图4c,等待队列可以包括多个元素,其中每个元素可以包括一个进程的标识,所述第二进程的标识位于所述等待队列中除头部元素之外的元素,所述第一进程的标识位于所述等待队列中除头部元素之外的元素,且所述第四元素与所述第三元素不相邻,即所述第四元素与所述第三元素之间还存在包括其他进程的元素。
本申请实施例中,事务进程在生成数据之后,除了进入等待队列之外,还可以向主机的数据同步进程发送数据同步请求,来指示数据同步进程触发备机进行数据同步,具体的,数据同步进程在接收到同步请求之后,若处于空闲状态,则可以将当前需要进行同步的数据发送到备机,备机的数据同步进程可以接收数据并写入到相应的备机文件系统。并在完成数据写入(即完成数据的同步)之后,备机的数据同步进程可以向主机反馈同步进度,来指示完成了哪些数据的同步。
本申请实施例中,数据同步进程可以为上述数据同步进程,数据同步进程在接收到数 据同步请求之后,若处于空闲状态,则可以将当前需要进行同步的数据(第一数据和第二数据)发送到备机,备机的数据同步进程可以接收第一数据和第二数据并写入到相应的备机文件系统。并在完成第一数据和第二数据的写入(即完成第一数据和第二数据的同步)之后,备机的数据同步进程可以向主机的数据同步进程反馈同步进度,来指示完成了第一数据和第二数据的同步。
202、所述数据同步进程基于所述备机完成所述第一数据的同步,唤醒第二进程。
数据同步进程在接收到备机发送同步进度之后,可以唤醒第二进程。具体的,数据同步进程可以遍历等待队列,根据完成进度从等待队列中分离出已完成的事务进程,并生成完成队列。此完成队列可以是临时生成的,在这个完成队列中的所有事务进程被唤醒后,此完成队列可以不再存在。需要说明的是,如果数据同步的进程足够快,同一个等待队列可能会先后分离出多个完成队列并存。
本申请实施例中,所述数据同步进程触发备机进行所述第二数据和所述第一数据的同步;并基于所述备机完成所述第二数据和所述第一数据的同步,至少根据所述第二进程生成完成队列,其中,所述第二进程的标识位于所述完成队列的第一元素中,则数据同步进程可以唤醒所述第一元素中包括的标识所对应的进程。
接下来描述,数据同步进程如何至少根据所述第二进程生成完成队列:
本申请实施例中,所述完成队列为至少基于所述第二进程和所述第一进程生成的,所述第一进程的标识位于所述完成队列的第二元素中,且在完成队列中,所述第二元素位于所述第一元素之后。
本申请实施例中,完成队列可以是数据同步进程基于等待队列生成的。在一种可选的实现中,所述完成队列为所述等待队列的全部或一部分。其中,若等待队列中仅有一部分进程对应的日志在备机上完成了备份,则可以将上述一部分进程中,在等待队列中位于最末端的进程所在的元素的next指针由原本的指向相邻的进程,变为指向空NULL。此时,上述一部分进程中,在等待队列中位于最末端的进程所在的元素则成为了尾部元素。
本申请实施例中,所述第三元素和所述第四元素在所述等待队列中的相对位置,和所述第一元素和所述第二元素在所述完成队列中的相对位置相同。即,第二进程所在的元素和第一进程所在的元素之间的间隔和前后顺序不变。
参照图5a,第二进程的标识位于等待队列除头部元素之外的元素(第三元素),第一进程的标识位于与第三元素相邻的元素(第四元素)中,其中,第一进程也可以位于等待队列的尾部元素,即第一进程所在的元素的next指针指向空NULL。相应的,完成队列为等待队列的一部分,在等待队列中,第三元素和第四元素相邻,且第四元素位于第三元素之后,相应的,在完成队列中,第三元素和第四元素相邻,且第四元素位于第三元素之后。
参照图5b,第二进程的标识位于等待队列的头部元素,第一进程的标识位于等待队列中除头部元素之外的元素,其中,第二进程所在的元素和第一进程所在的元素之间可以存在其他元素,第一进程也可以位于等待队列的尾部元素,即第一进程所在的元素的next指针指向空NULL。相应的,完成队列为等待队列的一部分,在等待队列中,第三元素为头 部元素,第三元素和第四元素之间间隔了N个元素,且第四元素位于第三元素之后,相应的,在完成队列中,第三元素为头部元素,第三元素和第四元素之间间隔了N个元素,且第四元素位于第三元素之后。
参照图5c,所述第二进程的标识位于所述等待队列中除头部元素之外的元素,所述第一进程的标识位于所述等待队列中除头部元素之外的元素,且所述第四元素与所述第三元素不相邻,即所述第四元素与所述第三元素之间还存在包括其他进程的元素。相应的,完成队列为等待队列的一部分,在等待队列中,第三元素和第四元素之间间隔了N个元素,且第四元素位于第三元素之后,相应的,在完成队列中,第三元素和第四元素之间间隔了N个元素,且第四元素位于第三元素之后。
本申请实施例中,数据同步进程可以唤醒完成队列中的所述第二进程,即数据同步进程可以唤醒完成队列中的第一元素包括的标识所对应的进程,该第一元素包括所述第二进程的标识。
在一种可选的实现中,第二进程的标识位于完成队列的头部元素,则数据同步进程可以唤醒完成队列的头部元素包括的标识所对应的进程。
在一种可选的实现中,第二进程的标识位于完成队列中除头部元素之外的元素,则数据同步进程可以唤醒头部元素包括的进程,以及依次相邻的元素包括的标识所对应的进程,直到唤醒第二进程。
203、所述第二进程唤醒所述第一进程。
本申请实施例中,第二进程在被唤醒之后,可以唤醒第一进程。
在一种可选的实现中,所述第二进程唤醒所述完成队列中位于所述第一元素之后的一个或多个元素包括的进程。本申请实施例中,第二进程可以代替数据同步进程来唤醒完成队列中的其它进程。具体的,第二进程需要检测完成队列的后续元素中是否含有其他事务进程,如果有,则需要负责唤醒完成队列中的剩余事务进程。
在一种可选的实现中,第二进程的标识位于完成队列的头部元素,具体的,参照图6a,数据同步进程在唤醒第二进程之后,第二进程可以唤醒第N进程(该第N进程可以存在也可以不存在,当不存在时,第二进程所在的元素和第一进程所在的元素相邻,且第N进程的数量并不限定,即第二进程和第一进程之间可以存在一个或多个元素),在完成第N进程的唤醒之后,可以唤醒第一进程,并唤醒第一进程之后的进程(如果第一进程的标识位于完成队列的尾部元素的话,则不需要)。
在一种可选的实现中,第二进程的标识位于完成队列中除头部元素之外的元素,具体的,参照图6b,数据同步进程需要首先唤醒第N进程(第N进程的数量并不限定,即第二进程之前可以存在一个或多个元素),之后,数据同步进程可以唤醒第二进程,进而,第二进程可以唤醒第一进程,并唤醒第一进程之后的进程(如果第一进程的标识位于完成队列的尾部元素的话,则不需要)。
在一种可选的实现中,所述第二元素与所述第一元素相邻;则所述第二进程唤醒在所述完成队列中与所述第一元素相邻且位于所述第一元素之后的元素包括的标识所对应的进 程。
在一种可选的实现中,第二进程的标识位于完成队列的头部元素,具体的,参照图6c,数据同步进程在唤醒第二进程之后,第二进程可以唤醒相邻的元素包括的第一进程,之后,第一进程可以唤醒与其相邻的第N进程,以此类推,直到唤醒尾部元素包括的事务进程。
在一种可选的实现中,第二进程的标识位于完成队列中除头部元素之外的元素,具体的,参照图6d,数据同步进程需要首先唤醒第N进程(第N进程的数量并不限定,即第二进程之前可以存在一个或多个元素),之后,第N进程可以唤醒第二进程,进而,第二进程可以唤醒第一进程,以此类推,直到唤醒尾部元素包括的事务进程。
本申请实施例中,若第二进程的标识位于完成队列除头部元素之外的元素(不是尾部元素),则,第二进程的后续进程的唤醒都不由数据同步进程来进行(可以由第二进程或者第二进程的后续进程来做),使得数据同步进程(数据同步进程)只需要唤醒一部分已完成数据同步的进程,使得数据同步进程可以更专注于触发备份机进行数据的同步以及接收备份机的同步进度,从而缓解数据同步进程的压力,减少了数据同步进程唤醒事务进程的时间。
若第二进程的标识位于完成队列的头部元素,且后续进程的唤醒都不由数据同步进程来进行(可以由第二进程或者第二进程的后续进程来做),使得数据同步进程(数据同步进程)只需要唤醒一个进程(第二进程),从而更进一步的降低了缓解数据同步进程的压力,减少了数据同步进程唤醒事务进程的时间。
参照图7,本申请实施例中,数据同步进程在唤醒第二进程之后,可以触发备份机进行数据同步,而其余事务进程可以由第二进程来完成。参照图8,在现有的实现中,数据同步进程在唤醒第二进程之后,还需要唤醒其余事务进程,直到完成其余事务进程的唤醒,才可以触发备份机进行数据同步,此时,等待队列中可能存在很多等待唤醒的事务进程了,使得数据同步进程的进程唤醒效率较差。
本申请实施例中,数据同步进程不需要唤醒全部已完成数据同步的进程,只需要唤醒一部分已完成数据同步的进程,使得数据同步进程可以更专注于触发备份机进行数据的同步以及接收备份机的同步进度,从而缓解数据同步进程的压力,减少了数据同步进程唤醒事务进程的时间。
在一种实施例中,第二进程可以不为事务进程,而是单独用于唤醒事务进程的进程。第一进程为等待队列(等待队列)中的任意一个元素包括的标识所对应的进程。本申请实施例中,所述完成队列为至少根据所述第一进程生成的,所述第一进程的标识位于所述完成队列的第一元素中;所述第二进程唤醒所述第一元素中包括的标识所对应的进程。
本申请实施例中,可以至少根据所述第一进程生成完成队列,其中,所述第一进程的标识位于所述完成队列的第一元素中。所述主机包括等待队列,所述方法还包括:在所述备机完成所述备份之前,将所述第一进程加入到所述等待队列,其中,所述完成队列为根据所述等待队列生成的。可选的,所述完成队列可以为所述等待队列的全部或一部分。
需要说明的是,参照图9,第二进程可以唤醒完成队列中的全部元素包括的事务进程;或者,当第一进程的标识位于完成队列的头部元素时,第二进程可以唤醒第一进程,由第 一进程来唤醒完成队列中剩余的元素包括的事务进程。
或者,参照图10,第二进程可以唤醒第一进程所在的元素之前的元素包括的标识所对应的进程,直到唤醒了第一进程,并由第一进程来唤醒完成队列中剩余的元素包括的事务进程。
或者,参照图11,当第一进程的标识位于完成队列的头部元素时,第二进程可以唤醒第一进程,由第一进程来唤醒相邻且之后的元素包括的标识所对应的进程,之后,由上述唤醒的相邻且之后的元素包括的标识所对应的进程完成队列中剩余的元素包括的事务进程;或者,当第一进程的标识位于完成队列的头部元素时,第二进程可以唤醒第一进程,由第一进程来唤醒相邻且之后的元素包括的标识所对应的进程,之后,由上述唤醒的相邻且之后的元素包括的标识所对应的进程唤醒相邻的元素包括的标识所对应的进程,以此类推,直到完成队列中的元素包括的事务进程都被唤醒。
本申请实施例中,数据同步进程不需要唤醒已完成数据同步的进程,只需要唤醒一个专门用于唤醒已完成数据同步的进程,使得数据同步进程可以更专注于触发备份机进行数据的同步以及接收备份机的同步进度,从而缓解数据同步进程的压力,减少了数据同步进程唤醒事务进程的时间。
可选的,本申请实施例中,所述主机包括多个NUMA节点,所述第二进程和所述第一进程属于同一个NUMA节点包括的进程。其中,与第二进程和第一进程相关的数据,占用同样的NUMA节点下的内存资源。
可选的,本申请实施例中,所述主机包括多个NUMA节点,所述第二进程和所述第一进程中的至少一个进程与所述完成队列属于同一个NUMA节点。其中,与第二进程和第一进程中的至少一个进程、以及完成队列相关的数据,占用同样的NUMA节点下的内存资源。
可选的,本申请实施例中,所述主机包括多个NUMA节点,所述第二进程和所述第一进程中的至少一个进程与所述等待队列属于同一个NUMA节点。其中,与第二进程和所述第一进程中的至少一个进程、以及等待队列相关的数据,占用同样的NUMA节点下的内存资源。
可选的,本申请实施例中,所述完成队列和所述等待队列属于同一个NUMA节点。其中,与第二进程和第一进程相关的数据,占用同样的NUMA节点下的内存资源。其中,完成队列以及等待队列相关的数据,占用同样的NUMA节点下的内存资源。
本申请实施例中,在数据库系统初始化时,可以为每个NUMA节点分配对应的等待队列,以及将事务进程(第二进程和第一进程)分配到该节点的等待队列中,同理,从等待队列中分离出来的完成队列(完成队列)也需要位于该节点。基于此,完成队列在遍历和唤醒事务进程时进程和访问的数据位于相同的NUMA节点,避免了代价较高的远端访存,进一步提升了并行唤醒机制的效率。
接下来描述一个本申请的应用例子,参照图12和图13,若NUMA系统存在两个NUMA节点(节点1和节点2)。
在系统初始化时,要为数据同步进程准备两个等待队列(等待队列),分属节点1和节 点2。在事务进程启动时,可以按照均分策略分别绑定到不同的NUMA节点。这里假设编号为奇数的进程绑定在节点1,而编号为偶数的进程绑定到节点2。
当事务进程准备提交,并已经完成了本机日志文件写入后,向数据同步进程发送请求,并加入到对应的等待队列。比如,编号为1/3/5/7/9的进程加入到节点1下的等待队列;编号为2/4/6/8/10的进程则加入到节点2下的等待队列;
主机的数据同步进程发送日志到备机,并接收备机的日志处理进度报文。主机数据同步进程当发现备机的同步进度有刷新,准备唤醒相关事务进程。在唤醒时,遍历各个等待队列,根据同步完成的位置信息将队列断开,即分离出已完成的事务队列;此步骤需要持有锁,以保护等待队列。
如上图12所示,编号为1/3/5的事务进程和编号为2/4/6的事务进程被分别分离到不同的完成队列(完成队列)。数据同步进程可以唤醒每个完成队列的首个事务进程,不再负责唤醒其它进程。如图13所示,仅编号为1和2的进程被唤醒。然后数据同步进程立即进入下一轮工作,不再处理剩余进程。每个完成队列的头部元素的进程(编号为1和2的进程)负责完成本队列的进程唤醒任务。其中,编号为1和2的进程唤醒操作是并发执行的。
参照图14,图14为本申请实施例提供的一种数据写入方法的流程示意,如图14中示出的那样,本申请实施例提供的数据写入方法包括:
1401、数据写入进程基于完成对第一数据的写操作,唤醒第二进程,其中,所述第一数据为第一进程生成的。
1402、所述第二进程唤醒所述第一进程。
本申请实施例中,所述第一进程被配置对数据库进行第一操作,所述第一数据包括所述第一操作对应的操作记录。
和图2至图13中描述的实施例不同的是,本实施例应用在数据写入的场景中,其中,数据可以是和图2对应的实施例中第一数据和第二数据相同类型的数据,数据库系统的数据写入到本地文件是非常重要的处理步骤,其中,为避免竞争带来的额外消耗,采用专门的数据服务进程来为其它事务进程写入数据(即本实施例中的数据写入进程)。
在现有的实现中,数据写入进程在完成对所述第一数据的写操作之后,需要进行第一进程唤醒。花费在事务进程唤醒上的时间较长,且数据写入进程只有在完成事务进程的唤醒之后才能进行其余事务进程对应的数据的写操作,效率较低。
本申请实施例中,数据写入进程在完成对所述第一数据的写操作之后,可以唤醒第二进程,之后由第二进程完成或者结合完成队列中的其余进程完成进程的唤醒。相似之处可以参考图2至图13中实施例的描述,这里不再赘述。
本申请实施例中,可以减少本地数据写入进程花费在事务进程唤醒上的时间,从而可以提高写文件操作的效率。
在一种可选的实现中,所述第一进程被配置对数据库进行第一操作,所述第一数据包括所述第一操作对应的操作记录。
在一种可选的实现中,所述数据写入进程基于完成对第一数据的写操作,唤醒第二进 程,包括:
所述数据写入进程基于完成对第一数据和第二数据的写操作,唤醒第二进程;其中,所述第二数据为所述第二进程生成的。
在一种可选的实现中,所述第二进程被配置对数据库进行第二操作,所述第二数据包括所述第二操作对应的操作记录。
在一种可选的实现中,所述主机包括完成队列,所述第二进程的标识位于所述完成队列的第一元素中;所述唤醒所述第二进程,包括:
唤醒所述第一元素中包括的标识所对应的进程。
在一种可选的实现中,所述方法还包括:
在唤醒所述第二进程之前,在所述数据写入进程完成对第一数据的写操作之后,所述数据写入进程至少根据所述第二进程的标识生成完成队列,其中,所述第二进程的标识位于所述完成队列的第一元素中。
在一种可选的实现中,所述第一元素为所述完成队列的头部元素。
在一种可选的实现中,所述第一进程的标识位于所述完成队列的第二元素中,且在所述完成队列中,所述第二元素位于所述第一元素之后;
相应的,所述第二进程唤醒所述第一进程,包括:
所述第二进程唤醒所述第二元素包括的标识所对应的进程。
在一种可选的实现中,所述第二进程唤醒所述第二元素包括的进程,包括:
所述第二进程唤醒所述完成队列中位于所述第一元素之后的多个元素包括的标识所对应的进程。
在一种可选的实现中,所述第二元素与所述第一元素相邻;相应的,所述第二进程唤醒所述第二元素包括的进程,包括:
所述第二进程唤醒在所述完成队列中与所述第一元素相邻且位于所述第一元素之后的元素包括的进程。
在一种可选的实现中,所述主机包括等待队列,在所述数据写入进程完成对第一数据的写操作之前,所述第二进程的标识位于所述等待队列中的第三元素,所述第一进程的标识位于所述等待队列中的第四元素,所述第四元素在所述第三元素之后;其中,所述完成队列为根据所述等待队列生成的。
在一种可选的实现中,所述完成队列为所述等待队列的全部或一部分。
在一种可选的实现中,所述第三元素和所述第四元素在所述等待队列中的相对位置,和所述第一元素和所述第二元素在所述完成队列中的相对位置相同。
在一种可选的实现中,所述第二进程的标识位于所述等待队列的头部元素,所述第一进程的标识位于所述等待队列中除头部元素之外的元素。
在一种可选的实现中,所述主机包括完成队列,所述第一进程的标识位于所述完成队列的第一元素中,所述第二进程位于所述完成队列外;所述第二进程唤醒所述第一进程,包括:
所述第二进程唤醒所述第一元素中包括的标识所对应的进程。
在一种可选的实现中,所述方法还包括:
在所述第二进程唤醒所述第一进程之前,在所述备机完成所述第一数据的同步之后,至少根据所述第一进程的标识生成完成队列,其中,所述第一进程的标识位于所述完成队列的第一元素中。
在一种可选的实现中,所述主机包括等待队列,在所述数据写入进程完成对第一数据的写操作之前,所述第一进程的标识位于所述等待队列中的第四元素;其中,所述完成队列为根据所述等待队列生成的。
在一种可选的实现中,所述完成队列为所述等待队列的全部或一部分。
在一种可选的实现中,所述第一进程以及所述第二进程运行在主机上,所述主机包括多个NUMA节点,所述第二进程和所述第一进程属于同一个NUMA节点包括的进程。
在一种可选的实现中,所述第一进程以及所述第二进程运行在主机上,所述主机包括多个NUMA节点,所述第二进程和所述第一进程中的至少一个进程,与所述完成队列属于同一个NUMA节点。
在一种可选的实现中,所述第一进程以及所述第二进程运行在主机上,所述主机包括多个NUMA节点,所述第二进程和所述第一进程中的至少一个进程,与所述等待队列属于同一个NUMA节点;和/或,所述完成队列和所述等待队列属于同一个NUMA节点。
参照图15,本申请还提供了一种数据同步装置1500,所述装置1500包括:处理电路1501和通信接口1502;其中,
所述处理电路1501,被配置为执行图2以及图14对应的实施例中与数据处理相关的动作;上述通信接口1502被配置执行上述实施例中与备机之间交互相关的发送动作或接收动作。
参照图16,本申请还提供了一种计算机可读存储介质,在一些实施例中,上述图2至图14所公开的方法可以实施为以机器可读格式被编码在计算机可读存储介质上的或者被编码在其它非瞬时性介质或者制品上的计算机程序指令。图16示意性地示出根据这里展示的至少一些实施例而布置的示例计算机程序产品的概念性局部视图,示例计算机程序产品包括用于在计算设备上执行计算机进程的计算机程序。在一个实施例中,示例计算机程序产品1600是使用信号承载介质1601来提供的。信号承载介质1601可以包括一个或多个程序指令1602,其当被一个或多个处理器运行时可以提供以上针对图2至图14描述的功能或者部分功能。因此,例如,参考图2中所示的实施例,方框201-203的一个或多个特征可以由与信号承载介质1601相关联的一个或多个指令来承担,参考图14中所示的实施例,方框1401-1402的一个或多个特征可以由与信号承载介质1601相关联的一个或多个指令来承担。此外,图16中的程序指令1602也描述示例指令。
在一些示例中,信号承载介质1601可以包含计算机可读介质1603,诸如但不限于,硬盘驱动器、紧密盘(CD)、数字视频光盘(DVD)、数字磁带、存储器、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等等。在一些实施方式中,信号承载介质1601可以包含计算机可记录介质1604,诸如但不限于, 存储器、读/写(R/W)CD、R/W DVD、等等。在一些实施方式中,信号承载介质1601可以包含通信介质1605,诸如但不限于,数字和/或模拟通信介质(例如,光纤电缆、波导、有线通信链路、无线通信链路、等等)。因此,例如,信号承载介质1601可以由无线形式的通信介质1605(例如,遵守IEEE 802.11标准或者其它传输协议的无线通信介质)来传达。一个或多个程序指令1602可以是,例如,计算机可执行指令或者逻辑实施指令。在一些示例中,计算设备的计算设备可以被配置为,响应于通过计算机可读介质1603、计算机可记录介质1604、和/或通信介质1605中的一个或多个传达到计算设备的程序指令1602,提供各种操作、功能、或者动作。应该理解,这里描述的布置仅仅是用于示例的目的。因而,本领域技术人员将理解,其它布置和其它元素(例如,机器、接口、功能、顺序、和功能组等等)能够被取而代之地使用,并且一些元素可以根据所期望的结果而一并省略。另外,所描述的元素中的许多是可以被实现为离散的或者分布式的组件的、或者以任何适当的组合和位置来结合其它组件实施的功能实体。
基于同一发明构思,本发明实施例提供一种主机,请参见图17,主机1700包括:发射器1703、接收器1704、存储器1702和与存储器1702耦合的处理器1701。发射器1703、接收器1704、存储器1702和处理器1701可通过总线或者其它方式连接(图17中以通过总线连接为例)。其中:
处理器1701,可以是一个或多个中央处理器(Central Processing Unit,CPU),图17中以一个处理器为例,在处理器1701是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。
存储器1702,包括但不限于是随机存储记忆体(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、或便携式只读存储器(Compact Disc Read-Only Memory,CD-ROM),该存储器1702用于相关指令及数据,还用于存储程序代码,所述程序代码具体用于实现图2至图14中实施例中描述的方法;
发射器1703用于向外部(例如备机)发送数据;
接收器1704用于从外部(例如备机)接收数据。
需要说明的是,在本发明实施例中,主机可以是数据库系统中独立的设备,例如,所述主机是独立的物理服务器。主机也可以是非独立的设备,这种情况下,在一种应用场景中,主机可以内置于主机中,或者作为主机的一种功能模块而存在(例如主机和主机作为不同的虚拟机,通过I/O接口连接,共存于同一物理服务器);在另一种应用场景中,主机可以内置于某个备机中,或者作为某个备机的一种功能模块而存在(例如某个备机和主机作为不同的虚拟机,通过I/O接口连接,共存于同一物理服务器)。
还需要说明的,处理器1701的执行步骤以及处理器1701涉及的其他技术特征还可参照图2至图17方法实施例中所述主机的相关内容,这里不再赘述。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装 置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者其他网络设备等)执行本申请图2实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (45)

  1. 一种数据同步方法,其特征在于,所述方法包括:
    数据同步进程将第一数据发送给备机,所述第一数据为主机上运行的第一进程生成的;
    所述数据同步进程基于所述备机完成所述第一数据的同步,唤醒第二进程;以及,
    所述第二进程唤醒所述第一进程。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    所述数据同步进程将第一数据发送给所述备机之前,所述数据同步进程接收所述第一进程对应的数据同步请求。
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一进程被配置对数据库进行第一操作,所述第一数据包括所述第一操作对应的操作记录。
  4. 根据权利要求1至3任一所述的方法,其特征在于,所述方法还包括:
    所述数据同步进程将第二数据发送给所述备机,所述第二数据为所述第二进程生成的;
    所述数据同步进程基于所述备机完成所述第一数据的同步,唤醒第二进程,包括:
    所述数据同步进程基于所述备机完成所述第一数据和所述第二数据的同步,唤醒所述第二进程。
  5. 根据权利要求4所述的方法,其特征在于,所述第二进程被配置对数据库进行第二操作,所述第二数据包括所述第二操作对应的操作记录。
  6. 根据权利要求4或5所述的方法,其特征在于,所述主机包括完成队列,所述第二进程的标识位于所述完成队列的第一元素中;
    所述唤醒所述第二进程,包括:
    唤醒所述第一元素中包括的标识所对应的进程。
  7. 根据权利要求4至6任一所述的方法,其特征在于,所述方法还包括:
    在唤醒所述第二进程之前,在所述备机完成所述第一数据的同步之后,至少根据所述第二进程的标识生成完成队列,其中,所述第二进程的标识位于所述完成队列的第一元素中。
  8. 根据权利要求6或7所述的方法,其特征在于,所述第一元素为所述完成队列的头部元素。
  9. 根据权利要求6至8任一所述的方法,其特征在于,所述第一进程的标识位于所述完成队列的第二元素中,且在所述完成队列中,所述第二元素位于所述第一元素之后;
    相应的,所述第二进程唤醒所述第一进程,包括:
    所述第二进程唤醒所述第二元素包括的标识所对应的进程。
  10. 根据权利要求9所述的方法,其特征在于,所述第二进程唤醒所述第二元素包括的进程,包括:
    所述第二进程唤醒所述完成队列中位于所述第一元素之后的多个元素包括的标识所对应的进程。
  11. 根据权利要求9所述的方法,其特征在于,所述第二元素与所述第一元素相邻;相应的,所述第二进程唤醒所述第二元素包括的进程,包括:
    所述第二进程唤醒在所述完成队列中与所述第一元素相邻且位于所述第一元素之后的元素包括的进程。
  12. 根据权利要求6至11任一所述的方法,其特征在于,所述主机包括等待队列,在所述备机完成所述同步之前,所述第二进程的标识位于所述等待队列中的第三元素,所述第一进程的标识位于所述等待队列中的第四元素,所述第四元素在所述第三元素之后;其中,所述完成队列为根据所述等待队列生成的。
  13. 根据权利要求12所述的方法,其特征在于,所述完成队列为所述等待队列的全部或一部分。
  14. 根据权利要求12或13所述的方法,其特征在于,所述第三元素和所述第四元素在所述等待队列中的相对位置,和所述第一元素和所述第二元素在所述完成队列中的相对位置相同。
  15. 根据权利要求12至14任一所述的方法,其特征在于,所述第二进程的标识位于所述等待队列的头部元素,所述第一进程的标识位于所述等待队列中除头部元素之外的元素。
  16. 根据权利要求1至3任一所述的方法,其特征在于,所述主机包括完成队列,所述第一进程的标识位于所述完成队列的第一元素中,所述第二进程位于所述完成队列外;所述第二进程唤醒所述第一进程,包括:
    所述第二进程唤醒所述第一元素中包括的标识所对应的进程。
  17. 根据权利要求1至3、16中任一所述的方法,其特征在于,所述方法还包括:
    在所述第二进程唤醒所述第一进程之前,在所述备机完成所述第一数据的同步之后,至少根据所述第一进程的标识生成完成队列,其中,所述第一进程的标识位于所述完成队列的第一元素中。
  18. 根据权利要求16或17所述的方法,其特征在于,所述主机包括等待队列,在所述备机完成所述同步之前,所述第一进程的标识位于所述等待队列中的第四元素;其中,所述完成队列为根据所述等待队列生成的。
  19. 根据权利要求18所述的方法,其特征在于,所述完成队列为所述等待队列的全部或一部分。
  20. 根据权利要求1至19任一所述的方法,其特征在于,所述第一进程以及所述第二进程运行在主机上,所述主机包括多个NUMA节点,所述第二进程和所述第一进程属于同一个NUMA节点包括的进程。
  21. 根据权利要求6至19任一所述的方法,其特征在于,所述第一进程以及所述第二进程运行在主机上,所述主机包括多个NUMA节点,所述第二进程和所述第一进程中的至少一个进程,与所述完成队列属于同一个NUMA节点。
  22. 根据权利要求12至15、18、19中任一所述的方法,其特征在于,所述第一进程以及所述第二进程运行在主机上,所述主机包括多个NUMA节点,所述第二进程和所述第一进程中的至少一个进程,与所述等待队列属于同一个NUMA节点;和/或,所述完成队列和所述等待队列属于同一个NUMA节点。
  23. 一种数据写入方法,其特征在于,所述方法包括:
    数据写入进程基于完成对第一数据的写操作,唤醒第二进程,其中,所述第一数据为第一进程生成的;以及,
    所述第二进程唤醒所述第一进程。
  24. 根据权利要求23所述的方法,其特征在于,所述第一进程被配置对数据库进行第一操作,所述第一数据包括所述第一操作对应的操作记录。
  25. 根据权利要求23或24所述的方法,其特征在于,所述数据写入进程基于完成对第一数据的写操作,唤醒第二进程,包括:
    所述数据写入进程基于完成对第一数据和第二数据的写操作,唤醒第二进程;其中,所述第二数据为所述第二进程生成的。
  26. 根据权利要求25所述的方法,其特征在于,所述第二进程被配置对数据库进行第二操作,所述第二数据包括所述第二操作对应的操作记录。
  27. 根据权利要求25或26所述的方法,其特征在于,所述主机包括完成队列,所述第二进程的标识位于所述完成队列的第一元素中;所述唤醒所述第二进程,包括:
    唤醒所述第一元素中包括的标识所对应的进程。
  28. 根据权利要求25至27任一所述的方法,其特征在于,所述方法还包括:
    在唤醒所述第二进程之前,在所述数据写入进程完成对第一数据的写操作之后,所述数据写入进程至少根据所述第二进程的标识生成完成队列,其中,所述第二进程的标识位于所述完成队列的第一元素中。
  29. 根据权利要求27或28所述的方法,其特征在于,所述第一元素为所述完成队列的头部元素。
  30. 根据权利要求27至29任一所述的方法,其特征在于,所述第一进程的标识位于所述完成队列的第二元素中,且在所述完成队列中,所述第二元素位于所述第一元素之后;
    相应的,所述第二进程唤醒所述第一进程,包括:
    所述第二进程唤醒所述第二元素包括的标识所对应的进程。
  31. 根据权利要求30所述的方法,其特征在于,所述第二进程唤醒所述第二元素包括的进程,包括:
    所述第二进程唤醒所述完成队列中位于所述第一元素之后的多个元素包括的标识所对应的进程。
  32. 根据权利要求30所述的方法,其特征在于,所述第二元素与所述第一元素相邻;相应的,所述第二进程唤醒所述第二元素包括的进程,包括:
    所述第二进程唤醒在所述完成队列中与所述第一元素相邻且位于所述第一元素之后的元素包括的进程。
  33. 根据权利要求27至32任一所述的方法,其特征在于,所述主机包括等待队列,在所述数据写入进程完成对第一数据的写操作之前,所述第二进程的标识位于所述等待队列中的第三元素,所述第一进程的标识位于所述等待队列中的第四元素,所述第四元素在所述第三元素之后;其中,所述完成队列为根据所述等待队列生成的。
  34. 根据权利要求33所述的方法,其特征在于,所述完成队列为所述等待队列的全部或一部分。
  35. 根据权利要求33或34所述的方法,其特征在于,所述第三元素和所述第四元素在所述等待队列中的相对位置,和所述第一元素和所述第二元素在所述完成队列中的相对位 置相同。
  36. 根据权利要求33至35任一所述的方法,其特征在于,所述第二进程的标识位于所述等待队列的头部元素,所述第一进程的标识位于所述等待队列中除头部元素之外的元素。
  37. 根据权利要求23或24所述的方法,其特征在于,所述主机包括完成队列,所述第一进程的标识位于所述完成队列的第一元素中,所述第二进程位于所述完成队列外;所述第二进程唤醒所述第一进程,包括:
    所述第二进程唤醒所述第一元素中包括的标识所对应的进程。
  38. 根据权利要求23、24、37中任一所述的方法,其特征在于,所述方法还包括:
    在所述第二进程唤醒所述第一进程之前,在所述备机完成所述第一数据的同步之后,至少根据所述第一进程的标识生成完成队列,其中,所述第一进程的标识位于所述完成队列的第一元素中。
  39. 根据权利要求37或38所述的方法,其特征在于,所述主机包括等待队列,在所述数据写入进程完成对第一数据的写操作之前,所述第一进程的标识位于所述等待队列中的第四元素;其中,所述完成队列为根据所述等待队列生成的。
  40. 根据权利要求39所述的方法,其特征在于,所述完成队列为所述等待队列的全部或一部分。
  41. 根据权利要求23至40任一所述的方法,其特征在于,所述第一进程以及所述第二进程运行在主机上,所述主机包括多个NUMA节点,所述第二进程和所述第一进程属于同一个NUMA节点包括的进程。
  42. 根据权利要求27至40任一所述的方法,其特征在于,所述第一进程以及所述第二进程运行在主机上,所述主机包括多个NUMA节点,所述第二进程和所述第一进程中的至少一个进程,与所述完成队列属于同一个NUMA节点。
  43. 根据权利要求33至36、39、40中任一所述的方法,其特征在于,所述第一进程以及所述第二进程运行在主机上,所述主机包括多个NUMA节点,所述第二进程和所述第一进程中的至少一个进程,与所述等待队列属于同一个NUMA节点;和/或,所述完成队列和所述等待队列属于同一个NUMA节点。
  44. 一种计算机可读存储介质,其特征在于,存储有计算机程序,所述程序被计算机执行时,实现权利要求1至22任一项所述的方法。
  45. 一种计算机可读存储介质,其特征在于,存储有计算机程序,所述程序被计算机执行时,实现权利要求23至43任一项所述的方法。
PCT/CN2021/101223 2020-06-30 2021-06-21 一种数据同步方法及装置 WO2022001723A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21834339.0A EP4170519A4 (en) 2020-06-30 2021-06-21 DATA SYNCHRONIZATION METHOD AND APPARATUS
US18/146,955 US20230137609A1 (en) 2020-06-30 2022-12-27 Data synchronization method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010617593.1A CN113868014A (zh) 2020-06-30 2020-06-30 一种数据同步方法及装置
CN202010617593.1 2020-06-30

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/146,955 Continuation US20230137609A1 (en) 2020-06-30 2022-12-27 Data synchronization method and apparatus

Publications (1)

Publication Number Publication Date
WO2022001723A1 true WO2022001723A1 (zh) 2022-01-06

Family

ID=78981829

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/101223 WO2022001723A1 (zh) 2020-06-30 2021-06-21 一种数据同步方法及装置

Country Status (4)

Country Link
US (1) US20230137609A1 (zh)
EP (1) EP4170519A4 (zh)
CN (1) CN113868014A (zh)
WO (1) WO2022001723A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117033087B (zh) * 2023-10-10 2024-01-19 武汉吧哒科技股份有限公司 数据处理方法、装置、存储介质及管理服务器

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102841810A (zh) * 2011-05-14 2012-12-26 国际商业机器公司 用于在计算环境中执行线程的方法和系统
US20140108839A1 (en) * 2011-04-15 2014-04-17 Nec Corporation Log record writing system, device, method, and program
CN108319508A (zh) * 2017-01-18 2018-07-24 中国移动通信集团公司 Http同步请求转为异步处理的方法及服务器
CN108509260A (zh) * 2018-01-31 2018-09-07 深圳市万普拉斯科技有限公司 线程识别处理方法、装置、计算机设备和存储介质
CN110807062A (zh) * 2018-08-02 2020-02-18 中兴通讯股份有限公司 一种数据同步的方法、装置和数据库主机

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105573825B (zh) * 2014-10-11 2020-02-14 华为技术有限公司 一种跨操作系统的任务间同步的方法及装置
CN108460047B (zh) * 2017-02-21 2021-11-16 阿里巴巴集团控股有限公司 数据同步方法及设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140108839A1 (en) * 2011-04-15 2014-04-17 Nec Corporation Log record writing system, device, method, and program
CN102841810A (zh) * 2011-05-14 2012-12-26 国际商业机器公司 用于在计算环境中执行线程的方法和系统
CN108319508A (zh) * 2017-01-18 2018-07-24 中国移动通信集团公司 Http同步请求转为异步处理的方法及服务器
CN108509260A (zh) * 2018-01-31 2018-09-07 深圳市万普拉斯科技有限公司 线程识别处理方法、装置、计算机设备和存储介质
CN110807062A (zh) * 2018-08-02 2020-02-18 中兴通讯股份有限公司 一种数据同步的方法、装置和数据库主机

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4170519A4

Also Published As

Publication number Publication date
EP4170519A1 (en) 2023-04-26
US20230137609A1 (en) 2023-05-04
EP4170519A4 (en) 2023-12-27
CN113868014A (zh) 2021-12-31

Similar Documents

Publication Publication Date Title
CN102265277B (zh) 数据存储系统的操作方法和装置
JPH07239799A (ja) 遠隔データ・シャドーイングを提供する方法および遠隔データ二重化システム
KR20100070968A (ko) 클러스터 데이터 관리 시스템 및 클러스터 데이터 관리 시스템에서 병렬 처리를 이용한 데이터 복구 방법
US11748215B2 (en) Log management method, server, and database system
CN104965850A (zh) 一种基于开源技术的数据库高可用实现方法
JPH09325905A (ja) 記憶制御装置
WO2020025049A1 (zh) 数据同步的方法、装置、数据库主机及存储介质
WO2013131443A1 (zh) 存储数据的方法及装置
WO2023061249A1 (zh) 分布式数据库的数据处理方法、系统、设备和存储介质
JP3877519B2 (ja) システム回復方法およびその実施計算機システム並びにその処理プログラムを記録した記録媒体
CN115794499B (zh) 一种用于分布式块存储集群间双活复制数据的方法和系统
WO2022001723A1 (zh) 一种数据同步方法及装置
US20240211488A1 (en) Transaction commitment systems, methods, and apparatuses based on distributed database systems
WO2024001079A1 (zh) 一种数据库主备同步操作的加速方法和系统
JP4106014B2 (ja) 少なくとも1つの不揮発性データ記憶装置を含む複数ノード・データ処理システムにおける通信方法およびプログラム
WO2022033269A1 (zh) 数据处理的方法、设备及系统
CN108460047B (zh) 数据同步方法及设备
JP2006293910A (ja) 安全で高速なデータベース・レプリケーション技術
Camargos et al. Multicoordinated paxos
CN110121712B (zh) 一种日志管理方法、服务器和数据库系统
JP6390748B1 (ja) 情報処理装置、情報処理方法および情報処理プログラム
WO2023246236A1 (zh) 分布式数据库的节点配置方法、事务日志同步方法和节点
CN115509806A (zh) 基于row的实时保护异步远程复制方法、装置、设备
CN114741416A (zh) 一种双活系统及同步方法
WO2024199464A1 (zh) 数据库系统及其数据管理方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21834339

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021834339

Country of ref document: EP

Effective date: 20230120

NENP Non-entry into the national phase

Ref country code: DE