CN101706811B - Transaction commit method of distributed database system - Google Patents
Transaction commit method of distributed database system Download PDFInfo
- Publication number
- CN101706811B CN101706811B CN2009102382705A CN200910238270A CN101706811B CN 101706811 B CN101706811 B CN 101706811B CN 2009102382705 A CN2009102382705 A CN 2009102382705A CN 200910238270 A CN200910238270 A CN 200910238270A CN 101706811 B CN101706811 B CN 101706811B
- Authority
- CN
- China
- Prior art keywords
- affairs
- participant
- transaction
- node
- message
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Computer And Data Communications (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明公开了一种分布式数据库系统事务提交方法,属于计算机网络技术领域。本方法为:1)在参与者节点和协调器节点内存中各分配一缓存区域,用来缓存事务日志;2)协调器节点根据事务内容确定参与者节点并与之建立连接,同时确定事务的操作请求信息;3)协调器节点向参与者节点发送事务的单步操作请求消息,同时记录每个操作请求的事务请求日志;4)参与者节点根据每个操作请求的完成情况处理本地日志,并向协调器节点发送相应的消息;5)协调器节点根据接收到的所有参与者节点发送的消息判断事务是否完成,如果完成给出最终决定。与现有技术相比,本发明大大减少了日志操作次数,提高了系统效率和事务效率,具有极高的可用性。
The invention discloses a transaction submission method of a distributed database system, which belongs to the technical field of computer networks. The method is as follows: 1) Allocate a cache area in the memory of the participant node and the coordinator node to cache the transaction log; 2) The coordinator node determines the participant node according to the transaction content and establishes a connection with it, and at the same time determines the Operation request information; 3) The coordinator node sends a single-step operation request message of the transaction to the participant node, and records the transaction request log of each operation request at the same time; 4) The participant node processes the local log according to the completion of each operation request, And send a corresponding message to the coordinator node; 5) The coordinator node judges whether the transaction is completed according to the received messages sent by all the participant nodes, and gives a final decision if it is completed. Compared with the prior art, the invention greatly reduces the number of log operations, improves system efficiency and transaction efficiency, and has extremely high availability.
Description
技术领域 technical field
本发明涉及一种数据库系统事务提交方法,尤其涉及一种分布式数据库系统中事务提交方法,属于计算机网络技术领域。The invention relates to a method for submitting a transaction in a database system, in particular to a method for submitting a transaction in a distributed database system, and belongs to the technical field of computer networks.
背景技术 Background technique
分布式系统是数据被存储于各种数据库中的多节点系统。节点可以是诸如计算机系统之类的任何数据处理系统,可以处于一个位置或者散布于多个位置,通过诸如局域网或者广域网之类的网络彼此连接。分布式系统的示例包括数据库系统、邮件服务器系统等。A distributed system is a multi-node system where data is stored in various databases. A node may be any data processing system, such as a computer system, and may be located at one site or distributed across multiple sites, connected to each other by a network such as a local or wide area network. Examples of distributed systems include database systems, mail server systems, and the like.
由于一个事务可能修改分布式系统中多个节点的数据,为了满足分布式系统的数据一致性,无论是否发生故障(例如供电中断、硬件冲突等),都必须要满足以下条件:事务是原子的,即事务要么成功执行所有请求,要么没有任何请求被执行。Since a transaction may modify the data of multiple nodes in the distributed system, in order to meet the data consistency of the distributed system, regardless of whether there is a failure (such as power supply interruption, hardware conflict, etc.), the following conditions must be met: the transaction is atomic , that is, the transaction either successfully executes all requests, or none of the requests are executed.
分布式系统通常利用两阶段提交(2PC)协议来保持数据一致性。在2PC系统中,每个事务的协调器节点、即客户端(例如应用程序)递交事务的节点,为事务中的每个请求识别分布式系统中持有请求对应的资源,负责处理请求的节点。持有请求对应的资源,并被分配用来处理事务中的请求的每个节点被称为参与者节点。这一步骤确定了事务参与者节点,并建立协调器节点到参与者节点的连接,为事务进行准备。Distributed systems often utilize a two-phase commit (2PC) protocol to maintain data consistency. In the 2PC system, the coordinator node of each transaction, that is, the node where the client (such as an application) submits the transaction, identifies the resource corresponding to the request in the distributed system for each request in the transaction, and the node responsible for processing the request . Each node that holds the resource corresponding to the request and is assigned to process the request in the transaction is called a participant node. This step determines the transaction participant nodes and establishes the connection from the coordinator node to the participant nodes to prepare for the transaction.
两阶段提交协议中的每个参与者节点投票决定提交还是回退事务,并将其投票发送到协调器节点。然后,协调器节点基于来自每个参与者节点的投票做出提交还是回退事务的最终决定。如果所有参与者节点认可提交,则写入一个日志记录以指示结果并且通知所有参与者节点提交事务。如果有一个或以上的参与者节点认为不能提交,则写入日志记录指示结果并通知所有认可提交的参与者节点将事务回退。Each participant node in the two-phase commit protocol votes to commit or roll back the transaction and sends its vote to the coordinator node. The coordinator node then makes the final decision to commit or roll back the transaction based on the votes from each participant node. If all participant nodes agree to commit, a log record is written to indicate the result and all participant nodes are notified to commit the transaction. If one or more participant nodes think that they cannot submit, they will write log records to indicate the result and notify all participant nodes that approve the submission to roll back the transaction.
一旦参与者节点投票同意提交,必须等待协调者的最终决定才能进行下一步动作。如果某个参与者投票不能提交,则可自行回退。Once the participant node votes to agree to submit, it must wait for the final decision of the coordinator before proceeding to the next step. If a participant's vote cannot be submitted, it can be rolled back by itself.
参与者节点执行完事务提交或回退后,需回复事务结束消息给协调器节点。协调器节点接到所有参与者节点的反馈消息后,记录事务结束日志,事务正式结束。After the participant node executes the transaction commit or rollback, it needs to reply the transaction end message to the coordinator node. After the coordinator node receives the feedback message from all participant nodes, it records the transaction end log, and the transaction officially ends.
两阶段提交协议存在如下的缺点:The two-phase commit protocol has the following disadvantages:
1)两阶段提交协议的日志写入操作是频繁的。为了保证事务的原子性和系统的可恢复性,在两阶段提交协议的执行过程中,日志的写入操作必须强制执行。在有n个参与者节点和1个协调者节点组成的2PC系统中,执行一次两阶段提交协议,需要进行2n+1次强制日志操作。1) The log write operation of the two-phase commit protocol is frequent. In order to ensure the atomicity of the transaction and the recoverability of the system, during the execution of the two-phase commit protocol, the write operation of the log must be enforced. In a 2PC system consisting of n participant nodes and 1 coordinator node, to execute a two-phase commit protocol, 2n+1 mandatory log operations are required.
2)两阶段提交协议不是消息高效的。在有n个参与者节点和1个协调者节点组成的2PC系统中,执行一次两阶段提交协议,传递的信息数量为4n条。2) The two-phase commit protocol is not message-efficient. In a 2PC system composed of n participant nodes and 1 coordinator node, a two-phase commit protocol is executed once, and the number of messages transmitted is 4n.
3)两阶段提交协议的高效执行依赖于包含协调者和所有参与者节点的全网络范围的畅通。在网络拥塞的环境下,任何一个投票同意提交的参与者节点必须等待协调者的最终决定才能完成操作并释放持有的资源。在此期间,任何请求参与者持有的资源的操作均需排队等待。而且,在没有得到参与者节点回复事务结束的消息,协调器节点也不能认为事务已经结束,而必须持有事务记录而不能“遗忘”(释放内存)。3) The efficient execution of the two-phase commit protocol depends on the smooth flow of the entire network including the coordinator and all participant nodes. In a congested network environment, any participant node that votes to commit must wait for the final decision of the coordinator to complete the operation and release the held resources. During this time, any operations that request resources held by participants are queued. Moreover, the coordinator node cannot think that the transaction has ended without getting the reply message of the end of the transaction from the participant node, but must hold the transaction record and cannot "forget" (release the memory).
目前的技术主要是单一寻求消息高效的解决方案或者日志操作减少的方案,或者仅针对某一类事务的特点进行优化,并不能充分实现分布式系统事务提交的高效处理,因此需要一种比现有的提交技术更有效的分布式事务提交方法。The current technology is mainly to seek a message efficient solution or a solution to reduce log operations, or to optimize only for the characteristics of a certain type of transaction, which cannot fully realize the efficient processing of transaction submission in a distributed system. Some commit techniques are more efficient distributed transaction commit methods.
发明内容 Contents of the invention
针对目前分布式系统事务提交效率不高的问题,本发明的目的在于提供一种分布式数据库系统事务提交方法,在事务成功提交或者回退的条件下都可以保证较少的信息传递量和强制日志操作次数。Aiming at the problem of low transaction submission efficiency in the current distributed system, the purpose of the present invention is to provide a distributed database system transaction submission method, which can ensure less information transmission and mandatory The number of log operations.
本发明的技术方案为:Technical scheme of the present invention is:
一种分布式数据库系统事务提交方法,其步骤为:A distributed database system transaction submission method, the steps of which are:
1)在参与者节点和协调器节点内存中各分配一缓存区域,用来缓存事务日志;1) Allocate a cache area in the memory of the participant node and the coordinator node to cache the transaction log;
2)协调器节点根据事务内容确定参与者节点并与之建立连接,同时确定事务的操作请求信息;2) The coordinator node determines the participant node according to the transaction content and establishes a connection with it, and at the same time determines the operation request information of the transaction;
3)协调器节点向参与者节点发送事务的单步操作请求消息,同时记录每个操作请求的事务请求日志;3) The coordinator node sends the single-step operation request message of the transaction to the participant node, and records the transaction request log of each operation request at the same time;
4)参与者节点根据每个操作请求的完成情况处理本地日志,并向协调器节点发送相应的消息;4) The participant node processes the local log according to the completion of each operation request, and sends a corresponding message to the coordinator node;
5)协调器节点根据接收到的所有参与者节点发送的消息进行判断:5) The coordinator node judges according to the received messages sent by all participant nodes:
a)如果事务需要回退,则协调器节点缓存本地事务日志,并向返回消息中事务的操作请求完成为成功的参与者节点发送事务回退消息;然后参与者节点执行接收到的事务回退消息并缓存事务日志;a) If the transaction needs to be rolled back, the coordinator node caches the local transaction log, and sends a transaction rollback message to the participant node whose operation request of the transaction in the return message is completed successfully; then the participant node executes the received transaction rollback message and cache the transaction log;
b)如果事务可以提交,则协调器节点缓存本地事务日志,并向本事务的所有参与者节点发送提交消息;然后参与者节点执行接收到的提交消息并缓存事务日志;b) If the transaction can be submitted, the coordinator node caches the local transaction log and sends a commit message to all participant nodes of the transaction; then the participant node executes the received commit message and caches the transaction log;
c)如果所有参与者节点返回消息中事务的操作请求完成为成功,并且事务尚未完成,则重复步骤3)~5)。c) If all participant nodes return the operation request of the transaction in the message as successful, and the transaction has not been completed, repeat steps 3) to 5).
进一步的,所述事务的操作请求信息包括:事务的各个操作请求,以及事务的操作请求总数n。Further, the operation request information of the transaction includes: each operation request of the transaction, and the total number n of operation requests of the transaction.
进一步的,所述协调器节点在每次事务开始时,确定当前协调器节点中是否存在缓存事务日志,如果存在则将其一次性写入磁盘;如果所述参与者节点的缓存区域满或者缓存超过设定时间或者发生强制写入缓存事务日志时,将缓存事务日志一次性写入磁盘。Further, the coordinator node determines whether there is a cached transaction log in the current coordinator node at the beginning of each transaction, and if so, writes it to the disk at one time; if the cache area of the participant node is full or the cache When the set time is exceeded or a forced write to the cached transaction log occurs, the cached transaction log will be written to disk at one time.
进一步的,所述事务的操作请求消息包括:事务ID、协调器ID、涉及此操作请求所有参与者ID、事务单步请求内容、i、协调器本地时间戳;所述向协调器节点发送相应的消息包括:协调器ID、协调器事务ID、本地参与者ID、i、vote、协调器节点发送的最新时间戳;所述参与者节点的本地日志包括:本地事务ID、协调器ID、协调器事务ID、涉及此操作请求所有参与者ID、事务单步请求内容、vote、协调器节点发送的最新时间戳;其中i为本次事务的第i步操作请求,vote为本次事务操作请求完成情况。Further, the operation request message of the transaction includes: transaction ID, coordinator ID, all participant IDs involved in this operation request, transaction single-step request content, i, coordinator local time stamp; The message includes: coordinator ID, coordinator transaction ID, local participant ID, i, vote, the latest timestamp sent by the coordinator node; the local log of the participant node includes: local transaction ID, coordinator ID, coordination Transaction ID of the server, IDs of all participants involved in this operation request, transaction single-step request content, vote, and the latest timestamp sent by the coordinator node; where i is the i-th step operation request of this transaction, and vote is the transaction operation request of this transaction Completion.
进一步的,所述协调器节点记录每个操作请求的事务请求日志的方法为:如果事务的操作请求是一个新事务的操作请求,则将该新事务的事务开始日志强制写入磁盘;如果事务的操作请求是当前事务的第i步请求,则缓存本次日志。Further, the method for the coordinator node to record the transaction request log of each operation request is: if the operation request of the transaction is an operation request of a new transaction, the transaction start log of the new transaction is forced to be written to the disk; If the operation request is the i-th step request of the current transaction, the current log is cached.
进一步的,所述事务开始日志包括:事务ID、协调器ID、涉及事务所有操作的所有参与者ID、事务第1步请求内容、本次事务开始标志、协调器本地时间戳;所述事务的第i步请求的日志包括:事务ID、协调器ID、涉及事务第i步操作所有参与者ID、事务第i步请求内容、i、协调器本地时间戳,其中i>1。Further, the transaction start log includes: transaction ID, coordinator ID, IDs of all participants involved in all operations of the transaction, the request content of the first step of the transaction, the start flag of this transaction, and the local time stamp of the coordinator; the transaction The log requested in step i of the transaction includes: transaction ID, coordinator ID, IDs of all participants involved in the operation of step i of the transaction, request content of step i of the transaction, i, and the local time stamp of the coordinator, where i>1.
进一步的,所述参与者节点处理本地日志,并向协调器节点发送相应的消息的方法为:如果参与者节点对事务的操作请求完成为失败,则需要缓存事务日志,返回信息给协调器节点并回退事务;如果参与者节点对事务的操作请求完成为成功,则只需缓存事务日志,返回信息给协调器节点并等待协调器节点发送事务的操作请求消息。Further, the method for the participant node to process the local log and send a corresponding message to the coordinator node is: if the participant node fails to complete the transaction operation request, it needs to cache the transaction log and return the information to the coordinator node And roll back the transaction; if the operation request of the participant node to the transaction is successful, it only needs to cache the transaction log, return the information to the coordinator node and wait for the coordinator node to send the operation request message of the transaction.
进一步的,所述步骤5)中,如果有一个或一个以上的参与者节点在设定时间内没有返回消息或者返回消息中事务的操作请求完成为失败,则协调器节点判断为事务需要回退;如果所有参与者节点返回消息中事务的操作请求完成为成功,并且参与者节点返回消息中事务的操作请求数等于本事务的操作请求总数,则协调器节点判断为事务可以提交。Further, in step 5), if one or more participant nodes do not return a message within the set time or the operation request of the transaction in the return message is completed as a failure, the coordinator node judges that the transaction needs to be rolled back ; If the operation requests of the transaction in the message returned by all participant nodes are completed successfully, and the number of operation requests of the transaction in the message returned by the participant node is equal to the total number of operation requests of this transaction, the coordinator node judges that the transaction can be submitted.
进一步的,所述步骤5)中,所述事务回退消息包括:事务ID、协调器ID、参与者ID、事务回退决定、事务结束标志、协调器本地时间戳;所述事务提交消息包括:事务ID、协调器ID、参与者ID、事务提交决定、事务结束标志、协调器本地时间戳;协调器节点缓存的本地事务日志包括:事务ID、协调器ID、参与者ID、事务最终决定、事务结束标志、协调器本地时间戳;参与者节点缓存的事务日志包括:本地事务ID、协调器ID、协调器事务ID、参与者ID、事务结束标志、事务最终决定、协调器节点发送的最新时间戳;所述事务最终决定为事务回退决定或事务提交决定。Further, in the step 5), the transaction rollback message includes: transaction ID, coordinator ID, participant ID, transaction rollback decision, transaction end flag, coordinator local timestamp; the transaction commit message includes : transaction ID, coordinator ID, participant ID, transaction commit decision, transaction end flag, coordinator local timestamp; the local transaction log cached by the coordinator node includes: transaction ID, coordinator ID, participant ID, transaction final decision , transaction end flag, coordinator local timestamp; the transaction log cached by the participant node includes: local transaction ID, coordinator ID, coordinator transaction ID, participant ID, transaction end flag, transaction final decision, coordinator node sent The latest timestamp; the final decision of the transaction is a transaction rollback decision or a transaction commit decision.
进一步的,如果所有参与者节点在设定时间内都没有收到协调器节点发出的回退消息或提交消息,则参与者节点首先根据接收到的执行同一事务步骤的参与者名单进行互相询问:Further, if all participant nodes do not receive the rollback message or commit message sent by the coordinator node within the set time, the participant nodes will first query each other according to the received list of participants performing the same transaction steps:
a)如果有参与者的操作请求完成为失败,则所有事务参与者均执行事务回退消息;a) If the operation request of any participant fails, all transaction participants execute the transaction rollback message;
b)如果所有参与者的操作请求完成为成功,则参与者节点继续等待协调器节点发出的消息;b) If the operation requests of all participants are completed successfully, the participant node continues to wait for the message sent by the coordinator node;
c)如果有参与者节点收到回退消息或提交消息,则其余参与者参照执行;c) If a participant node receives a rollback message or a commit message, the rest of the participants refer to it;
d)如果有参与者节点在限定的时间内无法取得联系,并且无法确定事务是否可回退,则继续等待。d) If a participant node cannot be contacted within a limited time and cannot determine whether the transaction can be rolled back, continue to wait.
进一步的,如果协调器节点失效,则在协调器节点重启之后首先查找本地最后的事务结束日志的时戳,然后询问所有的参与者节点在此时间之前未结束的本协调器发起的事务记录:Further, if the coordinator node fails, after the coordinator node restarts, first look for the timestamp of the last local transaction end log, and then ask all participant nodes for transaction records initiated by the coordinator that have not ended before this time:
a)如果有一个或以上的参与者节点回复的日志表明事务已自行回退,则协调器节点整理接收到的日志以恢复本地日志,保存事务回退记录并重新通知所有参与者该事务回退;a) If one or more participant nodes reply to the log indicating that the transaction has rolled back by itself, the coordinator node sorts the received log to restore the local log, saves the transaction rollback record and re-notifies all participants that the transaction rolls back ;
b)如果所有参与者均回复的日志表明事务仍在等待,则协调器节点整理接收到的日志以恢复本地日志,根据事务的执行情况决定事务提交或者回退;b) If the log replied by all participants indicates that the transaction is still waiting, the coordinator node sorts the received log to restore the local log, and decides whether to commit or roll back the transaction according to the execution of the transaction;
c)如果有参与者尚未从参与者节点失效中恢复,不具有全部的日志;或者有参与者无法取得联系,则认为事务回退,协调器节点整理接收到的日志以恢复本地日志,写入回退日志并在与参与者节点恢复联系后向参与者节点发送事务决定。c) If a participant has not recovered from the failure of the participant node and does not have all the logs; or if a participant cannot be contacted, it is considered that the transaction is rolled back, and the coordinator node organizes the received logs to restore the local log and writes Roll back the log and send the transaction decision to the participant node after contact with the participant node is restored.
为了减少事务频繁的强制日志操作,本发明首先在系统参与者节点和协调器节点内存中各分配一定的缓存区域,用来缓存事务日志。对于参与者节点,当缓存区域满或者缓存超过一定时间之后或者强制写日志时,将缓存日志一次性写入磁盘。对于协调器节点,则在每次事务开始时,将缓存日志一次性写入。In order to reduce the forced log operation with frequent transactions, the present invention first allocates a certain cache area in the memory of the system participant node and the coordinator node to cache the transaction log. For participant nodes, when the cache area is full or the cache exceeds a certain period of time or when the log is forced to be written, the cache log is written to the disk at one time. For the coordinator node, the cache log is written once at the beginning of each transaction.
在事务开始前,协调器节点根据事务内容寻找对应的参与者,将事务各指令发送到对应参与者节点执行。然后通过协调器节点与参与者节点间进行的信息传递和协调器节点时间戳来保证整个事务执行过程的原子性,以及故障时的可恢复性,并增加了系统的灵活性。整个方法分为两个方面:Before the transaction starts, the coordinator node searches for the corresponding participant according to the transaction content, and sends each instruction of the transaction to the corresponding participant node for execution. Then, the atomicity of the entire transaction execution process and the recoverability in case of failure are guaranteed through the information transfer between the coordinator node and the participant node and the time stamp of the coordinator node, and the flexibility of the system is increased. The whole method is divided into two aspects:
第一方面进行事务准备。包括:根据事务内容寻找所涉及的资源,确定资源所在的节点;为应用程序建立到多个资源中的每个资源的连接;确定当前事务的上下文。The first aspect is business preparation. Including: looking for the resources involved according to the content of the transaction, determining the node where the resource is located; establishing a connection to each of the multiple resources for the application; determining the context of the current transaction.
第二方面为了保证事务的顺利进行,严格执行信息传递的步骤和要求。The second aspect is to ensure the smooth progress of affairs, strictly implement the steps and requirements of information transmission.
具体而言,本发明的分布式事务提交方案可以通过以下步骤实现:Specifically, the distributed transaction submission scheme of the present invention can be realized through the following steps:
1)协调器节点根据事务内容查找需要使用的资源,确定资源所在的节点(即确定参与者节点);建立到资源的连接;确定当前协调器节点中是否存在缓存日志,确定事务的各个操作请求,以及请求总数。1) The coordinator node searches for the resources to be used according to the transaction content, determines the node where the resource is located (that is, determines the participant node); establishes a connection to the resource; determines whether there is a cache log in the current coordinator node, and determines each operation request of the transaction , and the total number of requests.
2)协调器节点向参与者节点发送事务的操作请求消息。在此消息中,包含协调器ID,协调器本地时间戳TimeStamp,事务单步请求内容,以及涉及此单步请求的所有参与者ID,2) The coordinator node sends an operation request message of the transaction to the participant node. This message contains the coordinator ID, the coordinator's local timestamp TimeStamp, the content of the transaction's single-step request, and the IDs of all participants involved in this single-step request,
协调器本地的事务ID。消息格式如下:Coordinator-local transaction ID. The message format is as follows:
其中i表明本次请求为事务第i步操作。Where i indicates that this request is the i-th step operation of the transaction.
同时,协调器节点根据事务请求情况写日志:At the same time, the coordinator node writes the log according to the transaction request:
①如果是一个新的事务,则强制写入事务开始日志。如果在1)中确认当前协调器节点中存在事务缓存日志,则将缓存日志与事物开始日志一同刷新入磁盘。如果在1)中确认当前协调器节点不存在事务缓存日志,只需强制写入事务开始日志。① If it is a new transaction, it is forced to write to the transaction start log. If it is confirmed in 1) that there is a transaction cache log in the current coordinator node, the cache log and the transaction start log are flushed to the disk together. If it is confirmed in 1) that the current coordinator node does not have a transaction cache log, only the transaction start log is forced to be written.
事务开始日志格式如下:The transaction start log format is as follows:
其中,start为本次事务开始标志,表明本次事务开始,也可以用“1”表示。参与者ID为参与此事务所有步骤的所有参与者ID。Among them, start is the start flag of this transaction, which indicates the start of this transaction, and can also be represented by "1". Participant IDs are the IDs of all participants participating in all steps of this transaction.
②如果是事务的第i步请求,则缓存本次日志。②If it is the i-th step request of the transaction, cache this log.
事务第i步请求日志格式Transaction step i request log format
其中,i>1。参与者ID为参与事务第i步的参与者ID。Wherein, i>1. Participant ID is the ID of the participant participating in step i of the transaction.
3)参与者根据事务的操作请求完成情况处理本地日志,并向协调器节点发送消息。本地日志和消息均需根据步骤2)中接收到的消息加入相应信息。3) The participant processes the local log according to the completion of the operation request of the transaction, and sends a message to the coordinator node. Both local logs and messages need to add corresponding information according to the messages received in step 2).
消息格式如下:The message format is as follows:
其中,“协调器事务ID”是步骤2)中传递的本次事务在协调器节点对应的“事务ID”;“本参与者ID”即为本地参与者的ID信息;“i”表明本次操作请求为事务的第i次请求,根据步骤2)中传递的信息可得;“vote”为事务的操作请求完成情况说明,可为“yes”或“no”,分别对应事务的操作请求成功或失败;“TimeStamp”为本消息对应的协调器消息中包含的时间戳。Among them, "coordinator transaction ID" is the "transaction ID" corresponding to the transaction in the coordinator node transmitted in step 2); "this participant ID" is the ID information of the local participant; "i" indicates that this transaction The operation request is the i-th request of the transaction, which can be obtained according to the information transmitted in step 2); "vote" is the completion status of the operation request of the transaction, which can be "yes" or "no", corresponding to the success of the operation request of the transaction or fail; "TimeStamp" is the timestamp contained in the coordinator message corresponding to this message.
日志格式如下:The log format is as follows:
其中,“本地事务ID”为本次事务的操作请求在参与者节点本地对应的事务ID。“OP”为事务单步请求内容,从协调器节点传递的消息可得。Among them, the "local transaction ID" is the transaction ID corresponding to the operation request of this transaction in the participant node. "OP" is the transaction single-step request content, which can be obtained from the message delivered by the coordinator node.
如果参与者节点没有完成事务的操作请求,则需要缓存日志,返回信息给协调器节点并立即回退事务。如果参与者节点完成了事务的操作请求,则只需缓存日志,返回信息给协调器节点并等待协调器节点的进一步指示。If the participant node does not complete the operation request of the transaction, it needs to cache the log, return the information to the coordinator node and roll back the transaction immediately. If the participant node completes the operation request of the transaction, it only needs to cache the log, return the information to the coordinator node and wait for further instructions from the coordinator node.
如果在缓存日志之前,检查到本地日志缓存区域已满,或者最陈旧的日志到达最长缓存时间,则强制写入日志,再向协调器节点发送对应消息。If before the log is cached, it is checked that the local log cache area is full, or the oldest log reaches the maximum cache time, the log is forced to be written, and a corresponding message is sent to the coordinator node.
4)协调器节点接收参与者节点信息,分析投票结果,并向参与者节点发送消息。4) The coordinator node receives the participant node information, analyzes the voting results, and sends a message to the participant node.
①如果有一个或以上的参与者节点没有及时投票或者投票结果为“no”,事务需要回退。在这种情况下,协调器节点缓存本地日志,向所有投票“yes”的参与者节点传送事务回退消息。本缓存日志可随下一次协调器节点的强制日志记录操作一起写入。进入步骤5)。① If one or more participant nodes fail to vote in time or the voting result is "no", the transaction needs to be rolled back. In this case, the coordinator node caches the local log and sends a transaction rollback message to all participant nodes that voted "yes". This cached log can be written with the next coordinator node's forced logging operation. Go to step 5).
消息格式如下:The message format is as follows:
日志格式如下:The log format is as follows:
其中,“end”表明事务结束,可以用“0”表示。Among them, "end" indicates the end of the transaction, which can be represented by "0".
②如果所有参与者均投票为“yes”,并且参与者节点返回的信息中表明的事务的操作请求数i也符合1)中确定的本事务的操作请求总数,则事务可以提交。在这种情况下,协调器节点缓存本地日志,向本事务的所有参与者节点发送提交消息。本缓存日志可随下一次协调器节点的强制日志记录操作一起写入。进入步骤5)。②If all participants vote "yes", and the number of operation requests i of the transaction indicated in the information returned by the participant node also conforms to the total number of operation requests of this transaction determined in 1), the transaction can be submitted. In this case, the coordinator node caches the local log and sends a commit message to all participant nodes of the transaction. This cached log can be written with the next coordinator node's forced logging operation. Go to step 5).
消息格式如下:The message format is as follows:
日志格式如下:The log format is as follows:
其中,“end”表明事务结束,可以用“0”表示。Among them, "end" indicates the end of the transaction, which can be represented by "0".
③如果所有参与者节点投票均为“yes”并且事务尚未完成,则回到步骤2)。③If all participant nodes vote "yes" and the transaction has not been completed, go back to step 2).
5)参与者节点按照最终决定执行并缓存日志。日志结构如下:5) Participant nodes execute and cache logs according to the final decision. The log structure is as follows:
其中,“end”表明事务结束;“fi”为事务最终决定,为“commit”或者“abort”。Among them, "end" indicates the end of the transaction; "fi" is the final decision of the transaction, which is "commit" or "abort".
如果在缓存日志之前,检查到本地日志缓存区域已满,或者最陈旧的日志到达最长缓存时间,则强制写入日志,再执行要求的操作。If before the log is cached, it is checked that the local log cache area is full, or the oldest log reaches the maximum cache time, the log is forced to be written, and then the required operation is performed.
分布式系统中出现的故障分为两类:一类为网络原因造成的通信故障,另一类为协调器节点或参与者节点失效(site failure)。以下分别介绍这两种故障的处理方法。The faults in the distributed system are divided into two categories: one is the communication failure caused by the network, and the other is the coordinator node or participant node failure (site failure). The following describes how to deal with these two faults.
对于通信故障,如果出现在步骤2)中,参与者节点可能全部接受不到协调器节点的请求,协调器节点待等待超时后,可自主决定回退事务;或者部分参与者节点没有接收到请求,这种情况下,协调器节点会认为没有应答的参与者节点已经回退事务,所以,协调器节点决定回退事务。For communication failures, if it occurs in step 2), all participant nodes may not be able to accept the request of the coordinator node, and the coordinator node can decide to roll back the transaction independently after waiting for a timeout; or some participant nodes have not received the request , in this case, the coordinator node will think that the non-responsive participant node has rolled back the transaction, so the coordinator node decides to roll back the transaction.
如果出现在步骤3)中,则可能协调器节点不能接收到所有参与者节点的投票,在这种情况下,协调器节点认为,没有投票的参与者节点已经回退事务,所以决定回退事务。If it appears in step 3), it is possible that the coordinator node cannot receive the votes of all participant nodes. In this case, the coordinator node believes that the participant nodes without votes have rolled back the transaction, so it decides to roll back the transaction .
如果出现在步骤4)中,则可能所有参与者节点都没有收到最终决定,在这种情况下,参与者节点首先会根据接收到的执行同一事务的参与者名单进行互相询问:如果有参与者的投票为回退事务,则所有事务参与者均可依此回退事务,并向询问过此消息的参与者回复事务回退消息;如果可取得联系的所有参与者的投票均为提交事务,由于参与者节点不能判断事务是否已执行完全部请求,也不能判定自己持有的参与者名单是否包括所有参与者,所以需要继续等待协调器节点的最终决定;或者有部分参与者收到最终决定,则其余参与者可依此执行最终决定,并向询问过此消息的参与者回复事务最终决定;如果有部分参与者节点在限定的时间内无法取得联系,并且无法确定事务是否可回退,则应继续等待。If it appears in step 4), it is possible that all participant nodes have not received the final decision. In this case, the participant nodes will first ask each other according to the received list of participants performing the same transaction: If the vote of the participant is to roll back the transaction, all transaction participants can roll back the transaction accordingly, and reply the transaction rollback message to the participant who has inquired about this message; if the vote of all the participants who can be contacted is to commit the transaction , because the participant node cannot judge whether the transaction has completed all requests, nor can it judge whether the participant list it holds includes all participants, so it needs to continue to wait for the final decision of the coordinator node; or some participants receive the final If the decision is made, the rest of the participants can implement the final decision accordingly, and reply the final decision of the transaction to the participant who has inquired about this message; if some participant nodes cannot be contacted within the limited time, and it is impossible to determine whether the transaction can be rolled back , you should continue to wait.
协调器节点失效的情况,可分成两类来讨论。The failure of the coordinator node can be divided into two categories for discussion.
如果协调器节点失效,在协调器节点重启之后,会首先查找本地最后的事务结束日志的时戳。然后询问所有的参与者节点在此时间之前未结束的本协调器发起的事务记录。各参与者节点返回此事务相关的日志,情况可分为三种:①日志表明事务已自行回退。由于长时间无法获得协调器节点的消息,参与者节点必然等待超时,然后互相发起询问,如果有任何一个参与者节点的投票结果为no,此事务可自行回退。如果协调器节点接到一个或以上参与者节点回复的事务回退消息,协调器节点整理接收到的日志以恢复本地日志,并重新通知所有参与者该事务回退即可。②日志表明事务仍在等待。如果所有参与者节点均回复事务等待中,此时,协调器节点整理接收到的日志以恢复本地日志,并根据事务的执行情况决定事务提交或者回退。③如果有参与者尚未从参与者节点失效中恢复,不具有全部的日志,或者无法取得联系,则认为事务回退,协调器节点整理接收到的日志以恢复本地日志,写入回退日志并在与参与者节点恢复联系后向参与者节点发送决定。If the coordinator node fails, after the coordinator node restarts, it will first look for the timestamp of the last local transaction end log. Then ask all participant nodes for transaction records initiated by the coordinator that have not ended before this time. Each participant node returns the log related to this transaction, which can be divided into three situations: ① The log indicates that the transaction has rolled back by itself. Since the message of the coordinator node cannot be obtained for a long time, the participant nodes must wait for the timeout, and then initiate inquiries with each other. If any participant node votes no, the transaction can be rolled back by itself. If the coordinator node receives a transaction rollback message from one or more participant nodes, the coordinator node sorts the received logs to restore the local log, and re-informs all participants that the transaction rolls back. ② The log indicates that the transaction is still waiting. If all participant nodes reply that the transaction is waiting, at this time, the coordinator node sorts the received log to restore the local log, and decides to commit or roll back the transaction according to the execution of the transaction. ③If a participant has not recovered from the failure of the participant node, does not have all the logs, or cannot get in touch, it is considered that the transaction is rolled back, and the coordinator node sorts the received logs to restore the local log, writes the rollback log and Send the decision to the participant node after contact with the participant node is restored.
在此过程中,如果有参与者节点被通知某事务回退,但是此参与者自身已经遗失了事务相关的记录,需再次请求协调器节点事务相关日志。During this process, if a participant node is notified of a transaction rollback, but the participant itself has lost transaction-related records, it needs to request the coordinator node transaction-related logs again.
如果参与者节点失效,在参与者节点重启之后,会首先查找本地静态日志的最后时戳,然后询问协调器节点在此时间之后的事务情况。根据协调器节点的日志记录进行恢复即可。If the participant node fails, after the participant node restarts, it will first find the last timestamp of the local static log, and then ask the coordinator node about the transaction after this time. It is enough to recover according to the log records of the coordinator node.
同传统2PC相比,本事务提交方法具有以下优点:Compared with traditional 2PC, this transaction submission method has the following advantages:
1)对于有n个参与者节点和1个协调器节点的分布式系统,只需要进行1次强制日志记录,对比传统2PC需要2n次强制日志记录,大大减少了日志操作次数,提高了系统效率。1) For a distributed system with n participant nodes and 1 coordinator node, only one mandatory log record is required, compared with traditional 2PC which requires 2n mandatory log records, which greatly reduces the number of log operations and improves system efficiency .
2)信息交换的数量从4n条变为2n_op+n,其中n_op是事务总共进行的操作数。例如,假设事务请求总共为k步,每次请求大约有60%的参与者节点参与此事务,则n_op=k*60%*n。对于通常情况下的只包含一个请求的事务,n_op=60%*n,此时的信息交换数量为2.2n,要远远小于传统2PC的4n条的信息交换量。2) The number of information exchanges is changed from 4n to 2n_op+n, where n_op is the total number of operations performed by the transaction. For example, assuming that the total number of transaction requests is k steps, about 60% of the participant nodes participate in the transaction for each request, then n_op=k*60%*n. For a transaction containing only one request under normal circumstances, n_op=60%*n, the number of information exchanges at this time is 2.2n, which is much smaller than the 4n information exchanges of traditional 2PC.
3)利用参与者名单在参与者之间互相进行询问,可以减少通信故障中一些情况下参与者的等待时间,提高事务效率,并具有极高的可用性,对于可确定事务回退的情况,可有效解决传统2PC在网络拥塞的情况下,事务排队等待的状况。将消息中传递的参与者名单限制在参与同一事务步骤的参与者中,也很好的控制了询问规模。3) Use the participant list to inquire among participants, which can reduce the waiting time of participants in some cases of communication failure, improve transaction efficiency, and have extremely high availability. Effectively solve the traditional 2PC situation where transactions are queued and waited in the case of network congestion. Restricting the list of participants in the message to those participating in the same transaction step also controls the size of the query.
参与者节点的日志均采用缓存策略,当缓存空间满,或者到达缓存时间上限时,即可一次性写入磁盘。日志的安全性简单说明如下:The logs of the participant nodes all adopt a cache strategy. When the cache space is full or the upper limit of the cache time is reached, they can be written to the disk at one time. The security of the log is briefly described as follows:
设一台主机出现故障的概率为常数λ,则主机的平均无故障时间(MTTF)为1/λ。由于主机间出现故障的概率是相互独立的,主机数为n,则在时间0到t内,所有主机出现故障的概率应当为p=(1-e-λt)n。设单台主机的MTTF为T,则λ=1/T,所以
p=(0.00016665277854932547)n≈(2×10-4)n由于协调器节点每次强制日志记录操作会将系统中所有的缓存日志一并写入磁盘,日志缓存的时间被缩短,相应日志丢失的概率更小。p=(0.00016665277854932547) n ≈(2×10 -4 ) nBecause the coordinator node will write all the cached logs in the system to the disk for each mandatory logging operation, the log cache time is shortened, and the corresponding log loss less likely.
附图说明 Description of drawings
图1是传统两阶段提交协议的流程。Figure 1 is the flow of the traditional two-phase commit protocol.
图2是本发明的事务提交流程。Fig. 2 is the transaction submission process of the present invention.
具体实施方式 Detailed ways
下面结合附图和一个范例对本发明做进一步详细的说明,但不以任何方式限制本发明的范围。The present invention will be described in further detail below with reference to the accompanying drawings and an example, but the scope of the present invention is not limited in any way.
考虑如下例子。一个商业连锁店,有一个中央机构和n个不同的销售店。中央机构用来保存员工数据,整个连锁店的货物种类及各个销售点的存货种类等;销售店保存本店的销售和存货数据。如果经理要查询所有商店,找出所有店中牙刷的存货数量,并将所有存货不足300的商店存货补足300。Consider the following example. A commercial chain has a central organization and n different sales outlets. The central organization is used to save employee data, the types of goods of the entire chain store and the inventory types of each point of sale, etc.; the sales store keeps the sales and inventory data of the store. If the manager wants to query all stores, find out the inventory quantity of toothbrushes in all stores, and make up the inventory of all stores with less than 300 to 300.
假设数据情况如下:Suppose the data situation is as follows:
商店1,2,3,4,5存货中包含牙膏,存量分别为100,200,300,400,500。协调器节点事务ID为654321;每个参与者节点事务ID分别为154321,254321,354321,454321,554321;协调器节点ID为″X″,其余参与者节点ID依次为“A”“B”“C”“D”“E”;事务请求可分为两次完成,分别为查询请求op_1和更新请求op_2。参与者节点的投票结果为yes或no。Stores 1, 2, 3, 4, and 5 contain toothpaste in inventory, and the inventory is 100, 200, 300, 400, and 500 respectively. The coordinator node transaction ID is 654321; each participant node transaction ID is 154321, 254321, 354321, 454321, 554321 respectively; the coordinator node ID is "X", and the other participant node IDs are "A" and "B"" C" "D" "E"; the transaction request can be divided into two completions, namely the query request op_1 and the update request op_2. The voting results of the participant nodes are yes or no.
事务的执行步骤如下:The execution steps of the transaction are as follows:
1)提交事务的节点,即经理所在的节点自动成为协调器节点。协调器节点根据自己保存的记录确定哪些商店的存货种类包含牙膏,建立到这些数据库的连接。也就是确定商店1,2,3,4,5为参与者节点并建立到这些节点的连接。查看自身日志缓存区域,确定是否有缓存的日志尚未写入静态存储系统。1) The node that submits the transaction, that is, the node where the manager is located automatically becomes the coordinator node. The coordinator node determines from the records it keeps which stores have toothpaste in its inventory category and establishes connections to these databases. That is, determine stores 1, 2, 3, 4, and 5 as participant nodes and establish connections to these nodes. Check its own log cache area to determine whether there are cached logs that have not been written to the static storage system.
2)协调器节点向所有参与者节点发送事务消息。消息格式为:2) The coordinator node sends transaction messages to all participant nodes. The message format is:
同时,协调器节点强制写入日志。日志结构At the same time, the coordinator node is forced to write to the log. log structure
如果在1)中确定有缓存的日志未写入静态存储系统,则一同写入。If it is determined in 1) that the cached logs are not written to the static storage system, write them together.
3)如果参与者节点完成Op_1事务请求,则缓存本地日志并将投票发送给协调器节点。各个参与者节点的日志结构和发送的消息分别如下:3) If the participant node completes the Op_1 transaction request, cache the local log and send the vote to the coordinator node. The log structure and sent messages of each participant node are as follows:
参与者节点1:Participant node 1:
日志格式:Log format:
消息格式:Message format:
参与者节点2:Participant node 2:
日志格式:Log format:
消息格式:Message format:
参与者节点3:Participant node 3:
日志格式:Log format:
消息格式:Message format:
参与者节点4:Participant node 4:
日志格式:Log format:
消息格式:Message format:
参与者节点5:Participant node 5:
日志格式:Log format:
消息格式:Message format:
如果参与者节点没有完成事务请求,则缓存事务回退日志并回退事务。日志结构和消息格式同上,只需要将对应的yes换成no即可。If the participant node does not complete the transaction request, the transaction rollback log is cached and the transaction is rolled back. The log structure and message format are the same as above, just replace the corresponding yes with no.
在缓存日志之前,检查是否需要强制写入日志,如果需要,则先强制写入日志,再进行其他操作。Before caching the log, check whether it is necessary to force the log to be written, and if so, force the log to be written first before performing other operations.
4)协调器节点分析投票结果。如果第3)步中所有的参与者节点都返回yes消息,事务进入步骤5);否则进入步骤7)。4) The coordinator node analyzes the voting results. If all participant nodes in step 3) return a yes message, the transaction enters step 5); otherwise, enters step 7).
5)协调器节点向所有参与者节点发送事务消息。消息格式为:5) The coordinator node sends transaction messages to all participant nodes. The message format is:
同时,协调器节点缓存日志。日志结构Meanwhile, the coordinator node caches the logs. log structure
6)如果参与者节点完成Op_2事务请求,则缓存本地日志并将投票发送给协调器节点。各个参与者节点的日志结构和发送的消息分别如下:6) If the participant node completes the Op_2 transaction request, cache the local log and send the vote to the coordinator node. The log structure and sent messages of each participant node are as follows:
参与者节点1:Participant node 1:
日志格式:Log format:
消息格式:Message format:
参与者节点2:Participant node 2:
日志格式:Log format:
消息格式:Message format:
如果参与者节点没有完成Op_2事务请求,则缓存事务回退日志并回退事务。日志结构和消息格式同上,只需要将对应的yes换成no即可。If the participant node does not complete the Op_2 transaction request, cache the transaction rollback log and roll back the transaction. The log structure and message format are the same as above, just replace the corresponding yes with no.
在缓存日志之前,检查是否需要强制写入日志,如果需要,则先强制写入日志,再进行其他操作。Before caching the log, check whether it is necessary to force the log to be written, and if so, force the log to be written first before performing other operations.
7)协调器节点根据投票结果决定事务下一步操作。7) The coordinator node decides the next step of the transaction according to the voting result.
如果有一个或以上的参与者节点没有及时投票或者投票为“no”,则事务需要回退。在这种情况下,协调器节点缓存本地日志,向所有投票yes的节点传送事务回退消息。本缓存日志可随下一次协调器节点的强制日志记录操作一起写入。If one or more participant nodes fail to vote in time or vote "no", the transaction needs to be rolled back. In this case, the coordinator node caches the local log and sends a transaction rollback message to all nodes that voted yes. This cached log can be written with the next coordinator node's forced logging operation.
消息格式如下:The message format is as follows:
日志格式如下:The log format is as follows:
如果所有参与者节点均投票“yes”,并且为事务步骤数为2,则事务可以提交。在这种情况下,协调器节点缓存本地日志,向所有参与者节点发送提交消息。If all participant nodes vote "yes" and the number of steps for the transaction is 2, the transaction can be committed. In this case, the coordinator node caches the local log and sends commit messages to all participant nodes.
消息格式如下:The message format is as follows:
日志格式如下:The log format is as follows:
8)参与者节点按照最终决定缓存日志并执行。日志结构如下:8) The participant node caches the log and executes it according to the final decision. The log structure is as follows:
最终决定为提交时:When the final decision is submitted:
参与者节点1:Participant node 1:
其余参与者节点只需替换本地事务ID即可。The remaining participant nodes only need to replace the local transaction ID.
如果最终决定为回退事务,只需将Commit替换为Abort即可。If the final decision is to roll back the transaction, just replace Commit with Abort.
按照此流程,成功执行此事务需要交换信息数量为19条,强制日志记录1次。若按照传统2PC,除去事务请求发送阶段的通信,还需要交换信息20条,强制日志记录11次。由此可见,本发明采用的方法具有明显的优势。According to this process, the successful execution of this transaction requires 19 pieces of exchanged information, and one forced log record. According to the traditional 2PC, excluding the communication in the transaction request sending stage, 20 pieces of information need to be exchanged, and 11 times of forced log records are required. It can be seen that the method adopted in the present invention has obvious advantages.
Claims (7)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2009102382705A CN101706811B (en) | 2009-11-24 | 2009-11-24 | Transaction commit method of distributed database system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2009102382705A CN101706811B (en) | 2009-11-24 | 2009-11-24 | Transaction commit method of distributed database system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN101706811A CN101706811A (en) | 2010-05-12 |
| CN101706811B true CN101706811B (en) | 2012-01-25 |
Family
ID=42377036
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN2009102382705A Expired - Fee Related CN101706811B (en) | 2009-11-24 | 2009-11-24 | Transaction commit method of distributed database system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN101706811B (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105574217A (en) * | 2016-03-16 | 2016-05-11 | 中国联合网络通信集团有限公司 | Data synchronization method and device of distributed relational database |
Families Citing this family (27)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102521112A (en) * | 2011-11-18 | 2012-06-27 | 深圳中兴网信科技有限公司 | Memory-based reading and writing method of log information |
| CN102693312B (en) * | 2012-05-28 | 2014-05-28 | 清华大学 | Flexible transaction management method in key-value store data storage |
| US9672237B2 (en) * | 2013-03-15 | 2017-06-06 | Amazon Technologies, Inc. | System-wide checkpoint avoidance for distributed database systems |
| CN103399790B (en) * | 2013-08-20 | 2016-12-28 | 浙江中控技术股份有限公司 | A kind of affairs based on distributed real-time database system submit method and device to |
| CN104220982B (en) * | 2013-10-29 | 2017-03-29 | 华为技术有限公司 | A transaction processing method and device |
| CN106997305B (en) * | 2013-10-29 | 2020-09-29 | 华为技术有限公司 | Transaction processing method and device |
| EP3514693A1 (en) | 2013-10-29 | 2019-07-24 | Huawei Technologies Co., Ltd. | Transaction processing method and apparatus |
| CN105721337B (en) * | 2014-12-04 | 2019-06-25 | 中国移动通信集团公司 | Distributed transaction processing method and device in software defined network |
| CN105824842B (en) * | 2015-01-07 | 2019-05-10 | 阿里巴巴集团控股有限公司 | Distributed transaction processing method and system |
| CN105989164B (en) * | 2015-03-04 | 2019-08-09 | 阿里巴巴集团控股有限公司 | Rollback processing method and processing device |
| WO2016169048A1 (en) * | 2015-04-24 | 2016-10-27 | Hewlett Packard Enterprise Development Lp | Transaction management and committing |
| CN106325978B (en) * | 2015-06-19 | 2020-06-30 | 阿里巴巴集团控股有限公司 | Distributed transaction processing method and device |
| KR102074087B1 (en) * | 2015-07-10 | 2020-02-05 | 아브 이니티오 테크놀로지 엘엘시 | Method and architecture for providing database access control in networks with distributed database systems |
| CN106897288B (en) * | 2015-12-18 | 2021-01-08 | 阿里巴巴集团控股有限公司 | Service providing method and system for database |
| CN107122354B (en) * | 2016-02-24 | 2020-05-08 | 华为技术有限公司 | Transaction execution method, device and system |
| CN107644025B (en) * | 2016-07-20 | 2021-03-16 | 阿里巴巴集团控股有限公司 | Method and device for distributing WAL records of distributed database |
| CN106412116A (en) * | 2016-11-17 | 2017-02-15 | 上海斐讯数据通信技术有限公司 | Method and device for distributed processing on logging in of user by cloud access controller |
| CN106776130B (en) * | 2016-11-30 | 2020-07-28 | 华为技术有限公司 | A log recovery method, storage device and storage node |
| CN108055296B (en) * | 2017-11-30 | 2020-11-27 | 北京中电普华信息技术有限公司 | A transaction processing method and device based on microservice architecture |
| CN110196760B (en) * | 2018-07-12 | 2023-04-18 | 腾讯科技(深圳)有限公司 | Method and device for realizing consistency of distributed transactions |
| CN110008271B (en) * | 2019-04-04 | 2020-12-15 | 航天云网科技发展有限责任公司 | Micro-service transaction submitting method based on single database |
| CN110134735A (en) * | 2019-04-10 | 2019-08-16 | 阿里巴巴集团控股有限公司 | The storage method and device of distributed transaction log |
| CN111078451B (en) * | 2019-08-05 | 2021-05-11 | 腾讯科技(深圳)有限公司 | Distributed transaction processing method and device, computer equipment and storage medium |
| CN111858629B (en) * | 2020-07-02 | 2023-08-22 | 北京奥星贝斯科技有限公司 | Implementation method and device for two-phase commit distributed transaction update database |
| CN114238353A (en) * | 2021-12-21 | 2022-03-25 | 山东浪潮科学研究院有限公司 | Method and system for realizing distributed transaction |
| CN115145697B (en) * | 2022-07-05 | 2023-07-25 | 中电金信软件有限公司 | Database transaction processing method and device and electronic equipment |
| CN115658805B (en) * | 2022-09-15 | 2023-10-17 | 星环信息科技(上海)股份有限公司 | Transaction consistency management engine and method |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1798031A (en) * | 2004-12-27 | 2006-07-05 | 北京航空航天大学 | Transaction processing system and transaction method for Web service |
| CN101341466A (en) * | 2005-12-19 | 2009-01-07 | 国际商业机器公司 | Commitment of Transactions in Distributed Systems |
-
2009
- 2009-11-24 CN CN2009102382705A patent/CN101706811B/en not_active Expired - Fee Related
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1798031A (en) * | 2004-12-27 | 2006-07-05 | 北京航空航天大学 | Transaction processing system and transaction method for Web service |
| CN101341466A (en) * | 2005-12-19 | 2009-01-07 | 国际商业机器公司 | Commitment of Transactions in Distributed Systems |
Non-Patent Citations (1)
| Title |
|---|
| 尹瑞等.Web服务事务处理系统的研究与实现.《北京航空航天大学学报》.2005,第31卷(第4期),439-442. * |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105574217A (en) * | 2016-03-16 | 2016-05-11 | 中国联合网络通信集团有限公司 | Data synchronization method and device of distributed relational database |
| CN105574217B (en) * | 2016-03-16 | 2019-04-30 | 中国联合网络通信集团有限公司 | Data synchronization method and device for distributed relational database |
Also Published As
| Publication number | Publication date |
|---|---|
| CN101706811A (en) | 2010-05-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN101706811B (en) | Transaction commit method of distributed database system | |
| US7900085B2 (en) | Backup coordinator for distributed transactions | |
| US7260589B2 (en) | High performance support for XA protocols in a clustered shared database | |
| US6438582B1 (en) | Method and system for efficiently coordinating commit processing in a parallel or distributed database system | |
| JP3790589B2 (en) | Commitment method for distributed database transactions | |
| CN103473318B (en) | A kind of distributed transaction support method towards memory data grid | |
| US10366106B2 (en) | Quorum-based replication of data records | |
| CN112995262B (en) | Distributed transaction commit method, system and computing device | |
| US20130110781A1 (en) | Server replication and transaction commitment | |
| US6823355B1 (en) | Synchronous replication of transactions in a distributed system | |
| US12111817B2 (en) | Log execution method and apparatus, computer device and storage medium | |
| CN102571850B (en) | Transaction committing system, method and equipment | |
| US8352421B2 (en) | Recording distributed transactions using probabalistic data structures | |
| US20060095438A1 (en) | Non-blocking commit protocol systems and methods | |
| CN111259071A (en) | Concurrent access control method in distributed database system | |
| CN101341466A (en) | Commitment of Transactions in Distributed Systems | |
| CN102073540A (en) | Distributed affair submitting method and device thereof | |
| CN111813583B (en) | Transaction management method, device, equipment and storage medium under micro-service architecture | |
| CN116348865A (en) | Highly available, high performance, persistent storage optimized scaled database | |
| US7693882B2 (en) | Replicating data across the nodes in a cluster environment | |
| EP1704480B1 (en) | Cluster database with remote data mirroring | |
| CN113905054A (en) | Kudu cluster data synchronization method, device and system based on RDMA | |
| CN113568716A (en) | A transaction processing method, device, electronic device and storage medium | |
| Keleher et al. | Consistency management in deno | |
| CN117234670A (en) | Distributed transaction processing method, system, computer equipment and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20120125 Termination date: 20181124 |
|
| CF01 | Termination of patent right due to non-payment of annual fee |
