Transaction submission method and server
By splitting the data into multiple blocks and putting it in parallel, the problem of transaction submission delay in the prior art is solved, and the transaction submission rate and system performance are improved.
Patent Information
- Application Number
- CN202411036349.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-12-06
AI Technical Summary
In the existing transaction commit mechanism, because at least one storage node needs to wait for the data to be fully loaded, the transaction commit process is delayed, which reduces the transaction commit rate, which is more obvious when processing large-scale data.
By splitting the pending data into multiple data blocks and distributing it to multiple storage nodes, each storage node drops in parallel, and only waits for the data block it is responsible for successfully dropping before the transaction is committed, and then completes after the transaction is committed. The drop-off data of the drop-off data reduces the workload and waiting time of a single storage node.
Significantly improves the transaction commit rate, reduces the waiting time, and improves system performance.
Smart Images

Figure CN119088588A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a transaction submission method and a server. Background Art
[0002] A transaction, as a user-defined sequence of operations, ensures the consistency, integrity, isolation, and persistence of data. Among them, data persistence requires that once a transaction is committed, the changes made by the transaction to the storage system should be permanently saved and should not be lost even if the system fails. Writing to disk is a key operation to ensure data persistence. Writing to disk usually refers to the process of writing data from a memory buffer or cache to a persistent storage medium (such as a hard disk). Since memory is volatile, that is, when the system is powered off or restarted, the data in the memory will be lost, so it is very necessary to write the data to a persistent storage medium such as a hard disk. Only when the data is successfully written to the disk can it be ensured that the data will not be lost even if the system encounters various failures.
[0003] In the current transaction submission mechanism, in order to ensure the continuity of data, each storage node needs to perform a full disk operation on the data involved in the transaction, and wait until at least one storage node successfully writes the data to the disk, indicating that at least one storage node has completely written the data to the storage medium, before the transaction can be submitted. During the process of fully writing data to disk, the storage node needs to continuously read the data and write it to the disk. This process involves multiple steps such as disk seek, rotation, and data transmission. It takes a long time to write the data completely to the storage medium. Especially when processing large-scale data, due to the large amount of data that needs to be written before submitting the transaction, more disk input / output operations need to be performed, which will cause the process of fully writing data to disk to take a lot of time, resulting in delays in transaction submission and reducing the transaction submission rate. Summary of the invention
[0004] The embodiments of the present application provide a transaction submission method and a server, aiming to solve the problem of low transaction submission rate.
[0005] The technical solutions provided by the embodiments of this application are as follows:
[0006] A first aspect of an embodiment of the present application provides a transaction submission method, including:
[0007] When initiating a transaction, the control node divides the data to be processed into a plurality of data blocks and sends the data to a plurality of storage nodes, wherein the transaction is used to indicate that the data to be processed is stored in the plurality of storage nodes, wherein each storage node corresponds to at least one data block;
[0008] The storage node writes the corresponding data block to the disk and sends the result of writing to the disk to the control node;
[0009] The control node performs a transaction commit operation according to the disk flushing result sent by each storage node, and the transaction commit operation is used to indicate that the transaction is completed;
[0010] The storage node stores data blocks that have not been stored on the disk among the multiple data blocks.
[0011] The method provided by the present application is that the control node splits the data to be processed into multiple data blocks and distributes them to each storage node. Each storage node persists the corresponding data blocks to the storage medium in parallel. That is, each storage node needs to write the part of the data it is responsible for to the disk, that is, return a successful signal of the disk. Compared with the traditional full disk method, it is necessary to wait for at least one storage node to complete the disk writing of all data before submission. The present application splits the data to be written into multiple data blocks, so that each storage node is responsible for a part of the data before the transaction is submitted. After the transaction is submitted, the storage node writes the data that has not been written to the disk, which reduces the workload of a single storage node before the transaction is submitted, and reduces the processing time of a single storage node for the data to be processed before the transaction is submitted. Thus, the waiting time during the transaction submission process is shortened, and the transaction submission rate is significantly improved.
[0012] In a possible implementation, dividing the to-be-processed data into a plurality of data blocks and sending the data blocks to a plurality of storage nodes includes:
[0013] The control node divides the received data to be processed into multiple data blocks based on the number of storage nodes, and sends each data block to the corresponding storage node.
[0014] In a possible implementation, dividing the to-be-processed data into a plurality of data blocks and sending the data blocks to a plurality of storage nodes includes:
[0015] The control node divides the received data to be processed into multiple data blocks based on the number of storage nodes, and sends the multiple data blocks to each storage node respectively;
[0016] The storage node writes the corresponding data block to the disk and sends the result of writing to the disk to the control node, including:
[0017] The storage node stores data blocks corresponding to itself among the multiple data blocks on disk.
[0018] In a possible implementation, the method further includes:
[0019] When the storage node fails to write to disk, the control node performs a transaction rollback operation, where the transaction rollback operation is used to undo the executed operation and return to the state before the transaction started;
[0020] When restarting the transaction, the control node sends the multiple data blocks of the to-be-processed data to the storage nodes in the available state respectively;
[0021] The storage node in the available state stores all the data blocks of the to-be-processed data on disk, and sends the storage result to the control node;
[0022] When each storage node in an available state has successfully written data to disk, the control node executes a transaction commit operation.
[0023] In a possible implementation, the multiple storage nodes include a first storage node and a second storage node, and the method further includes:
[0024] When the first storage node recovers to an available state after a failure, reading sequence values of other storage nodes in the plurality of storage nodes that are in an available state;
[0025] The first storage node obtains the data blocks between the current sequence value of the second storage node and the sequence value of the first storage node, and writes the data blocks between the current sequence value of the second storage node and the sequence value of the first storage node to disk, the second storage node is the storage node with the largest sequence value among the multiple storage nodes, and the sequence value is the largest sequence number in the continuous data blocks that the storage node has written to disk.
[0026] A second aspect of an embodiment of the present application provides a transaction submission method, including:
[0027] The primary storage node divides the to-be-processed data into a plurality of data blocks when initiating a transaction, wherein the transaction is used to indicate that the to-be-processed data is stored in a plurality of storage nodes, wherein the plurality of storage nodes include the primary storage node and at least one backup storage node, and each storage node corresponds to at least one data block;
[0028] The primary storage node stores the corresponding data blocks on disk, and sends the multiple data blocks to the backup storage node;
[0029] The standby storage node writes the corresponding data block to the disk, and sends the result of writing to the disk to the control node;
[0030] The primary storage node performs a transaction commit operation according to the disk-storage result of each storage node, and the transaction commit operation is used to indicate that the transaction is executed;
[0031] The storage node stores data blocks that have not been stored on the disk among the multiple data blocks.
[0032] The method provided by the present application is that the main storage node splits the data to be processed into multiple data blocks, the main storage node writes the corresponding data blocks to the disk, and sends the multiple data blocks to the backup storage node. Each backup storage node persists the corresponding data blocks to the storage medium in parallel. That is, each storage node needs to write the part of the data it is responsible for to the disk, and then return a successful signal of the disk to the main storage node. Compared with the traditional full disk method, it is necessary to wait for at least one storage node to complete the disk before submitting all the data. The present application splits the data to be written into multiple data blocks, so that each storage node is responsible for a part of the data before the transaction is submitted. After the transaction is submitted, the storage node writes the data that has not been written to the disk, which reduces the workload of a single storage node before the transaction is submitted, and reduces the processing time of a single storage node for the data to be processed before the transaction is submitted. Thus, the waiting time during the transaction submission process is shortened, and the transaction submission rate is significantly improved.
[0033] In a possible implementation manner, sending the multiple data blocks to the backup storage node includes:
[0034] The primary storage node sends each data block to the corresponding backup storage node.
[0035] In a possible implementation manner, sending the multiple data blocks to the backup storage node includes:
[0036] The primary storage node sends the multiple data blocks to each backup storage node respectively;
[0037] The standby storage node stores the corresponding data blocks on disk, including:
[0038] The standby storage node stores data blocks corresponding to itself among the multiple data blocks on disk.
[0039] In a possible implementation, the method further includes:
[0040] When the standby storage node fails to write to disk, the primary storage node performs a transaction rollback operation, where the transaction rollback operation is used to undo the executed operation and return to the state before the transaction started;
[0041] When the transaction is restarted, the primary storage node writes the multiple data blocks of the to-be-processed data to a disk, and sends the multiple data blocks of the to-be-processed data to a backup storage node in an available state;
[0042] The standby storage node in an available state stores all the data blocks of the to-be-processed data on disk, and sends the storage result to the primary storage node;
[0043] When each storage node in an available state has successfully written data to disk, the primary storage node performs a transaction commit operation.
[0044] A third aspect of an embodiment of the present application provides a server, including a processor and a memory, wherein the processor and the memory are connected, wherein the memory is used to store a computer program, and the computer program includes program instructions, and the processor is configured to call the program instructions to execute the transaction submission method as described in the first aspect or the second aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 A schematic diagram of a symmetric multi-copy architecture provided in an embodiment of the present application;
[0047] Figure 2 A schematic diagram of the master-slave architecture provided in an embodiment of the present application;
[0048] Figure 3 A schematic diagram of the first transaction submission process provided in an embodiment of the present application;
[0049] Figure 4 A schematic diagram of the second transaction submission process provided in an embodiment of the present application;
[0050] Figure 5A A schematic diagram of the first data block allocation under the symmetric multi-copy architecture provided in an embodiment of the present application;
[0051] Figure 5B A schematic diagram of the second data block allocation under the symmetric multi-copy architecture provided in an embodiment of the present application;
[0052] Figure 6 A schematic diagram of the third transaction submission process provided in an embodiment of the present application;
[0053] Figure 7 A schematic diagram of the fourth transaction submission process provided in an embodiment of the present application;
[0054] Fig. 8A A schematic diagram of the first data block allocation under the symmetric multi-copy architecture provided in an embodiment of the present application;
[0055] Figure 8B A schematic diagram of the second data block allocation under the symmetric multi-copy architecture provided in an embodiment of the present application;
[0056] Fig. 9A A schematic diagram of the fifth transaction submission process provided in the embodiment of the present application;
[0057] Fig. 9B A schematic diagram of the sixth transaction submission process provided in an embodiment of the present application;
[0058] Fig. 10A A seventh transaction submission process diagram provided in an embodiment of the present application;
[0059] Fig. 10B A schematic diagram of the eighth transaction submission process provided in the embodiment of the present application;
[0060] Fig.11A A schematic diagram of a transaction submission process when a node fails in a symmetric multi-copy architecture provided in an embodiment of the present application;
[0061] Fig. 11B A schematic diagram of a transaction submission process when a node fails in a master-slave architecture provided in an embodiment of the present application;
[0062] Fig.12 A schematic diagram of the transaction submission process when recovering from a node failure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] It should be noted that the embodiments described in this application are only part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0064] In order to make the following embodiments clear, the technical terms involved in this application are first introduced.
[0065] Disk input / output (I / O) operations mainly involve reading and writing data to disk. In a computer system, whether it is the CPU, memory or other components, they all need to interact with the disk through I / O operations.
[0066] A transaction is a unit of concurrency control and a sequence of operations defined by the user. The operations in a transaction are either all completed or not completed. It is an indivisible unit of work. The main purpose of a transaction is to ensure the integrity and consistency of data and to provide a mechanism for isolation and protection when multiple applications, processes, or threads access the database concurrently. Transactions have four characteristics: atomicity, consistency, isolation, and persistence.
[0067] Distributed storage software is a software system that implements decentralized storage, management, and access of data on multiple independent physical or virtual storage devices. Its core function is to divide data into multiple parts and store them on different nodes in the network to achieve redundant storage, load balancing, high availability, and scalability of data.
[0068] A distributed database (DDB) is a database system architecture in which data is stored in multiple physical nodes. These nodes are connected through a network and can work together to provide services such as data storage, query, update, and management. Each node has the ability to process data independently and can execute local applications. It can also collaborate with other nodes through the network communication subsystem to execute global applications. The storage engine of a distributed database is the core component of the database management system. It is responsible for operations such as data storage, retrieval, update, and deletion to ensure data consistency and integrity. In a distributed database system, the storage engine needs to take into account the distributed storage, load balancing, high availability, and scalability of data.
[0069] Distributed storage software or storage engines of distributed databases generally use multiple copies for data redundancy to resist software and hardware failures. In the following text, the term "distributed storage system" refers to distributed storage software, storage engines of distributed databases, and other storage systems. Symmetric multi-copy architecture is a common architectural design in distributed storage systems. It improves system reliability and fault tolerance by storing the same data copies on multiple nodes. Figure 1 As shown, Figure 1 A schematic diagram of a symmetric multi-copy architecture provided in an embodiment of the present application. For example, the symmetric multi-copy architecture may include three storage nodes. Figure 1 Storage Node 0, Storage Node 1, and Storage Node 2 are shown in the figure. In a symmetric multi-copy architecture, the number of replicas N is first set, which means that the data will be copied to N different storage nodes. The synchronization coefficient M is a key parameter that determines how many storage nodes the transaction can be committed after successfully writing data or write-ahead logs (WAL). For example, the synchronization coefficient M = 2, which means that the transaction can be committed after successfully writing data or write-ahead logs on two storage nodes. The distributed storage system recognizes that the client has initiated a write operation, that is, when a write operation is required, the control node starts a transaction. The computing node then sends the data to be written or the write-ahead log to all N replicas.
[0070] In another distributed storage system architecture design, the master-slave architecture is mainly composed of master storage nodes and backup nodes. Figure 2 As shown, Figure 2A schematic diagram of a master-slave architecture provided in an embodiment of the present application, wherein the master-slave architecture may include a master storage node and two slave storage nodes. In the master-slave architecture, the number of replicas N and the synchronization coefficient M are first set. When a write operation is performed, the master storage node initiates a transaction. The master storage node then sends the data to be written or the pre-write log to all slave nodes.
[0071] A transaction submission method provided by an embodiment of the present application. The control node splits the data to be processed into multiple data blocks and distributes them to each storage node. Each storage node performs a write operation respectively, and persists the data blocks it is responsible for in parallel to the storage medium. That is, the storage node will write the part of the data it is responsible for to the disk, and then return a successful signal of the disk. Compared with the traditional full-volume disk method, it is necessary to wait for at least one storage node to complete the disk writing of all data before submitting the transaction. The embodiment of the present application splits the data to be written into multiple data blocks, so that each storage node is responsible for writing a part of the data blocks to the disk before the transaction is submitted. After the transaction is submitted, the storage node writes the data that has not been written to the disk to the disk, which speeds up the transaction submission. As a result, the processing time of the storage node for the data to be written before submitting the transaction is reduced, thereby reducing the waiting time for the transaction submission and significantly improving the transaction submission rate.
[0072] The following describes the process of interaction between the control node and multiple storage nodes in a multi-copy architecture. Figure 3 ,Should Figure 3 The first transaction submission process diagram provided in the embodiment of the present application. Figure 3 As shown, the transaction submission method includes:
[0073] S101: When initiating a transaction, the control node divides the data to be processed into multiple data blocks and sends the data blocks to multiple storage nodes.
[0074] The transaction is used to indicate that the data to be processed is stored in the multiple storage nodes, wherein each storage node corresponds to at least one data block.
[0075] When a client needs to write data to a distributed storage system, the client initiates a write operation request, which contains the data to be processed, which can be at least one of a pre-write log or data to be written. The control node receives the write operation request from the client and starts a transaction corresponding to the write operation request, the goal of which is to write the data to disk. The control node is responsible for receiving and coordinating write operations, and acts as a coordinator in the distributed storage system.
[0076] The control node obtains the data to be processed in the write operation request, and divides the data to be processed to obtain multiple data blocks for allocation to multiple storage nodes. According to the actual situation, the data to be processed can be divided according to a preset division strategy, or according to the characteristics and data type of the data to be processed, or evenly divided according to the amount of data, etc. The division strategy of the data to be processed is not limited here.
[0077] After the control node obtains multiple data blocks, it can use a strategy or algorithm to determine which data blocks each storage node should receive, and it needs to ensure that the number of data blocks that each storage node is responsible for storing on disk is reasonable and balanced.
[0078] In a possible implementation, the number of data blocks allocated to each node may be determined according to the synchronization coefficient and the number of storage nodes to be executed. Figure 4 As shown, Figure 4 The second transaction submission process diagram provided for the embodiment of the present application includes steps S41 to S44. When the client initiates a write operation, the control node is responsible for coordinating and ensuring that the data is stored on all relevant nodes. In this scenario, there are N storage nodes participating in the write operation, and each storage node stores the data to be processed in the ratio of M / N. Among them, N is the total number of data blocks obtained by dividing the data to be processed, and M is the synchronization coefficient in the distributed storage system, which is also the number of data blocks that each storage node is responsible for storing.
[0079] For example, Figure 5A As shown, Figure 5A The first data block allocation diagram under the symmetric multi-copy architecture provided in the embodiment of the present application, M=1, N=3, the control node divides the data to be processed provided by the client into 3 parts, namely data block 0, data block 1 and data block 2, and the three storage nodes are responsible for processing one-third of the data to be processed, that is, each storage node is responsible for storing 1 data block. After each storage node has successfully stored the data on the disk, each storage node sends each other the data blocks it has stored on the disk, so that each storage node has all the data blocks of the data to be processed, such as Figure 5A Storage node 0 writes data blocks 1 and 2 to disk, storage node 1 writes data blocks 0 and 2 to disk, and storage node 2 writes data blocks 0 and 1 to disk.
[0080] like Figure 5B , Figure 5BThe second data block allocation diagram under the symmetric multi-copy architecture provided in the embodiment of the present application, M=2, N=3, the control node divides the data to be processed provided by the client into three parts, namely data block 0, data block 1 and data block 2, and the three storage nodes are responsible for processing two-thirds of the data to be processed, that is, each storage node is responsible for storing 2 data blocks. Therefore, the number of data blocks that each storage node needs to process is the synchronization coefficient. After each storage node has successfully stored data on the disk, each storage node sends each other the data blocks it has stored on the disk, so that each storage node has all the data blocks of the data to be processed, such as Figure 5B Storage node 1 writes data block 2 to disk, and storage node 1 and storage node 3 write data block 0 and data block 1 to disk respectively.
[0081] In a possible implementation, after dividing the data to be processed into multiple data blocks, the control node may adopt a strategy or algorithm to determine which data blocks each storage node should receive, so as to ensure that the data can be evenly and effectively distributed to each storage node.
[0082] In a possible implementation, the control node may allocate data blocks in sequence according to the order of the storage nodes, and move to the next storage node after allocating a data block each time until all data blocks are allocated.
[0083] In another possible implementation, the control node can evenly divide the data to be processed to obtain several data blocks of the same size, thereby ensuring that the data to be processed can be evenly distributed to each storage node, achieving load balancing. Conversely, the control node may not evenly divide the data to be processed. If the sizes of the data blocks in the prepared data block set are inconsistent, the control node also needs to consider the size of the data blocks when allocating data blocks. In order to prevent some nodes from being overloaded due to receiving a large number of large data blocks, the control node can give priority to allocating large data blocks to nodes with larger capacity or better performance.
[0084] In another possible implementation, the control node may allocate data blocks considering factors such as network bandwidth and delay. For example, data blocks may be preferentially allocated to storage nodes with larger network bandwidth or lower delay to improve the efficiency and reliability of data transmission.
[0085] In a possible implementation, the control node may perform a modulo operation based on the synchronization coefficient, the number of storage nodes, and the storage node sequence number to obtain a data block corresponding to each storage node.
[0086] A distribution function j=F(i) can be predetermined. The function of the distribution function j=F(i) is to map the storage node i to the starting data block index j that it should be responsible for, that is, the starting data block index that the storage node i is responsible for is j. When the input domain is {0, ..., n-1}, the value range is the full permutation of the input domain, that is, each node has a corresponding starting data block index. In actual application scenarios, F(i)=i can be set, that is, node i is responsible for the data starting from data block i.
[0087] Then, according to the mapping algorithm G, the set of data blocks that each storage node is responsible for is determined, i is the serial number of the storage node, m is the synchronization coefficient, n is the number of copies, j = F(i), G(i, m, n) is the set of data blocks that storage node i is responsible for, then G(i, m, n) = {D(j%n), ..., D((j+m)%n)}. That is, use the distribution function F(i) to find the starting data block index j that node i is responsible for. Perform a modulus operation % based on j, m and n to calculate the set of data blocks that storage node i should be responsible for. The set of data blocks that node i is responsible for is from D(j%n) to D((j+m-1)%n) (including the starting and ending data blocks).
[0088] Exemplarily, set F(1)=1, that is, the subscript of the starting data block that storage node 1 is responsible for is 1, m=1, that is, the synchronization coefficient is 1, which means that each node is responsible for one data block, n=3: the number of copies is 3, indicating that there are 3 copies of the data block, and use the mapping algorithm to calculate G(1,1,3), j=F(1)=1, G(1,1,3)={D(1%3),...,D((1+1-1)%3)}, G(1,1,3)={D1,...,D1} (because the result of the modulus operation is still 1), G(1,1,3)={D1} (there is a data block in the range). Therefore, the data block that storage node 1 needs to write to the disk is data block D1.
[0089] In some implementation scenarios, after determining the storage node corresponding to each data block, there are two example implementation methods for allocating multiple data blocks:
[0090] In the first exemplary allocation method, multiple data blocks are sent to each storage node respectively.
[0091] After the control node obtains multiple data blocks based on the number of storage nodes, it sends the multiple data blocks obtained by the division to each storage node. For example, when the number of storage nodes is 3, the control node divides the data to be processed into three parts, each of which is represented by data block D0, data block D1 and data block D2. At this time, the multiple data blocks include the above three data blocks, and the control node subsequently sends the above three data blocks to each storage node respectively, that is, sends data blocks D0, D1, and D2 to storage node 0, sends data blocks D0, D1, and D2 to storage node 1, and sends data blocks D0, D1, and D2 to storage node 2.
[0092] In the second exemplary allocation method, each data block is sent to a corresponding storage node.
[0093] When the control node receives the data to be processed, it first divides the data into multiple data blocks. Each data block is a part of the data to be processed, and they together constitute the complete data to be processed. Then, the control node sends each data block to the corresponding storage node based on the correspondence between each storage node and the data block that the storage node is responsible for performing the disk operation.
[0094] For example, when the number of storage nodes is 3, the control node divides the data to be processed into three parts, each of which is represented by data block D0, data block D1 and data block D2. At this time, the multiple data blocks include three data blocks. The control node then sends each data block to the corresponding storage node according to the data block that each storage node is responsible for storing on the disk. For example, when the first storage node is responsible for processing data block D0, the second storage node is responsible for processing data block D1, and the third storage node is responsible for processing data block D2, the data block sent by the control node to the first storage node is D0, the data block sent by the control node to the second storage node is D1, and the data block sent by the control node to the third storage node is D2.
[0095] S102: The storage node writes the corresponding data block to the disk, and sends the result of the writing to the control node.
[0096] Each storage node writes to disk the data blocks that it is responsible for writing to disk among the multiple data blocks of the data to be processed.
[0097] In a distributed storage system, storage nodes are responsible for storing and processing data blocks. When a storage node receives a data block, it can check whether the data blocks have a corresponding relationship with itself, and perform disk operations on the data blocks that have a corresponding relationship. For example, when the target data block that storage node 0 is responsible for storing is D0, storage node 0 stores data block D0 on disk. Similarly, storage node 1 stores data block D1 on disk, and storage node 2 stores data block D2 on disk.
[0098] For the allocation method of the first example above, the control node sends multiple data blocks to each storage node respectively. When each storage node receives the data block, the storage node performs the corresponding disk placement operation. The storage node can store data block D0 among data blocks D0 to D2, which is responsible for performing the disk placement. When the disk placement is successful, each node returns a message to the control node to indicate that the current storage node has successfully placed the data on the disk, that is, a disk placement success signal. Storage node 1 and storage node 2 will also perform the same processing, and perform disk placement operations on D1 and D2 among the received data blocks D0 to D2, respectively, and send the relevant disk placement success signals to the control node.
[0099] For the second exemplary allocation method, the control node sends data block D0 to storage node 0 , sends data block D1 to storage node 1 , and sends data block D2 to storage node 2 .
[0100] After each storage node receives the data block, it can perform the corresponding disk write operation. Storage node 0 can write the received data block D0 to disk. When the disk write is successful, each node returns a message to the control node to indicate that the current storage node has successfully written to disk. Storage node 1 and storage node 2 can also write the allocated data block D1 and data block D2 to disk, and send relevant confirmation messages to the control node.
[0101] S103: The control node performs a transaction commit operation according to the disk flushing result sent by each storage node.
[0102] When receiving the disk-storage success signal returned by each storage node, the control node commits the currently executed transaction. The transaction commit operation is used to indicate that the transaction has been executed.
[0103] The process may involve changing the status of the transaction from "in progress" to "committed". And the control node may generate a message indicating that the current write operation is successfully executed and feedback it to the client. This message may contain detailed information about the write operation, such as success status, number of data blocks written, timestamp, etc.
[0104] In a possible implementation, the control node can count the number of confirmation messages received and compare it with the expected number of messages. If all storage nodes return a successful signal of disk placement and there is no error report, the control node can consider that the write operation of the current transaction has been successfully completed in each storage node.
[0105] S104: The storage node writes data blocks that have not been written to the disk among the multiple data blocks to the disk.
[0106] When the control node receives the successful signal from all storage nodes, it can confirm that the entire write operation has been successfully completed on all nodes. At this time, the control node can instruct the storage nodes to copy and distribute the data blocks to ensure that each storage node has the same data blocks. In this way, even if some nodes fail or data is lost, data can still be recovered from other nodes, improving the reliability and fault tolerance of the system.
[0107] For the first data block allocation method, multiple data blocks are sent to each storage node separately, and the corresponding data blocks are first written to the disk. After the transaction is committed, the storage node will write the data blocks that have not been written to the disk among the multiple allocated data blocks, without the need for synchronization from other storage nodes.
[0108] For the second data block allocation method, each data block is sent to the corresponding storage node. After the transaction is committed, the data blocks are replicated and distributed between the storage nodes. The storage node obtains the data blocks that have not been written to the disk from other nodes and writes them to the disk.
[0109] In a possible implementation, each storage node can check the data blocks that have been written to the disk in the local storage and ensure the integrity and correctness of these data blocks. Then, each storage node can generate synchronization requests respectively and send these requests to other storage nodes to be synchronized. The storage nodes to be synchronized serve as receiving nodes for synchronization requests.
[0110] After the synchronization request is sent, the sending node waits for confirmation from the receiving node. After receiving the synchronization request, the receiving node verifies the legitimacy of the synchronization request and prepares to receive the data block. Once the verification is passed, the receiving node sends a confirmation message to the sending node that it is ready to receive. Subsequently, the sending node begins to transmit the data block to the receiving node. This process can be carried out over the network, and protocols such as TCP / IP may be used to ensure reliable data transmission. During the transmission process, the sending node may use data verification, compression, encryption and other technologies to ensure the integrity and security of the data.
[0111] After receiving the data block, the receiving node performs checksum verification to ensure the integrity and correctness of the data. If the data verification passes, the receiving node will write the data block to the local storage and update its internal data block status. At the same time, the receiving node sends a confirmation message to the sending node, indicating that the data has been successfully received and synchronized.
[0112] The above-mentioned replication and distribution of the data blocks that have been stored on the disk is the process of filling or optimizing the unused free space (i.e., holes) on the storage node. In the application scenario, a sequence value Pi can be set for each storage node. The sequence value is the maximum sequence number among the continuous data blocks that have been stored on the storage node. That is, this sequence value indicates that the data with sequence numbers less than or equal to Pi have been successfully synchronized, and there are no holes in the storage of these data. This mechanism helps to ensure the integrity and consistency of data and optimize the data synchronization and access process.
[0113] Exemplarily, when storage node 1 has stored data block 1, data block 2, data block 3, and data block 5, the sequence value P1 of storage node 1 is 3. When storage node 2 has stored data block 1, data block 2, data block 3, data block 4, and data block 5, the sequence value P2 of storage node 2 is 5.
[0114] Specifically, Pi on each storage node i represents that the node has completed synchronization for all data blocks with sequence numbers less than or equal to Pi, and node i has a complete and continuous copy without any data holes. By maintaining such a Pi value, it can be ensured that on node i, data blocks with sequence numbers less than or equal to Pi have been successfully stored on the disk, that is, the system needs to pay attention to those data blocks with sequence numbers greater than Pi, which helps to simplify the process of data synchronization and consistency checking. By maintaining such a Pi sequence value mechanism, the distributed storage system can more effectively monitor the data synchronization and storage process, reduce the possibility of data holes, and improve the performance and reliability of the entire system.
[0115] In summary, this embodiment has the following beneficial effects:
[0116] The distributed disk-storage method distributes the pending data that needs to be written to disk for transaction submission to multiple nodes. Each node only needs to write a part of the pending data to disk before the transaction is submitted, which effectively reduces the burden on a single node before the transaction is submitted, and greatly reduces the amount of disk input / output operations that a single node needs to perform before the transaction is submitted. This means that the disk-storage operation can be completed more quickly, thereby reducing the delay of transaction submission and improving the overall performance of the system.
[0117] In the full disk placement mechanism, the disk placement strategy within a single transaction is still serial. If some nodes complete the data persistence operation in advance, but the control node needs to wait for all storage nodes to complete the disk placement, the control node will be in a waiting state for a long time. When the partial disk placement method provided in the embodiment of the present application is adopted, once the node completes the task that the node is responsible for, it can return a successful disk placement signal, thereby speeding up the transaction submission. After the transaction is submitted, the storage node will write the data that has not been placed on the disk among the data to be written, and the control node can execute subsequent tasks in advance without waiting for the storage node to place all the data on the disk.
[0118] The following describes the process of interaction between the primary storage node and the backup storage node in the primary-backup architecture. Figure 6 ,Should Figure 6 The third transaction submission process diagram provided in the embodiment of the present application. Figure 6 As shown, the transaction submission method includes:
[0119] S201. When initiating a transaction, the primary storage node divides the data to be processed into multiple data blocks.
[0120] The transaction is used to indicate that the data to be processed is stored in a plurality of storage nodes, the plurality of storage nodes include the primary storage node and at least one backup storage node, and each storage node corresponds to at least one data block.
[0121] When a client needs to write data to a distributed storage system, the client initiates a write operation request, which contains the data to be processed, which can be at least one of a pre-write log or data to be written. The primary storage node receives the write operation request from the client and starts a transaction corresponding to the write operation request, the goal of which is to write the data to disk. The primary storage node is responsible for receiving and coordinating write operations, and acts as a coordinator in the distributed storage system.
[0122] The main storage node obtains the data to be processed in the write operation request, and divides the data to be processed to obtain multiple data blocks for allocation to multiple storage nodes. According to the actual situation, the data to be processed can be divided according to a preset division strategy, or according to the characteristics and data type of the data to be processed, or evenly divided according to the amount of data, etc. The division strategy of the data to be processed is not limited here.
[0123] After the main storage node has divided the data into multiple blocks, it can use a strategy or algorithm to determine which data blocks each storage node should receive, and it needs to ensure that the number of data blocks that each storage node is responsible for storing on disk is reasonable and balanced.
[0124] In a possible implementation, the number of data blocks allocated to each storage node may be determined according to the synchronization coefficient and the number of storage nodes to be executed. Figure 7 As shown, Figure 7The fourth transaction submission process diagram provided for the embodiment of the present application includes steps S21 to S23. When the client initiates a write operation, the primary storage node is responsible for coordinating and ensuring that the data is stored on all relevant nodes. In this scenario, there are N storage nodes involved in the write operation, including the primary storage node and N-1 backup storage nodes. Each storage node stores the data to be processed in the ratio of M / N. Among them, N is the total number of data blocks obtained by dividing the data to be processed, and M is the synchronization coefficient in the distributed storage system, which is also the number of data blocks that each storage node is responsible for storing.
[0125] For example, Fig. 8A As shown, Fig. 8A The first data block allocation diagram under the symmetric multi-copy architecture provided in the embodiment of the present application, M=1, N=3, the main storage node divides the data to be processed provided by the client into three parts, namely data block 0, data block 1 and data block 2, and the three storage nodes are responsible for processing one-third of the data to be processed, that is, each storage node is responsible for storing one data block. After each storage node has successfully stored the data, each storage node stores the data blocks that have not been stored in the database blocks corresponding to the data to be processed, so that each storage node has all the data blocks of the data to be processed, such as Fig. 8A The primary storage node writes data blocks 1 and 2 to disk, the backup storage node 1 writes data blocks 0 and 2 to disk, and the backup storage node 2 writes data blocks 0 and 1 to disk.
[0126] like Figure 8B , Figure 8B The second data block allocation diagram under the symmetric multi-copy architecture provided in the embodiment of the present application, M=2, N=3, the main storage node divides the data to be processed provided by the client into three parts, namely data block 0, data block 1 and data block 2, and the three storage nodes are responsible for processing two-thirds of the data to be processed, that is, each storage node is responsible for storing 2 data blocks. Therefore, the number of data blocks that each storage node needs to process is the synchronization coefficient. After each storage node has successfully stored data on the disk and the transaction is committed, each storage node will store the data blocks in the database blocks corresponding to the data to be processed that have not been stored on the disk, so that each storage node has all the data blocks of the data to be processed, such as Figure 8B Storage node 1 writes data block 2 to disk, and storage node 1 and storage node 3 write data block 0 and data block 1 to disk respectively.
[0127] S202: The primary storage node stores corresponding data blocks on disk, and sends the multiple data blocks to the backup storage node.
[0128] In a possible implementation, after dividing the data to be processed into multiple data blocks, the main storage node may adopt a strategy or algorithm to determine which data blocks each storage node should receive, so as to ensure that the data can be evenly and effectively distributed to each storage node.
[0129] In a possible implementation, the primary storage node may allocate data blocks in order of the storage nodes, and move to the next storage node after allocating a data block each time until all data blocks are allocated.
[0130] In another possible implementation, the main storage node can evenly divide the data to be processed to obtain several data blocks of the same size, thereby ensuring that the data to be processed can be evenly distributed to each storage node, achieving load balancing. Conversely, the main storage node may not evenly divide the data to be processed. If the data block sizes of the data to be processed are inconsistent, the main storage node also needs to consider the size of the data block when allocating the data block. In order to prevent some nodes from being overloaded due to receiving a large number of large data blocks, the main storage node can give priority to allocating large data blocks to nodes with larger capacity or better performance.
[0131] In another possible implementation, the primary storage node may allocate data blocks considering factors such as network bandwidth and latency, for example, data blocks may be preferentially allocated to storage nodes with larger network bandwidth or lower latency to improve the efficiency and reliability of data transmission.
[0132] In a possible implementation, the master storage node may perform a modulo operation based on the synchronization coefficient, the number of storage nodes, and the storage node sequence number to obtain a data block corresponding to each storage node.
[0133] A distribution function j=F(i) can be predetermined. The function of the distribution function j=F(i) is to map the storage node i to the starting data block index j that it should be responsible for, that is, the starting data block index that the storage node i is responsible for is j. When the input domain is {0, ..., n-1}, the value range is the full permutation of the input domain, that is, each node has a corresponding starting data block index. In actual application scenarios, F(i)=i can be set, that is, node i is responsible for the data starting from data block i.
[0134] Then, according to the mapping algorithm G, the set of data blocks that each storage node is responsible for is determined, i is the serial number of the storage node, m is the synchronization coefficient, n is the number of copies, j = F(i), G(i, m, n) is the set of data blocks that storage node i is responsible for, then G(i, m, n) = {D(j%n), ..., D((j+m)%n)}. That is, use the distribution function F(i) to find the starting data block index j that node i is responsible for. Perform a modulus operation % based on j, m and n to calculate the set of data blocks that storage node i should be responsible for. The set of data blocks that node i is responsible for is from D(j%n) to D((j+m-1)%n) (including the starting and ending data blocks).
[0135] Exemplarily, set F(1)=1, that is, the subscript of the starting data block that storage node 1 is responsible for is 1, m=1, that is, the synchronization coefficient is 1, which means that each node is responsible for one data block, n=3: the number of copies is 3, indicating that there are 3 copies of the data block, and use the mapping algorithm to calculate G(1,1,3), j=F(1)=1, G(1,1,3)={D(1%3),...,D((1+1-1)%3)}, G(1,1,3)={D1,...,D1} (because the result of the modulus operation is still 1), G(1,1,3)={D1} (there is a data block in the range). Therefore, the data block that storage node 1 needs to write to the disk is data block D1.
[0136] In some implementation scenarios, after determining the storage node corresponding to each data block, there are two example implementation methods for allocating multiple data blocks:
[0137] In the first exemplary allocation method, the primary storage node stores the corresponding data blocks on disk and sends multiple data blocks to each backup storage node respectively.
[0138] For example, when the number of storage nodes is 3, the main storage node divides the data to be processed into three parts, each of which can be represented as data block D0, data block D1 and data block D2. At this time, the multiple data blocks include the above three data blocks, and the main storage node writes the corresponding data blocks to the disk and sends the above three data blocks to each backup storage node, that is, sends data blocks D0, D1, and D2 to backup storage node 1, and sends data blocks D0, D1, and D2 to backup storage node 2.
[0139] In the second exemplary allocation method, the primary storage node stores the corresponding data blocks on disk and sends each data block to the corresponding storage node.
[0140] When the main storage node receives the data to be processed, it first divides the data into multiple data blocks. Each data block is a part of the data to be processed, and they together constitute the complete data to be processed. Then, the main storage node writes the corresponding data block to the disk, and sends each data block to the corresponding storage node based on the corresponding relationship between each storage node and the data block that the storage node needs to be responsible for writing to the disk.
[0141] For example, when the number of storage nodes is 3, the main storage node divides the data to be processed into three parts, each of which is represented by data block D0, data block D1 and data block D2. At this time, the multiple data blocks include three data blocks. The main storage node then sends each data block to the corresponding backup storage node according to the data blocks that each backup storage node is responsible for storing on disk. For example, when the main storage node is responsible for processing data block D0, backup storage node 1 is responsible for processing data block D1, and backup storage node 2 is responsible for processing data block D2, the main storage node stores data block D0 on disk, sends data block D1 to backup storage node 1, and sends data block D2 to backup storage node 2.
[0142] S203: The standby storage node writes the corresponding data block to disk, and sends the result of writing to disk to the primary storage node.
[0143] Each storage node writes to disk the data blocks that it is responsible for writing to disk among the multiple data blocks to be processed. In a distributed storage system, storage nodes are responsible for storing and processing data blocks. When a storage node receives a data block, it can check whether the received data block corresponds to itself and write the corresponding data block to disk.
[0144] For the first example of allocation, the primary storage node writes the corresponding data block to disk and sends multiple data blocks to each backup storage node. After each backup storage node receives the data block, it writes the corresponding data block to disk. Fig. 8A In the example, the backup storage node 1 can store the data block D1 that is responsible for the storage of received data blocks D0 to D2. Correspondingly, the backup storage node 2 can store the data block D2 that is responsible for the storage of received data blocks D0 to D2. When the storage is successful, each backup storage node returns a message to the primary storage node indicating that the storage has been successfully stored in the current backup storage node, i.e., a storage success signal.
[0145] For the allocation method of the second example above, the primary storage node writes the corresponding data block D0 to the disk, and sends the data block D1 to the backup storage node 1, and sends the data block D2 to the backup storage node 2. When each backup storage node receives the corresponding data block, the backup storage node can write the received data block to the disk. The primary storage node can write the received data block D0 to the disk. When the disk is successfully written, each backup storage node returns a message to the primary storage node to indicate that the current backup storage node has successfully written to the disk. Storage node 1 and storage node 2 can also write the allocated data block D1 and data block D2 to the disk, and send the relevant disk success signal to the primary storage node.
[0146] S204: The primary storage node performs a transaction commit operation according to the disk flushing result of each storage node.
[0147] The transaction commit operation is used to indicate that the transaction has been executed. When the primary storage node receives the disk-success signal returned by each backup storage node and the primary storage node has successfully written the corresponding data block to the disk, the currently executed transaction is committed. The transaction commit operation is used to indicate that the transaction has been executed.
[0148] The process may involve changing the status of the transaction from "in progress" to "committed". And the primary storage node may generate a message indicating that the current write operation is successfully executed and feedback it to the client. This message may contain detailed information about the write operation, such as success status, number of data blocks written, timestamp, etc.
[0149] In a possible implementation, the primary storage node can count the number of confirmation messages received and compare it with the expected number of messages. If all backup storage nodes return a successful disk placement signal, and the primary storage node has successfully placed the corresponding data block on disk, and there is no error report during the transaction write operation, then the primary storage node can assume that the write operation of the current transaction has been successfully completed in each storage node.
[0150] S205. The storage node writes data blocks that have not been written to the disk among the multiple data blocks to the disk.
[0151] When the master storage node receives the successful write signal from all storage nodes, it can confirm that the entire write operation has been successfully completed on all nodes. At this time, the storage node can write the data blocks that have not been written to the disk among the multiple data blocks to ensure that each storage node has the same data blocks. In this way, even if some nodes fail or data is lost, data can still be recovered from other nodes, improving the reliability and fault tolerance of the system.
[0152] For the first data block allocation method, multiple data blocks are sent to each storage node separately, and the corresponding data blocks are first written to the disk. After the transaction is committed, the storage node will write the data blocks that have not been written to the disk among the multiple allocated data blocks, without the need for synchronization from other storage nodes.
[0153] For the second data block allocation method, each data block is sent to the corresponding storage node. After the transaction is committed, the data blocks are replicated and distributed between the storage nodes. The storage node obtains the data blocks that have not been written to the disk from other storage nodes and writes them to the disk.
[0154] In a possible implementation, each storage node can check the data blocks that have been written to the disk in the local storage and ensure the integrity and correctness of these data blocks. Then, each storage node can generate synchronization requests respectively and send these requests to other storage nodes to be synchronized. The storage nodes to be synchronized serve as receiving nodes for synchronization requests.
[0155] After the synchronization request is sent, the sending node waits for confirmation from the receiving node. After receiving the synchronization request, the receiving node verifies the legitimacy of the synchronization request and prepares to receive the data block. Once the verification is passed, the receiving node sends a confirmation message to the sending node that it is ready to receive. Subsequently, the sending node begins to transmit the data block to the receiving node. This process can be carried out over the network, and protocols such as TCP / IP may be used to ensure reliable data transmission. During the transmission process, the sending node may use data verification, compression, encryption and other technologies to ensure the integrity and security of the data.
[0156] After receiving the data block, the receiving node performs checksum verification to ensure the integrity and correctness of the data. If the data verification passes, the receiving node will write the data block to the local storage and update its internal data block status. At the same time, the receiving node sends a confirmation message to the sending node, indicating that the data has been successfully received and synchronized.
[0157] The above-mentioned replication and distribution of the data blocks that have been stored on the disk is the process of filling or optimizing the unused free space (i.e., holes) on the storage node. In the application scenario, a sequence value Pi can be set for each storage node. The sequence value is the maximum sequence number among the continuous data blocks that have been stored on the storage node. That is, this sequence value indicates that the data with sequence numbers less than or equal to Pi have been successfully synchronized, and there are no holes in the storage of these data. This mechanism helps to ensure the integrity and consistency of data and optimize the data synchronization and access process.
[0158] The following describes the transaction submission process when a symmetric multi-copy architecture is used in a distributed storage system. In this architecture, the control node manages other storage nodes. The control node is responsible for receiving write operation requests from clients and starting corresponding transactions.
[0159] like Fig. 9A As shown, Fig. 9A The fifth transaction submission process diagram provided in the embodiment of the present application, the multiple storage nodes include storage node 0, storage node 1 and storage node 2. The data blocks allocated by the control node to each storage node are all the data blocks of the data to be processed. The control node is used to start the transaction, split and allocate the data to be processed, and does not need to store the data blocks on the disk. The following steps are included:
[0160] S301: The client initiates a write operation to the control node.
[0161] When a client needs to write data to the distributed storage system, the client initiates a write operation to the control node, which includes data to be processed. The data to be processed may be at least one of a write-ahead log or data to be written.
[0162] S302: The control node starts a transaction.
[0163] The control node receives a write operation request from a client, and starts a transaction corresponding to the write operation request, wherein the transaction is used to indicate that the to-be-processed data is stored in the plurality of storage nodes.
[0164] S303: The control node divides the data to be processed into three parts, including data block D0, data block D1, and data block D2.
[0165] The control node divides the data to be processed based on the number of storage nodes. Since there are three storage nodes, the control node divides the data to be processed into three parts, namely data block D0, data block D1 and data block D2.
[0166] S304: The control node sends data block D0, data block D1, and data block D2 to storage node 0.
[0167] S305: The control node sends data block D0, data block D1, and data block D2 to storage node 1.
[0168] S306: The control node sends data block D0, data block D1, and data block D2 to storage node 2.
[0169] The control node sends data blocks D0 to D2 to storage node 0, sends data blocks D0 to D2 to storage node 1, and sends data blocks D0 to D2 to storage node 2. When sending these data, the client is in a waiting state, waiting for feedback from each storage node on the reception and processing of the data.
[0170] It should be noted that the process of the control node sending the database blocks to each storage node can be simultaneous, that is, S304 to S306 are performed simultaneously; or there can be a sequence, for example, the above S304 to S306 are performed in sequence. In actual application, the order of the above S304 to S306 can be adaptively adjusted according to actual conditions. The above example does not limit the order in which the control node sends the data blocks to each storage node.
[0171] S307: Storage node 0 stores data block D0 on disk.
[0172] After storage node 0 receives multiple data blocks, storage node 0 may store the corresponding data block D0 on disk.
[0173] S308: Storage node 1 stores data block D1 on disk.
[0174] After storage node 1 receives multiple data blocks, storage node 1 may store the corresponding data block D1 on disk.
[0175] S309: Storage node 2 stores data block D2 on disk.
[0176] After storage node 2 receives multiple data blocks, storage node 2 may store the corresponding data block D2 on disk.
[0177] It should be noted that the process of the storage node writing the corresponding data block to the disk can be simultaneous, that is, S307-S309 can be performed simultaneously; or there can be a sequence, on the basis of the above S304-S306 being executed in sequence, the storage node can start writing the data block to the disk after receiving the data block, that is, execute S307-S309 in sequence. In the actual application process, the order of the above S304-S306 can be adaptively adjusted according to the actual situation. The above example does not limit the order in which the control node sends data blocks to each storage node.
[0178] S310: Storage node 0 returns success to the control node.
[0179] When storage node 0 successfully writes the corresponding data block D0 to the disk, storage node 0 returns success to the control node.
[0180] S311: Storage node 1 returns success to the control node.
[0181] When storage node 1 successfully writes the corresponding data block D1 to the disk, storage node 1 returns a success message to the control node.
[0182] S312: Storage node 2 returns success to the control node.
[0183] When storage node 2 successfully writes the corresponding data block D2 to the disk, storage node 2 returns success to the control node.
[0184] When each storage node successfully stores data on disk, it can return a success message to the control node, that is, it returns a message indicating that the current storage node has successfully stored data on disk to the control node.
[0185] It should be noted that the storage node returns success to the control node after the storage node has written the corresponding data block to the disk. Therefore, the order of S310 to S312 depends on the order in which the data blocks are successfully written to the disk in the aforementioned steps S304 to S306. When the order of successful writing to the disk is storage node 0, storage node 1, and storage node 2, the order in which the storage node returns success is S310 to S312. When the three storage nodes successfully write to the disk at the same time, the above S310 to S312 can be simultaneous.
[0186] Therefore, in actual application, the sequence of S310 to S312 can be adaptively adjusted according to actual conditions. The above example does not limit the order in which each storage node returns success to the control node.
[0187] S313: The control node commits the transaction.
[0188] When receiving a success response from each storage node, the control node commits the currently executed transaction.
[0189] S314: The control node returns a write success to the client.
[0190] After the control node commits the transaction, the control node may return a write success to the client, that is, generate a message indicating that the current write operation is successfully executed, and feed it back to the client.
[0191] S315: Storage node 0 writes data block D1 and data block D2 to disk.
[0192] After the control node commits the transaction, each storage node can store the data blocks that have not been stored on disk. Storage node 0 stores data blocks D1 and D2 on disk.
[0193] S316: Storage node 1 writes data block D0 and data block D2 to disk.
[0194] Storage node 1 stores data blocks D0 and D2 sent by the control node in the above steps to the disk.
[0195] S317: Storage node 2 writes data block D0 and data block D1 to disk.
[0196] Storage node 2 stores data blocks D0 and D1 sent by the control node in the above steps to the disk.
[0197] It should be noted that, on the one hand, S314 and S315~S316 are all executed after the S313 control node commits the transaction. S314 and S315~S316 can be executed simultaneously or in sequence. In actual application, the execution order between S314 and S315~S316 can be adaptively adjusted according to actual conditions. The above example does not limit the execution order between S314 and S315~S316.
[0198] On the other hand, the process of each storage node in S315~S317 writing the data blocks that have not been written to the disk can be carried out simultaneously or in a sequence. In actual application, the execution order between the above S314 and S315~S316 can be adaptively adjusted according to actual conditions. The above example does not limit the execution order of S315~S316.
[0199] In another possible implementation, the control node allocates corresponding data blocks to each storage node, such as Fig. 9B As shown, Fig. 9B The sixth transaction submission process diagram provided in the embodiment of the present application, the multiple storage nodes include storage node 0, storage node 1 and storage node 2. The control node is used to start the transaction, split and distribute the data to be processed, and does not need to store the data blocks on the disk.
[0200] S401: The client initiates a write operation to the control node.
[0201] When a client needs to write data to the distributed storage system, the client initiates a write operation to the control node, which includes data to be processed. The data to be processed may be at least one of a write-ahead log or data to be written.
[0202] S402: The control node starts a transaction.
[0203] In response to a write operation initiated by the client, the control node initiates a transaction corresponding to the write operation. The transaction is used to indicate that the to-be-processed data is stored in the plurality of storage nodes.
[0204] S403: The control node divides the data to be processed into three parts, including data block D0, data block D1, and data block D2.
[0205] The control node divides the data to be processed based on the number of storage nodes.
[0206] S404: The control node sends data block D0 to storage node 0.
[0207] S405: The control node sends data block D1 to storage node 1.
[0208] S406: The control node sends data block D2 to storage node 2.
[0209] The control node sends the data block to the corresponding storage node. When sending this data, the client is in a waiting state, waiting for the feedback of each storage node on the reception and processing of the data.
[0210] It should be noted that the process of the control node sending the database blocks to each storage node can be simultaneous, that is, S404 to S406 are performed simultaneously; or there can be a sequence, for example, the above S404 to S406 are performed in sequence. In actual application, the order of the above S404 to S406 can be adaptively adjusted according to actual conditions. The above example does not limit the order in which the control node sends the data blocks to each storage node.
[0211] S407: Storage node 0 stores data block D0 on disk.
[0212] After storage node 0 receives data block D0 allocated by the control node, storage node 0 may store the corresponding data block D0 on disk.
[0213] S408: Storage node 1 writes data block D1 to disk.
[0214] After the storage node 1 receives the data block D1 allocated by the control node, the storage node 1 may store the corresponding data block D1 on the disk.
[0215] S409: Storage node 2 stores data block D2 on disk.
[0216] After the storage node 2 receives the data block D2 allocated by the control node, the storage node 2 may store the corresponding data block D2 on the disk.
[0217] It should be noted that the process of the storage node writing the corresponding data block to the disk can be simultaneous, that is, S407 to S409 are performed simultaneously; or there can be a sequence. On the basis of the above S404 to S406 being executed in sequence, the storage node can start writing the data block to the disk after receiving the data block, that is, execute S407 to S409 in sequence. In the actual application process, the order of the above S404 to S406 can be adaptively adjusted according to the actual situation. The above example does not limit the order in which the control node sends data blocks to each storage node.
[0218] S410: Storage node 0 returns success to the control node.
[0219] When storage node 0 successfully writes the corresponding data block D0 to the disk, storage node 0 returns success to the control node.
[0220] S411: Storage node 1 returns success to the control node.
[0221] When storage node 1 successfully writes the corresponding data block D1 to the disk, storage node 1 returns a success message to the control node.
[0222] S412: Storage node 2 returns success to the control node.
[0223] When storage node 2 successfully writes the corresponding data block D2 to the disk, storage node 2 returns success to the control node.
[0224] When each storage node successfully stores data on disk, it can return a success message to the control node, that is, it returns a message indicating that the current storage node has successfully stored data on disk to the control node.
[0225] It should be noted that the storage node returns success to the control node after the storage node has written the corresponding data block to the disk. Therefore, the order of S410 to S412 depends on the order in which the data blocks are successfully written to the disk in the aforementioned steps S404 to S406. When the order of successful writing to the disk is storage node 0, storage node 1, and storage node 2, the order in which the storage node returns success is S410 to S412. When the three storage nodes successfully write to the disk at the same time, the above S410 to S412 can be simultaneous.
[0226] Therefore, in actual application, the sequence of S410 to S412 can be adaptively adjusted according to actual conditions. The above example does not limit the sequence in which each storage node returns success to the control node.
[0227] S413: The control node commits the transaction.
[0228] When receiving a success response from each storage node, the control node commits the currently executed transaction.
[0229] S414: The control node returns a write success to the client.
[0230] After the control node commits the transaction, the control node may return a write success to the client, that is, generate a message indicating that the current write operation is successfully executed, and feed it back to the client.
[0231] S415: Storage node 0 sends data block D0 to storage node 1.
[0232] S416: Storage node 0 sends data block D0 to storage node 2.
[0233] S417: Storage node 1 sends data block D1 to storage node 0.
[0234] S418: Storage node 1 sends data block D1 to storage node 2.
[0235] S419: Storage node 2 sends data block D2 to storage node 1.
[0236] S420: Storage node 2 sends data block D2 to storage node 0.
[0237] After each storage node returns success to the control node and the control node commits the transaction, it means that storage node 0, storage node 1, and storage node 2 have successfully stored data blocks D0, D1, and D2 in their respective storage media. In order to ensure data consistency and reliability, data blocks need to be synchronized between storage nodes, and data blocks that have not been written to disks need to be obtained from other nodes for writing to disks.
[0238] It should be noted that S414 and S415~S420 are all executed after the S413 control node commits the transaction. S414 and S415~S420 can be executed simultaneously or in sequence. In actual application, the execution order between S414 and S415~S420 can be adaptively adjusted according to actual conditions. The above example does not limit the execution order between S414 and S415~S420.
[0239] S421: Storage node 0 writes data block D1 and data block D2 to disk.
[0240] S422: Storage node 1 writes data block D0 and data block D2 to disk.
[0241] S423: Storage node 2 writes data block D1 and data block D0 to disk.
[0242] In a possible implementation, the synchronization between the storage nodes may be sequential, with storage node 0 triggering the synchronization process first. Storage node 0 sends the data block D0 that has been written to the disk to storage node 1 and storage node 2, thereby ensuring that storage node 1 and storage node 2 both have a copy of data block D0, thereby achieving data consistency. After receiving the data block D0 sent by storage node 0, storage node 1 will also trigger the synchronization process. Storage node 1 sends the data block D1 that has been written to the disk to storage node 0 and storage node 2, so that storage node 0 and storage node 2 can both obtain a copy of data block D1, further ensuring data consistency among all nodes. Storage node 2 triggers the synchronization process when it receives a data block sent by at least one other node (whether it is storage node 0 or storage node 1). Storage node 2 sends the data block D2 that has been written to the disk to storage node 0 and storage node 1, so that storage node 0 and storage node 1 also have a copy of data block D2, thereby completing the synchronization of all data blocks.
[0243] During the data block synchronization process, the P value of each storage node can be used to characterize the synchronization progress in the distributed storage system. Before synchronization, storage node 2 has its own data block D2 on disk, and after synchronization, it has data blocks D0 to D2. At this time, P2 increments to 2, indicating that the current storage node 2 has all data blocks with a data block number less than 2. It should be noted that the P2 of the storage node before synchronization can be adaptively set according to actual needs or application scenarios, for example, it can be set to 0.
[0244] Similarly, when storage nodes 0 and 1 receive data blocks, P0 and P1 increase. When P0 and P1 increase to 2, it means that the current storage node has all the data blocks of the data to be processed, and the gap is filled.
[0245] It should be noted that the synchronization order between the storage nodes is not limited to the above example. At least one storage node for starting synchronization may be set according to actual application scenarios and actual needs, and the conditions for triggering synchronization of each storage node may also be set.
[0246] In a possible implementation, the synchronization operations between the various storage nodes can also be performed simultaneously to improve the efficiency of the synchronization process and reduce the overall completion time. That is, after the control node commits the transaction, storage node 0 sends the data block D0 that has been written to the disk to storage node 1 and storage node 2, while storage node 1 sends the data block D1 that has been written to the disk to storage node 0 and storage node 2, and storage node 2 sends the data block D2 that has been written to the disk to storage node 0 and storage node 1. After the transaction is committed, each storage node starts data block synchronization at the same time without waiting for the operations of other nodes to complete. This fully utilizes the capabilities of parallel processing and reduces waiting time.
[0247] Each storage node is listening to data blocks sent from other nodes while sending data blocks. When a storage node receives data blocks sent by other storage nodes, the storage node can verify the received data blocks to ensure the integrity and accuracy of the data blocks. In this step, since the sending and receiving operations are parallel, the node can continue to send data blocks while processing the received data blocks.
[0248] When each storage node has successfully sent and verified the data block exchange with other nodes, the storage node can send a synchronization completion signal to the control node. After the control node receives the synchronization completion signal from all nodes, it confirms that the entire synchronization process has been completed. By performing synchronization operations simultaneously, the total time required for the synchronization process can be significantly reduced and the overall performance of the system can be improved.
[0249] Through this synchronization mechanism, each storage node can ensure that it has all the data blocks of the data to be processed, and these data blocks are consistent across all storage nodes. This helps improve data reliability and fault tolerance, because even if a node fails, other nodes still have a complete copy of the data.
[0250] The following describes the transaction submission process when the master-slave architecture is used in a distributed storage system. Fig. 10A As shown, Fig. 10A This is a seventh transaction submission process diagram provided in an embodiment of the present application. In this architecture, the primary storage node 0 is not only used to initiate transactions, but also to split and allocate data to be processed, and also to store corresponding data blocks on disk.
[0251] S501: The client initiates a write operation to the primary storage node.
[0252] The client initiates a write operation, causing the primary storage node to start a transaction for the write operation.
[0253] S502: The primary storage node starts a transaction.
[0254] The transaction is used to indicate that the to-be-processed data is stored in the plurality of storage nodes.
[0255] S503: The primary storage node divides the data to be processed into three parts, including data block D0, data block D1, and data block D2.
[0256] The main storage node divides the data to be processed based on the number of storage nodes.
[0257] S504: The primary storage node sends data block D0, data block D1, and data block D2 to the backup storage node 1.
[0258] S505: The primary storage node sends data block D0, data block D1, and data block D2 to the backup storage node 2.
[0259] The primary storage node sends data blocks D0 to D2 to backup storage node 1, sends data blocks D0 to D2 to backup storage node 2, and sends data blocks D0 to D2 to storage node 2. When sending these data, the client is in a waiting state, waiting for feedback from each storage node on the reception and processing of the data.
[0260] It should be noted that the process of the master storage node sending the database blocks to each storage node can be simultaneous, that is, S504-S505 are performed simultaneously; or there can be a sequence, for example, the above S504-S505 are performed in sequence. In the actual application process, the order of the above S504-S505 can be adaptively adjusted according to the actual situation. The above example does not limit the order in which the master storage node sends the data blocks to each storage node.
[0261] S506: The primary storage node stores the data block D0 on disk.
[0262] When the backup storage node 1 can store the three data blocks obtained by segmentation, the data block D0 corresponding to the primary storage node can be stored on the disk.
[0263] It should be noted that, in one possible implementation, the primary storage node may write the data blocks corresponding to the primary storage node to disk before sending the data blocks to the backup storage node. That is, S506 may be located between S503 and S504. In another possible implementation, the primary storage node may write the corresponding data blocks to disk after sending the data blocks to the backup storage node. In yet another possible implementation, S504 to S506 may be executed simultaneously, that is, the primary storage node sends the data blocks to the backup storage node while writing the corresponding data blocks to disk.
[0264] S507: The standby storage node 1 writes the data block D1 to the disk.
[0265] After the backup storage node 2 receives multiple data blocks, the backup storage node 1 may store the corresponding data block D1 on the disk.
[0266] S508: The standby storage node 2 stores the data block D2 on the disk.
[0267] After the backup storage node 2 receives multiple data blocks, the backup storage node 2 may store the corresponding data block D2 on the disk.
[0268] It should be noted that the process of the storage node writing the corresponding data block to the disk can be simultaneous, that is, S506 to S508 are performed simultaneously; or there can be a sequence. On the basis of the above S504 to S505 being executed in sequence, the storage node can start writing the data block to the disk after receiving the data block, that is, execute S506 to S508 in sequence. In the actual application process, the order of the above S506 to S508 can be adaptively adjusted according to the actual situation. The above example does not limit the order in which the main storage node sends data blocks to each storage node.
[0269] S509: The standby storage node 2 returns a success message to the primary storage node.
[0270] When the standby storage node 2 successfully writes the corresponding data block D1 to the disk, the standby storage node 2 returns a success message to the primary storage node.
[0271] S510: The backup storage node 1 returns a success message to the primary storage node.
[0272] When the standby storage node 1 successfully writes the corresponding data block D0 to the disk, the standby storage node 1 returns a success message to the primary storage node.
[0273] When the data is successfully written to the disk, each backup storage node can return a success message to the primary storage node, that is, return a message indicating that the data has been successfully written to the disk by the current backup storage node to the primary storage node.
[0274] It should be noted that the storage node returns success to the primary storage node after the storage node has written the corresponding data block to the disk. Therefore, the order between S509 and S510 depends on the order in which the data blocks are successfully written to the disk in the aforementioned steps S507 and S508. When the order in which the data blocks are successfully written to the disk is backup storage node 2 and backup storage node 1, the order in which the storage nodes return success is S509 and S510. When the two backup storage nodes successfully write to the disk at the same time, the above S509 and S510 can be performed simultaneously.
[0275] Therefore, in actual application, the sequence of S509 and S510 can be adaptively adjusted according to actual conditions. The above example does not limit the order in which each storage node returns success to the main storage node.
[0276] S513: The primary storage node commits the transaction.
[0277] When the primary storage node receives a success response from each storage node and successfully stores the corresponding data block on disk, the primary storage node commits the currently executed transaction.
[0278] S514: The primary storage node returns a write success message to the client.
[0279] After the primary storage node commits the transaction, the primary storage node can return a write success to the client, that is, generate a message indicating that the current write operation is successfully executed and feed it back to the client.
[0280] S515: The primary storage node writes data block D1 and data block D2 to disk.
[0281] After the primary storage node commits the transaction, each storage node can write the data blocks that have not been written to the disk. The backup storage node 1 writes the data blocks D1 and D2 to the disk.
[0282] S516: The standby storage node 1 stores the data block D0 and the data block D2 on the disk.
[0283] The backup storage node 2 stores the data blocks D0 and D2 sent by the primary storage node in the above steps to the disk.
[0284] S517: The standby storage node 2 writes the data block D0 and the data block D1 to the disk.
[0285] Storage node 2 stores data blocks D0 and D1 sent by the primary storage node in the above steps to disk.
[0286] It should be noted that, on the one hand, S514 and S515~S517 are all executed after the transaction is committed by the S513 main storage node. S514 and S515~S517 can be executed simultaneously or in sequence. In actual application, the execution order between S514 and S515~S517 can be adaptively adjusted according to actual conditions. The above example does not limit the execution order between S514 and S515~S517.
[0287] On the other hand, the process of each storage node in S515~S517 writing the data blocks that have not been written to the disk can be carried out simultaneously or in a sequence. In actual application, the execution order between the above S515~S517 can be adaptively adjusted according to actual conditions. The above example does not limit the execution order of S515~S517.
[0288] In another possible implementation of the master-slave architecture, the master storage node allocates the data blocks that it is responsible for storing on disk to each backup storage node, such as Fig. 10B As shown, Fig. 10B The eighth transaction submission process diagram provided for the embodiment of the present application includes a primary storage node, a backup storage node 1 and a backup storage node 2.
[0289] S601: The client initiates a write operation to the primary storage node.
[0290] The client initiates a write operation and starts a transaction for the write operation.
[0291] S602: The primary storage node starts a transaction.
[0292] The transaction is used to indicate that the to-be-processed data is stored in the plurality of storage nodes.
[0293] S603: The primary storage node divides the data to be processed into three parts, including data block D0, data block D1, and data block D2.
[0294] S604: The primary storage node sends data block D0 to the backup storage node 1.
[0295] S605: The primary storage node sends the data block D1 to the backup storage node 2.
[0296] The primary storage node sends the data block to the corresponding backup storage node. When sending this data, the client is in a waiting state, waiting for the feedback of each storage node on the reception and processing of the data.
[0297] It should be noted that the process of the master storage node sending the database blocks to each storage node can be simultaneous, that is, S604-S605 are performed simultaneously; or there can be a sequence, for example, the above S604-S605 are performed in sequence. In the actual application process, the order of the above S604-S605 can be adaptively adjusted according to the actual situation. The above example does not limit the order in which the master storage node sends the data blocks to each storage node.
[0298] S606: The primary storage node stores the data block D0 on disk.
[0299] The primary storage node stores the corresponding data block D0 among the three data blocks obtained by segmentation on the disk.
[0300] S607: The standby storage node 1 writes the data block D1 to the disk.
[0301] After the backup storage node 1 receives the data block D0 allocated by the primary storage node, the backup storage node 1 stores the corresponding data block D0 on the disk.
[0302] S608: The standby storage node 2 stores the data block D2 on the disk.
[0303] After the backup storage node 2 receives the data block D1 allocated by the primary storage node, the backup storage node 2 stores the corresponding data block D1 on the disk.
[0304] It should be noted that the process of the storage node writing the corresponding data block to the disk can be simultaneous, that is, S606-S608 are performed simultaneously; or there can be a sequence. On the basis of the above S604-S605 being executed in sequence, the storage node can start writing the data block to the disk after receiving the data block, that is, execute S606-S608 in sequence. In the actual application process, the order of the above S604-S605 can be adaptively adjusted according to the actual situation. The above example does not limit the order in which the main storage node sends data blocks to each storage node.
[0305] S609: The standby storage node 2 returns a success message to the primary storage node.
[0306] When the standby storage node 2 successfully writes the corresponding data block D1 to the disk, the standby storage node 2 returns a success message to the primary storage node.
[0307] S610: The backup storage node 1 returns a success message to the primary storage node.
[0308] When the standby storage node 1 successfully writes the corresponding data block D0 to the disk, the standby storage node 1 returns a success message to the primary storage node.
[0309] It should be noted that the storage node returns success to the primary storage node after the storage node has written the corresponding data block to the disk. Therefore, the order of S609 to S610 depends on the order of successful data block writing in the aforementioned steps S606 to S608. When the order of successful writing to the disk is backup storage node 2 and backup storage node 1, the order of successful returns by the storage node is S609 to S610. When the two backup storage nodes successfully write to the disk at the same time, the above S609 to S610 can be simultaneous.
[0310] Therefore, in actual application, the sequence of S609 and S610 can be adaptively adjusted according to actual conditions. The above example does not limit the sequence in which each storage node returns success to the main storage node.
[0311] S611: The primary storage node commits the transaction.
[0312] When the primary storage node receives a success response from each of the backup storage nodes and the primary storage node successfully writes the data block D0 to the disk, the primary storage node commits the currently executed transaction.
[0313] S612: The primary storage node returns a write success message to the client.
[0314] After the primary storage node commits the transaction, the primary storage node can return a write success to the client, that is, generate a message indicating that the current write operation is successfully executed and feed it back to the client.
[0315] S613: The primary storage node sends data block D0 to the backup storage node 1.
[0316] S614: The primary storage node sends data block D0 to the backup storage node 2.
[0317] S615: The backup storage node 1 sends the data block D1 to the primary storage node.
[0318] S616: The backup storage node 1 sends the data block D1 to the backup storage node 2.
[0319] S617: The standby storage node 2 sends the data block D2 to the primary storage node.
[0320] S618: The backup storage node 2 sends the data block D2 to the backup storage node 1.
[0321] After each storage node returns success to the primary storage node and the primary storage node commits the transaction, it means that backup storage node 1, backup storage node 2, and the primary storage node have successfully stored data blocks D0, D1, and D2 in their respective storage media. In order to ensure data consistency and reliability, data blocks need to be synchronized between storage nodes, and data blocks that have not been written to disk are obtained from other nodes for writing to disk.
[0322] It should be noted that S612 and S613~S618 are all executed after the S613 main storage node commits the transaction. S612 and S613~S618 can be executed simultaneously or in sequence. In actual application, the execution order between S612 and S613~S618 can be adaptively adjusted according to actual conditions. The above example does not limit the execution order between S612 and S613~S618.
[0323] S610: The primary storage node writes data block D1 and data block D2 to disk.
[0324] S620: The standby storage node 1 stores the data block D0 and the data block D2 on the disk.
[0325] S621: The standby storage node 2 writes the data block D0 and the data block D1 to the disk.
[0326] In a possible implementation, the synchronization between the storage nodes may be sequential, with the primary storage node triggering the synchronization process first. The primary storage node sends the data block D0 that has been written to the disk to the backup storage node 2 and the backup storage node 1, thereby ensuring that the backup storage node 2 and the backup storage node 1 both have a copy of the data block D0, thereby achieving data consistency. After receiving the data block D0 sent by the primary storage node, the backup storage node 1 will also trigger the synchronization process. The backup storage node 1 sends the data block D1 that has been written to the disk to the primary storage node and the backup storage node 2, so that the primary storage node and the backup storage node 2 can obtain a copy of the data block D1, further ensuring the consistency of the data among all nodes. The backup storage node 2 triggers the synchronization process when it receives a data block sent by at least one other node (whether it is the backup storage node 1 or the primary storage node). The backup storage node 2 sends the data block D2 that has been written to the disk to the backup storage node 1 and the primary storage node, so that the backup storage node 1 and the primary storage node also have a copy of the data block D2, thereby completing the synchronization of all data blocks.
[0327] During the data block synchronization process, the P value of each storage node can be used to characterize the synchronization progress in the distributed storage system. Before synchronization, the backup storage node 2 has its own data block D2 on disk, and after synchronization, it has data blocks D0 to D2. At this time, P2 increments to 2, indicating that the current storage node 2 has all data blocks with a data block number less than 2. It should be noted that the P2 of the storage node before synchronization can be adaptively set according to actual needs or application scenarios, for example, it can be set to 0.
[0328] Similarly, when the backup storage node 1 and the main storage node receive data blocks, P0 and P1 increase. When P0 and P1 increase to 2, it means that the current storage node has all the data blocks of the data to be processed, and the gap is filled.
[0329] It should be noted that the synchronization order between the storage nodes is not limited to the above example. At least one storage node for starting synchronization may be set according to actual application scenarios and actual needs, and the conditions for triggering synchronization of each storage node may also be set.
[0330] In a possible implementation, the synchronization operations between the various storage nodes can also be performed simultaneously to improve the efficiency of the synchronization process and reduce the overall completion time. That is, after the primary storage node commits the transaction, the primary storage node sends the data block D0 that has been written to the disk to the backup storage node 2 and the backup storage node 2, while the backup storage node 2 sends the data block D2 that has been written to the disk to the backup storage node 1 and the primary storage node, and the backup storage node 1 sends the data block D1 that has been written to the disk to the primary storage node and the backup storage node 2. After the transaction is committed, each storage node starts data block synchronization at the same time without waiting for the operations of other nodes to complete. This fully utilizes the capabilities of parallel processing and reduces waiting time.
[0331] Each storage node is listening to data blocks sent from other nodes while sending data blocks. When a storage node receives data blocks sent by other storage nodes, the storage node can verify the received data blocks to ensure the integrity and accuracy of the data blocks. In this step, since the sending and receiving operations are parallel, the node can continue to send data blocks while processing the received data blocks.
[0332] When each storage node has successfully sent and verified the data block exchange with other nodes, the storage node can send a synchronization completion signal to the main storage node. After the main storage node receives the synchronization completion signal from all nodes, it confirms that the entire synchronization process has been completed. Through simultaneous synchronization operations, the total time required for the synchronization process can be significantly reduced and the overall performance of the system can be improved.
[0333] Through this synchronization mechanism, each storage node can ensure that it has all the data blocks of the data to be processed, and these data blocks are consistent across all storage nodes. This helps improve data reliability and fault tolerance, because even if a node fails, other nodes still have a complete copy of the data.
[0334] The following describes the transaction submission process when a node fails in a distributed storage system.
[0335] like Fig.11A As shown, Fig.11A A schematic diagram of the transaction submission process when a node fails in a symmetric multi-copy architecture provided in an embodiment of the present application. After the control node sends the data block to the corresponding storage node, each storage node writes the data block it is responsible for to disk and feeds back the execution result of the disk operation to the control node. S701: The client initiates a write operation to the control node.
[0336] The client initiates a write operation and starts a transaction for the write operation. The control node splits the data to be processed into three parts, namely data block D0, data block D1 and data block D2.
[0337] S702: The control node starts a transaction.
[0338] The transaction is used to indicate that the to-be-processed data is stored in the plurality of storage nodes.
[0339] S703: The control node divides the data to be processed into three parts, including data block D0, data block D1, and data block D2.
[0340] Since there are three storage nodes, the control node divides the data to be processed into three parts.
[0341] S704: The control node sends data block D0, data block D1, and data block D2 to storage node 0.
[0342] S705: The control node sends data block D0, data block D1, and data block D2 to storage node 1.
[0343] S706: The control node sends data block D0, data block D1, and data block D2 to storage node 2.
[0344] The control node sends data blocks D0 to D2 to storage node 0, sends data blocks D0 to D2 to storage node 1, and sends data blocks D0 to D2 to storage node 2. When sending these data, the client is in a waiting state, waiting for feedback from each storage node on the reception and processing of the data.
[0345] It should be noted that the process of the control node sending the database blocks to each storage node can be simultaneous, that is, S704 to S706 are performed simultaneously; or there can be a sequence, for example, the above S704 to S706 are performed in sequence. In actual application, the order of the above S704 to S706 can be adaptively adjusted according to actual conditions. The above example does not limit the order in which the control node sends the data blocks to each storage node.
[0346] S707: Storage node 0 writes data block D0 to disk.
[0347] After storage node 0 receives multiple data blocks, storage node 0 may store the corresponding data block D0 on disk.
[0348] S708: Storage node 1 writes data block D1 to disk.
[0349] After storage node 1 receives multiple data blocks, storage node 1 may store the corresponding data block D1 on disk.
[0350] S709: Storage node 2 writes data block D2 to disk.
[0351] After storage node 2 receives multiple data blocks, storage node 2 may store the corresponding data block D2 on disk.
[0352] It should be noted that the process of the storage node writing the corresponding data block to the disk can be simultaneous, that is, S707 to S709 are performed simultaneously; or there can be a sequence. On the basis of the above S704 to S706 being executed in sequence, the storage node can start writing the data block to the disk after receiving the data block, that is, execute S707 to S709 in sequence. In the actual application process, the order of the above S704 to S706 can be adaptively adjusted according to the actual situation. The above example does not limit the order in which the control node sends data blocks to each storage node.
[0353] S710: Storage node 0 returns success to the control node.
[0354] When storage node 0 successfully writes the corresponding data block D0 to the disk, storage node 0 returns success to the control node.
[0355] S711: Storage node 1 returns a failure or timeout to the control node.
[0356] During the disk flushing process, storage node 0 may be unable to flush the data block due to data corruption or network problems, and therefore returns a failure signal to the control node, or fails to return the flushing result to the control node within the first preset time.
[0357] S712: Storage node 2 returns success to the control node.
[0358] When storage node 2 successfully writes the corresponding data block D2 to the disk, storage node 2 returns success to the control node.
[0359] When each storage node successfully stores data on disk, it can return a success message to the control node, that is, it returns a message indicating that the current storage node has successfully stored data on disk to the control node.
[0360] S713: The control node executes a transaction rollback operation.
[0361] When the control node fails to receive a successful response from each storage node, it performs a transaction rollback operation, which is an important mechanism in database management and is used to undo unfinished changes to maintain data consistency.
[0362] S714: The control node returns a write failure to the client.
[0363] After executing the transaction rollback operation, the control node returns to the client a message indicating that the current write operation has failed.
[0364] S715: The control node determines the node in the fault state and falls back to the serial persistence mode.
[0365] After returning the write failure to the client, the control node determines which storage node is in a faulty state based on the write results returned by each storage node. For example, when receiving a failure signal returned by storage node 1, or failing to obtain the write result returned by storage node 1 within the first preset time, it can be determined that storage node 1 is faulty, and the serial persistence process is subsequently executed.
[0366] S716: The control node sends a serial persistence request to storage node 0.
[0367] S717: The control node sends a serial persistence request to storage node 2.
[0368] That is, the control node notifies storage node 0 and storage node 2 in the available state to abandon parallel persistence and execute serial persistence.
[0369] S718: The client initiates a write operation to the control node.
[0370] After the control node performs a transaction rollback operation and rolls back the currently available storage nodes to the serial persistence mode, the client can initiate a write operation to the control node again, including the pending data.
[0371] S719: The control node starts the transaction.
[0372] After receiving the write operation initiated by the client, the control node restarts the transaction that has not been completed, where the transaction is used to indicate that the data to be processed is stored in the multiple storage nodes.
[0373] S720: The control node sends data block D0, data block D1, and data block D2 to storage node 0.
[0374] S721: The control node sends data block D0, data block D1, and data block D2 to storage node 2.
[0375] S722: Storage node 1 writes data block D0, data block D1, and data block D2 to disk.
[0376] S723: Storage node 2 writes data block D0, data block D1, and data block D2 to disk.
[0377] In serial persistence mode, the control node sends multiple data blocks of the data to be processed to each storage node in an available state. Each storage node stores all the received data on disk and continues to increase its own Pi.
[0378] S724: Storage node 1 returns a success message to the control node.
[0379] When storage node 1 successfully stores data blocks D0, D1, and D2 on disk, it returns a success message to the control node.
[0380] S725: The control node executes a transaction commit operation.
[0381] The control node can execute the transaction commit operation when receiving a success response from any storage node that is currently in an available state.
[0382] S726: Storage node 2 returns success to the control node.
[0383] When storage node 2 successfully stores data blocks D0, D1, and D2 on disk, it returns a success message to the control node.
[0384] S727: The control node returns a write success to the client.
[0385] When the control node receives a success response from each storage node in an available state, it can return a write success to the client, which indicates the successful completion of the entire write operation.
[0386] When a storage node fails, parallel storage requires the cooperation of multiple nodes, which causes the parallel storage to fail to work properly. Traditional full storage does not rely on the parallel operation of multiple nodes. Therefore, when a storage node in the execution node group fails, the distributed storage system returns from parallel storage to full storage. As a result, even in the case of multiple node failures, the storage system can continue to work normally, thereby enhancing the system's fault tolerance.
[0387] The following describes the transaction submission process when a node fails in the master-slave architecture. Fig. 11B As shown, Fig. 11B A schematic diagram of a transaction submission process when a node fails in a master-slave architecture provided in an embodiment of the present application. It includes:
[0388] S801: The client initiates a write operation to the primary storage node.
[0389] S802: The primary storage node starts a transaction.
[0390] After the client initiates a write operation, the primary storage node starts a transaction for the write operation. The transaction is used to indicate that the to-be-processed data is stored in the multiple storage nodes.
[0391] S803: The primary storage node divides the data to be processed into three parts, including data block D0, data block D1, and data block D2.
[0392] Since there are two backup storage nodes and one primary storage node, the primary storage node divides the data to be processed into three parts, namely, data block D0, data block D1 and data block D2.
[0393] S804: The primary storage node sends data block D0, data block D1, and data block D2 to the backup storage node 1.
[0394] S805: The primary storage node sends data block D0, data block D1, and data block D2 to the backup storage node 2.
[0395] The primary storage node sends data blocks D0 to D2 to the backup storage node 1 , and sends data blocks D0 to D2 to the backup storage node 2 .
[0396] It should be noted that the process of the master storage node sending the database blocks to each storage node can be simultaneous, that is, S804-S805 are performed simultaneously; or there can be a sequence, for example, the above S804-S805 are performed in sequence. In the actual application process, the order of the above S804-S805 can be adaptively adjusted according to the actual situation. The above example does not limit the order in which the master storage node sends the data blocks to each storage node.
[0397] S806: The primary storage node stores the data block D0 on disk.
[0398] The primary storage node writes the corresponding data block D0 to disk.
[0399] S807: The standby storage node 1 writes the data block D1 to the disk.
[0400] After the backup storage node 1 receives multiple data blocks, the backup storage node 1 may store the corresponding data block D1 on the disk.
[0401] S808: The standby storage node 2 stores the data block D2 on the disk.
[0402] After the backup storage node 2 receives multiple data blocks, the backup storage node 2 may store the corresponding data block D2 on the disk.
[0403] It should be noted that the process of the storage node writing the corresponding data block to the disk can be simultaneous, that is, S806-S808 are performed simultaneously; or there can be a sequence. On the basis of the above S804-S805 being executed in sequence, the storage node can start writing the data block to the disk after receiving the data block, that is, execute S806-S808 in sequence. In the actual application process, the order of the above S806-S808 can be adaptively adjusted according to the actual situation. The above example does not limit the order in which the main storage node sends data blocks to each storage node.
[0404] S809: The standby storage node 1 returns a failure or timeout to the primary storage node.
[0405] During the disk flushing process, the backup storage node 1 may be unable to flush the data block due to data corruption or network problems, and thus returns a failure signal to the primary storage node, or fails to return the flushing result to the primary storage node within the first preset time.
[0406] S810: The standby storage node 2 returns a success message to the primary storage node.
[0407] When the standby storage node 2 successfully writes the corresponding data block D2 to the disk, the standby storage node 2 returns a success message to the primary storage node.
[0408] S811: The primary storage node executes a transaction rollback operation.
[0409] When the primary storage node fails to receive a successful response from each backup storage node, it performs a transaction rollback operation, which is an important mechanism in database management and is used to undo unfinished changes to maintain data consistency.
[0410] S812: The primary storage node returns a write failure to the client.
[0411] After executing the transaction rollback operation, the primary storage node returns to the client a message indicating that the current write operation has failed.
[0412] S813: The control node determines the node in the fault state and falls back to the serial persistence mode.
[0413] After returning the write failure to the client, the primary storage node determines which standby storage node is in a faulty state based on the write results returned by each standby storage node. For example, when receiving a failure signal returned by standby storage node 1, or failing to obtain the write result returned by standby storage node 1 within the first preset time, it can be determined that standby storage node 1 is faulty, and the serial persistence process is subsequently executed.
[0414] S814: The control node sends a serial persistence request to the primary storage node.
[0415] S815: The control node sends a serial persistence request to the backup storage node 2.
[0416] That is, the control node notifies the primary storage node and the backup storage node 2 in the available state to abandon parallel persistence and execute serial persistence.
[0417] S816: The client initiates a write operation to the primary storage node.
[0418] After the primary storage node performs a transaction rollback operation and rolls back the currently available storage nodes to the serial persistence mode, the client can initiate a write operation to the primary storage node again, including the pending data.
[0419] S817: The primary storage node starts the transaction.
[0420] After receiving the write operation initiated by the client, the primary storage node restarts the transaction that has not been completed, where the transaction is used to indicate that the to-be-processed data is stored in the multiple storage nodes.
[0421] S818: The primary storage node sends data block D0, data block D1, and data block D2 to the backup storage node 2.
[0422] S819: The primary storage node writes data block D0, data block D1, and data block D2 to the disk.
[0423] S820: The standby storage node 2 stores the data block D0, the data block D1, and the data block D2 on the disk.
[0424] In serial persistence mode, the main storage node sends multiple data blocks of the data to be processed to each storage node in an available state. Each storage node writes all the received data to the disk and continues to increase its own Pi.
[0425] It should be noted that the above S819 and S820 may be performed simultaneously or in sequence, and the above example does not limit the sequence of storing the data blocks on the disk.
[0426] S821: The standby storage node 2 returns a success message to the primary storage node.
[0427] When the backup storage node 2 successfully stores all data blocks D0, D1, and D2 on the disk, it returns a success message to the primary storage node.
[0428] S825: The primary storage node executes a transaction commit operation.
[0429] The primary storage node can execute the transaction commit operation when it receives a success response from any storage node that is currently in an available state.
[0430] S826: The standby storage node 2 returns a success message to the primary storage node.
[0431] When the backup storage node 2 successfully stores all data blocks D0, D1, and D2 on the disk, it returns a success message to the primary storage node.
[0432] S827: The primary storage node returns a write success message to the client.
[0433] When the primary storage node receives a success response from each available backup storage node, and the primary storage node successfully writes all data blocks D0, D1, and D2 to disk, it can return a write success to the client, which indicates the successful completion of the entire write operation.
[0434] The following describes the transaction submission process when recovering from a node failure in a distributed storage system.
[0435] When the first storage node fails and recovers to an available state within the second preset time, it is necessary to obtain data blocks based on other storage nodes in an available state among the multiple storage nodes. The second storage node is the storage node with the largest sequence value among the multiple storage nodes, and the sequence value is the largest sequence number in the continuous data blocks that the storage node has stored on the disk. Among them, the second preset time is a threshold for determining whether to roll back the transaction. When the first storage node recovers to an available state within the second preset time, the first storage node is catchup. When the first storage node fails to recover to an available state within the second preset time, the transaction rollback is executed, and the processed data is stored on the disk in serial persistence mode.
[0436] The first storage node obtains the data blocks between the current sequence value of the second storage node and the sequence value of the first storage node, and stores the data blocks between the current sequence value of the second storage node and the sequence value of the first storage node to a disk.
[0437] It should be noted that this process is applicable to both the master-slave architecture and the multi-copy architecture. In the master-slave architecture, the first storage node or the second storage node can be any one of multiple storage nodes, and the multiple storage nodes include the master storage node and the backup storage node. In the multi-copy architecture, the first storage node or the second storage node can be any one of the multiple storage nodes.
[0438] Taking the multi-copy architecture as an example, Fig.12 A schematic diagram of the transaction submission process when a node fails and recovers after an embodiment of the present application is provided. Among them, the first storage node that fails and recovers is storage node 1, and the second storage node with the largest sequence value is storage node 0. The control node plays a role in coordination and decision-making. It is responsible for deciding when to perform certain operations, such as when to read data, when to trigger the catchup process, etc. The control node is the core of the entire process, ensuring that each node performs operations in the correct order and conditions.
[0439] S900: The control node determines that storage node 1 recovers after failure.
[0440] In actual application scenarios, when storage node 1 fails, the control node can obtain the status of storage node 1 in real time. When the control node detects that storage node 1 returns to an available state within the second preset time, the subsequent process is executed.
[0441] S901: The control node triggers storage node 1 to execute a catchup process.
[0442] When the control node determines that storage node 1 is restored to an available state, storage node 1 is triggered to execute a catchup process.
[0443] It should be noted that in a distributed storage system, catchup usually refers to a data synchronization process used to ensure that data remains synchronized and consistent across all replicas. A catchup request can be translated as a catch-up request.
[0444] S902: Storage node 1 reads P0 of storage node 0.
[0445] S903: Storage node 1 reads P2 of storage node 2.
[0446] Storage node 1 sends a read request to storage node 0 and storage node 2 in the available state, and reads the P0 and P2 values of storage node 0 and storage node 2. The P value is used to represent the data location that has been synchronized by each storage node, and reading P0 and P2 is used to determine the point from which storage node 1 needs to start synchronizing data.
[0447] It should be noted that the reading process of the above storage node 1 can be carried out simultaneously or in sequence. In actual application, the order of the above S902~S903 can be adaptively adjusted according to actual conditions. The above example does not limit the order in which the main storage node sends data blocks to each storage node.
[0448] S904: Storage node 2 returns P2 to storage node 1.
[0449] S905: Storage node 0 returns P0 to storage node 1.
[0450] After receiving the read request from storage node 1, the storage node in the available state returns the P value of the current storage node, ie, P2 and P0, to storage node 1.
[0451] It should be noted that the above-mentioned P value return process can be carried out simultaneously or in a certain order. In actual application, the order of S904 to S905 can be adaptively adjusted according to actual conditions. The above example does not limit the order in which each storage node returns the P value to storage node 1.
[0452] S906: Storage node 1 reads P1 and compares the size relationship among P1, P2, and P0.
[0453] S907: If P1 is smaller than P0 and P2, and P0 is larger than P2, storage node 1 sends a catchup request to the storage node and carries P1.
[0454] When the comparison result is P0>P2>P1, storage node 1 selects the largest P0 value from the received P0 and P2 values as the benchmark for catchup. Storage node 1 sends a catchup request to node 0, carrying the P1 value of the storage node of storage node 1. This P1 value indicates the data location that storage node 1 has synchronized to before the failure occurs.
[0455] S908: Storage node 0 sends the data blocks in the interval between P1 and current P0 to storage node 1, and carries the current P0.
[0456] Storage node 0 receives the catchup request sent by the storage node and determines the range of data blocks to be sent, that is, all data blocks between the P2 value of storage node 1 and the current P0 value of node 0. During this process, storage node 0 may continue to receive new data blocks and update its P0 value. Before sending data, storage node 0 will carry the current latest P0 value in the response message. This current P0 value reflects the latest synchronization status of node 0 when sending data.
[0457] S909: Storage node 1 stores the data blocks in the P1 and current P0 intervals on disk.
[0458] Storage node 1 stores the data blocks in the interval between P1 and the current P0 sent by storage node 0.
[0459] S910: The control node switches to the parallel persistence mode.
[0460] The data blocks in the interval P1 and P0 are stored in the disk at storage node 1, that is, the catchup process of storage node 1 is completed. The control node can send a parallel persistence request to each storage node in an available state to execute the process of storing data blocks in parallel in the above embodiment.
[0461] S911: The control node sends a parallel persistence request to storage node 0.
[0462] S912: The control node sends a parallel persistence request to storage node 1.
[0463] S913: The control node sends a parallel persistence request to storage node 2.
[0464] Through the above process, node 1 can effectively synchronize data with other nodes after fault recovery to ensure data consistency and integrity. The parallel persistence request sent by the control node further enhances the reliability and durability of the data. This mechanism is very common in distributed storage systems, and can handle node failures, network interruptions and other potential data inconsistency issues. Carry more data: In the traditional catchup process, a small number of data blocks may be requested and transmitted each time, which will cause a large amount of network round-trip time (RTT) and reduce overall performance. In the embodiment of the present application, by carrying the P value in the request and response, the storage node recovered after the failure can determine the data block interval that currently needs to be synchronized, and request all data blocks from the current progress to the maximum P value of other storage nodes at one time, thereby reducing the number of network interactions and improving the efficiency of data transmission.
[0465] In this embodiment, Pi is carried in the catchup request and response messages, which has the following beneficial effects:
[0466] 1. Avoid data duplication or omission: Through Pi identification, the storage node that recovers after a failure can accurately determine which data blocks need to be transmitted, avoiding duplicate transmission or omission of data. This is crucial to maintaining data consistency and accuracy.
[0467] 2. Transmit more data: In the traditional catchup process, a small amount of data may be transmitted each time for synchronization. However, by carrying Pi in the request and response, a data range (such as data from P1 to P2) can be specified, allowing all data in this range to be transmitted at one time. This reduces the number of communications in the catchup process and improves the efficiency of data transmission.
[0468] 3. Optimize network bandwidth utilization: Since more data can be transmitted at one time, this mechanism can also more effectively utilize network bandwidth and reduce the waste of network resources.
[0469] 3. Simplified process management: Through the use of Pi, the management of the catchup process has also become simpler and more direct. The system can more easily track progress, determine whether the node that has recovered after the failure has completed the catchup, and whether further synchronization operations are required.
[0470] The above are some specific implementations of the transaction submission method provided in the embodiments of the present application. Based on this, the embodiments of the present application also provide a computer program product. When the computer program product runs on a computer, the computer implements the transaction submission method provided in the embodiments of the present application.
[0471] The embodiment of the present application also provides corresponding devices and computer storage media for implementing the transaction submission method provided in the embodiment of the present application.
[0472] The device includes a memory and a processor, the memory is used to store instructions or codes, and the processor is used to execute the instructions or codes so that the device executes the transaction submission method described in any embodiment of the present application.
[0473] The computer storage medium stores codes, and when the codes are executed, the device executing the codes implements the transaction submission method described in any embodiment of the present application.
[0474] The "first" and "second" (if any) in the names such as "first" and "second" mentioned in the embodiments of the present application are used as name identifiers and do not represent the first or second in order.
[0475] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0476] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0477] The above description is merely an exemplary embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A transaction submission method, It is characterized in that include: When initiating a transaction, the control node divides the data to be processed into a plurality of data blocks and sends the data to a plurality of storage nodes, wherein the transaction is used to indicate that the data to be processed is stored in the plurality of storage nodes, wherein each storage node corresponds to at least one data block; The storage node writes the corresponding data block to the disk and sends the result of writing to the disk to the control node; The control node performs a transaction commit operation according to the disk flushing result sent by each storage node, and the transaction commit operation is used to indicate that the transaction is completed; The storage node stores data blocks that have not been stored on the disk among the multiple data blocks.
2. The method according to claim 1, It is characterized in that The step of dividing the data to be processed into a plurality of data blocks and sending the data blocks to a plurality of storage nodes includes: The control node divides the received data to be processed into multiple data blocks based on the number of storage nodes, and sends each data block to the corresponding storage node.
3. The method according to claim 1, It is characterized in that The step of dividing the data to be processed into a plurality of data blocks and sending the data blocks to a plurality of storage nodes includes: The control node divides the received data to be processed into multiple data blocks based on the number of storage nodes, and sends the multiple data blocks to each storage node respectively; The storage node writes the corresponding data block to the disk and sends the result of writing to the disk to the control node, including: The storage node stores data blocks corresponding to itself among the multiple data blocks on disk.
4. The method according to any one of claims 1 to 3, It is characterized in that Also includes: When the storage node fails to write to disk, the control node performs a transaction rollback operation, where the transaction rollback operation is used to undo the executed operation and return to the state before the transaction started; When restarting the transaction, the control node sends the multiple data blocks of the to-be-processed data to the storage nodes in the available state respectively; The storage node in the available state stores all the data blocks of the to-be-processed data on disk, and sends the storage result to the control node; When each storage node in an available state has successfully written data to disk, the control node executes a transaction commit operation.
5. The method according to any one of claims 1 to 3, It is characterized in that The plurality of storage nodes include a first storage node and a second storage node, and the method further includes: When the first storage node recovers to an available state after a failure, reading sequence values of other storage nodes in the plurality of storage nodes that are in an available state; The first storage node obtains the data blocks between the current sequence value of the second storage node and the sequence value of the first storage node, and writes the data blocks between the current sequence value of the second storage node and the sequence value of the first storage node to disk, the second storage node is the storage node with the largest sequence value among the multiple storage nodes, and the sequence value is the largest sequence number in the continuous data blocks that the storage node has written to disk.
6. A transaction submission method, It is characterized in that include: The primary storage node divides the to-be-processed data into a plurality of data blocks when initiating a transaction, wherein the transaction is used to indicate that the to-be-processed data is stored in a plurality of storage nodes, wherein the plurality of storage nodes include the primary storage node and at least one backup storage node, and each storage node corresponds to at least one data block; The primary storage node writes the corresponding data blocks to the disk, and sends the multiple data blocks to the backup storage node; The standby storage node writes the corresponding data block to the disk, and sends the result of writing to the disk to the control node; The primary storage node performs a transaction commit operation according to the disk-storage result of each storage node, and the transaction commit operation is used to indicate that the transaction is executed; The storage node stores data blocks that have not been stored on the disk among the multiple data blocks.
7. The method according to claim 6, It is characterized in that The sending the multiple data blocks to the backup storage node includes: The primary storage node sends each data block to the corresponding backup storage node.
8. The method according to claim 6, It is characterized in that The sending the multiple data blocks to the backup storage node includes: The primary storage node sends the multiple data blocks to each backup storage node respectively; The standby storage node stores the corresponding data block on disk, including: The standby storage node stores data blocks corresponding to itself among the multiple data blocks on disk.
9. The method according to any one of claims 6 to 8, It is characterized in that Also includes: When the standby storage node fails to write to disk, the primary storage node performs a transaction rollback operation, where the transaction rollback operation is used to undo the executed operation and return to the state before the transaction started; When the transaction is restarted, the primary storage node writes the multiple data blocks of the to-be-processed data to a disk, and sends the multiple data blocks of the to-be-processed data to a backup storage node in an available state; The standby storage node in an available state stores all the data blocks of the to-be-processed data on disk, and sends the storage result to the primary storage node; When each storage node in an available state has successfully written data to disk, the primary storage node performs a transaction commit operation.
10. A server, It is characterized in that The invention comprises a processor and a memory, wherein the processor and the memory are connected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the transaction submission method as described in any one of claims 1 to 5 or 6 to 9.
