CN105763519A - Consistency control method, device and system - Google Patents

Consistency control method, device and system Download PDF

Info

Publication number
CN105763519A
CN105763519A CN201410795095.0A CN201410795095A CN105763519A CN 105763519 A CN105763519 A CN 105763519A CN 201410795095 A CN201410795095 A CN 201410795095A CN 105763519 A CN105763519 A CN 105763519A
Authority
CN
China
Prior art keywords
resolution
packet
receiver node
node
negotiation
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.)
Pending
Application number
CN201410795095.0A
Other languages
Chinese (zh)
Inventor
张真波
汪周林
杨振华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201410795095.0A priority Critical patent/CN105763519A/en
Publication of CN105763519A publication Critical patent/CN105763519A/en
Pending legal-status Critical Current

Links

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

An embodiment of the invention discloses a consistency control method, device and system applied to a message transmission based negotiation process. The implementation of the method includes packaging an obtained decision and obtaining a decision packet after a coordination node obtains a decision, wherein the decision packet includes at least two decisions; sending the decision packet to a receiver node which is corresponding to decisions in the decision packet; receiving the confirmation information returned by the decision node and determining that the receiver node returning the confirmation information confirms the decisions corresponding to the confirmation information; determining whether the decisions in the decision packet are passed or not through negotiation according to the confirmation information returned by the receiver node; submitting the decisions in the decision packet if the decisions in the decision packet are passed through negotiation. At least two decisions can be negotiated in a single negotiation process, so that decision negotiation efficiency can be improved. Besides, requirements for communication protocols during a negotiation process can be reduced.

Description

Consistency control method, device and system
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, and a system for consistency control.
Background
At present, a consistency algorithm is used in the distributed system to ensure the data consistency of most nodes in the distributed system. A general consistency algorithm that can be applied in a variety of distributed system scenarios is an important fundamental issue for distributed systems. The problem solved by the Paxos algorithm (message-passing based consistency algorithm) is how to agree on a certain value (i.e. resolution) in a distributed system.
A typical scenario is: in a distributed database system, if the initial states of the nodes are consistent and each node executes the same sequence of operations, then the states they can finally obtain need to be consistent. To ensure that each node executes the same sequence of commands, a "consistency algorithm" needs to be executed on each instruction to ensure that the instructions obtained by each node are consistent. There are two models of node communication: shared memory (Sharedmemory) and messaging (messagescheduling). The Paxos algorithm is a consistency algorithm based on a message passing model.
The Paxos algorithm generally consists of three phases: election coordination (leader) nodes, recovery and negotiation. The embodiment of the invention mainly relates to the method based on the condition that a leader is selected externally, and the whole algorithm is divided into two stages: a recovery procedure and a negotiation procedure.
The recovery flow in the Paxos algorithm is as follows: the new Leader specifies that other nodes learn to itself. Most nodes are consistent with the Leader and then start entering the negotiation process.
The negotiation flow in the Paxos algorithm is as follows: the Leader proposes a resolution and sends the resolution to other nodes for negotiation. When most nodes agree to this resolution, the resolution is submitted (i.e., the resolution is performed). The resolution varies from service to service, for example: the distributed database may be a Structured Query Language (SQL).
Assume now that there are 3 nodes (1 Leader and 2 acceptors) in the cluster, where the recovery flow is as follows:
1) the Leader sends an acquisition (collect) request to all receivers (acceptors).
2) Acceptor B receives the collect request.
3) Acceptorbor B executes share information (share _ state) -calculates the version gap with LeaderA, and selects the share version according to the gap.
4) Acceptor B returns a final (last) request to the leader A-the last request contains the version gap, and the version with the specific phase difference.
5) The Acceptor C receives the collect request.
6) After the leader A receives the last request of Acceptor B, it calculates whether the last reply reaches most. This 1(LeaderA is counted in by default) +1(Acceptor B) ≧ 2 ≧ 3/2+1 satisfies most conditions. In this document "/" is a rounding symbol, so the result of 3/2 is 1.
7) Acceptor C returns a last request to LeaderA.
8) The leader performs a merge (merge) operation, merging the accepitob shared version and its own version to the latest version.
9) The leader then sends the latest version to the AcceptorB.
The negotiation stage is as follows:
1) the client first sends a request to the Leader (i.e.: leader) submits a resolution.
2) After the leader A receives the resolution, a start (begin) message is sent to the node Acceptor B/C respectively.
3) Acceptor B writes an Accept log to persistent storage.
4) Acceptor B returns an Accept message to the leader.
5) After receiving the Accept response of Acceptor B, the leader A calculates whether the Accept response reaches a majority. This 1(LeaderA is counted in by default) +1(Acceptor B) ≧ 2 ≧ 3/2+1 satisfies most conditions.
6) The leader submits (commit) the resolution.
7) The leader sends a commit message to all nodes.
8) Acceptorb receives the commit message and commits the resolution.
Since the negotiation of the resolution needs to be performed in sequence and the network needs to be reliable, the current negotiation process is to perform the negotiation one by one, so that the number of resolution which can be processed per unit time is small, and the negotiation performance is low. In particular, a reliable transmission protocol is required to be adopted for a network during implementation, for example, transmission based on a Transmission Control Protocol (TCP) is required, which limits a use scenario.
Disclosure of Invention
The embodiment of the invention provides a consistency control method, a consistency control device and a consistency control system, which are used for improving the negotiation efficiency of a resolution and reducing the requirement of a negotiation process on a communication protocol.
An embodiment of the present invention provides a consistency control method, which is applied to a negotiation process based on message passing, and includes:
after the coordination node obtains a resolution, packaging the obtained resolution to obtain a resolution packet; the resolution packet comprises at least two resolutions;
sending the resolution package to a receiver node, the receiver node being a receiver node corresponding to a resolution in the resolution package;
receiving a confirmation message returned by the receiver node, and determining that the receiver node returning the confirmation message confirms a resolution corresponding to the confirmation message;
and determining whether the resolution in the resolution packet passes the negotiation according to the confirmation message returned by the receiver node, and if so, submitting the resolution in the resolution packet.
With reference to an implementation manner of an aspect, in a first optional implementation manner, the sending the resolution packet to the receiver node includes:
sending the resolution packet to a receiver node using a communication protocol requiring order reachability; alternatively, the resolution packet is sent to the receiver node using a communication protocol that does not require order reachability.
With reference to the implementation manner of the aspect or the first optional implementation manner of the aspect, in a second optional implementation manner, the method further includes:
starting a timer after sending the resolution packet to a receiver node;
and after the timer is overtime, if the resolution which is not negotiated still exists in the resolution packet, sending the resolution which is not negotiated to a receiver node which does not reply a determination message and corresponds to the resolution which is not negotiated.
The second aspect of the embodiment of the present invention provides a consistency control method, which is applied to a negotiation process based on message passing, and includes:
a receiver node receives a resolution packet from a coordinating node, the resolution packet including at least two resolutions;
and sequentially determining whether the resolution in the resolution packet should be confirmed according to the resolution negotiation sequence, if so, replying a confirmation message to the coordination node, and specifying the confirmed resolution in the confirmation message.
With reference to the implementation manners of the two aspects, in a first optional implementation manner, the receiving, by the receiver node, a resolution packet from a coordinating node includes:
the receiver node receives a resolution packet sent by a coordination node by adopting a communication protocol requiring order accessibility; alternatively, the receiver node receives a resolution packet from the coordinating node sent using a communication protocol that does not require orderly reachability.
With reference to the implementation manners of the second aspect or the first optional implementation manner of the first aspect, in a second optional implementation manner, if the resolution packet is sent by using a communication protocol that does not require to be sequentially reachable;
said determining in sequence, according to a resolution negotiation order, whether a resolution in said resolution packet should be confirmed comprises:
after receiving all the resolution in the resolution packet, sequentially determining whether the resolution in the resolution packet should be confirmed according to a resolution negotiation sequence;
or after receiving any one of the resolution in the resolution packet, determining whether the received resolution is the current resolution needing negotiation according to the resolution negotiation sequence, if not, caching, and if so, determining whether the received resolution should be confirmed.
The embodiment of the invention also provides a coordination node in three aspects, which is applied to a negotiation process based on message transmission and comprises the following steps:
the packing unit is used for packing the obtained resolution to obtain a resolution packet after the resolution is obtained; the resolution packet comprises at least two resolutions;
a packet sending unit, configured to send the resolution packet to a receiver node, where the receiver node is a receiver node corresponding to a resolution in the resolution packet;
a confirmation receiving unit, configured to receive a confirmation message returned by the receiver node, and determine that the receiver node returning the confirmation message confirms a resolution corresponding to the confirmation message;
and the submission control unit is used for determining whether the resolution in the resolution packet passes the negotiation according to the confirmation message returned by the receiver node, and if so, submitting the resolution in the resolution packet.
With reference to the implementation manners of the three aspects, in a first optional implementation manner, the packet sending unit is specifically configured to send the resolution packet to the receiver node by using a communication protocol that requires to be sequentially reachable; alternatively, the resolution packet is sent to the receiver node using a communication protocol that does not require order reachability.
With reference to the implementation manners of the three aspects or the first optional implementation manner of the one aspect, in a second optional implementation manner, the coordinating node further includes:
a timer unit, configured to start a timer after the packet sending unit sends the resolution packet to the receiver node;
the packet sending unit is further configured to, after the timer expires, if a resolution that is not negotiated through still exists in the resolution packet, send the resolution that is not negotiated through to a receiver node that does not reply to the determination message and corresponds to the resolution that is not negotiated through.
An aspect of the present invention further provides a receiver node, which is applied to a negotiation process based on message passing, and includes:
a packet receiving unit, configured to receive a resolution packet from a coordinating node, where the resolution packet includes at least two resolutions;
a resolution control unit, configured to determine whether a resolution in the resolution packet should be confirmed in sequence according to a resolution negotiation order;
and a confirmation sending unit, configured to reply a confirmation message to the coordinating node if the determination result of the resolution control unit is yes, and specify a confirmed resolution in the confirmation message.
With reference to the implementation manner of the fourth aspect, in a second optional implementation manner, the packet receiving unit is specifically configured to receive, by the receiver node, a resolution packet sent by using a communication protocol that requires to be sequentially reachable from a coordinating node; alternatively, the receiver node receives a resolution packet from the coordinating node sent using a communication protocol that does not require orderly reachability.
With reference to the implementation manner of the fourth aspect or the first optional implementation manner of the aspect, in a second optional implementation manner, if the resolution packet is sent by using a communication protocol that does not require to be sequentially reachable;
the resolution control unit is configured to determine whether the resolution in the resolution packet should be confirmed in sequence according to a resolution negotiation sequence after the packet receiving unit receives all the resolutions in the resolution packet;
or,
and the resolution control unit is used for determining whether the received resolution is the current resolution which needs to be negotiated according to the resolution negotiation sequence after the packet receiving unit receives any one of the resolution in the resolution packet, if not, caching, and if so, determining whether the received resolution should be confirmed.
The fifth aspect of the embodiment of the present invention further provides a consistency control system, including: the coordinating node and the receiver node are applied to a negotiation process based on message passing, the coordinating node is any coordinating node provided by the embodiment of the invention, and the receiver node is any receiver node provided by the embodiment of the invention.
According to the technical scheme, the embodiment of the invention has the following advantages: since at least two resolution packets are packed in the resolution packet, there can be at least two resolution packets voted at one time on the receiver node side, and at least two resolution packets can be negotiated at one negotiation process, thereby improving negotiation efficiency of the resolution packets. And two solutions are sent to the receiver node, the coordinating node only needs to know the negotiation result of each solution, and each solution does not need to arrive at the receiver node in sequence, thereby reducing the requirement of the negotiation process on the communication protocol.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a schematic flow chart of a method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a method according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating the time consumed for resolution negotiation according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a relationship between cluster modules according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of a method according to an embodiment of the present invention;
FIG. 6 is a schematic flow chart of a method according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a coordinating node according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a coordinating node according to an embodiment of the present invention;
FIG. 9 is a block diagram of a receiver node according to an embodiment of the present invention;
FIG. 10 is a system diagram according to an embodiment of the present invention;
FIG. 11 is a schematic diagram of a coordinating node according to an embodiment of the present invention;
fig. 12 is a schematic diagram of a receiver node according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
An embodiment of the present invention provides a consistency control method, which is applied to a negotiation process based on message passing, and as shown in fig. 1, the consistency control method includes:
101: after the coordination node obtains a resolution, packaging the obtained resolution to obtain a resolution packet; said resolution package comprising at least two resolutions;
the coordinating node is the Leader selected to generate, and the other nodes participating in the negotiation are the receiver (Acceptor) nodes. Each resolution within a resolution package should have the same receiver node. The number of the resolution in the resolution package can be dozens in general, and the number of the resolution package can be set arbitrarily.
102: sending said resolution packet to a receiver node, said receiver node being a receiver node corresponding to a resolution in said resolution packet;
the receiver node corresponding to the resolution is the receiver node that needs to participate in the resolution negotiation. At least one receiver node, and therefore the receiver node in this step is a generic term and does not refer to a receiver node.
In this embodiment, the resolution packet is sent to the receiver node, so that a TCP-like protocol is not necessarily used, and therefore the scheme for sending the resolution packet provided by the embodiment of the present invention may be as follows: said sending said resolution packet to a receiver node comprises: sending the resolution packet to a receiver node by adopting a communication protocol which requires order to be reachable; alternatively, the resolution packet may be sent to the receiver node using a communication protocol that does not require order reachability.
The communication protocol requiring orderly reachability may be TCP, etc., the communication protocol not requiring orderly reachability may be User Datagram Protocol (UDP), etc., and the communication requirements of various protocols are well known to those skilled in the art, so the embodiment is not an example.
103: receiving the confirmation message returned by the receiver node, and determining that the receiver node returning the confirmation message confirms the resolution corresponding to the confirmation message;
the acknowledgement message specifies which resolution the acknowledgement message is for.
104: and determining whether the resolution in the resolution packet passes the negotiation according to the confirmation message returned by the receiver node, and if so, submitting the resolution in the resolution packet.
In this embodiment, since at least two resolution packets are packed in the resolution packet, there may be at least two resolution packets voted at one time at the receiver node, and at least two resolution packets may be negotiated at one negotiation process, thereby improving negotiation efficiency of the resolution packets. And two solutions are sent to the receiver node, the coordinating node only needs to know the negotiation result of each solution, and each solution does not need to arrive at the receiver node in sequence, thereby reducing the requirement of the negotiation process on the communication protocol.
Further, because the embodiment of the present invention may not use a TCP-like protocol to send a resolution, a situation of out-of-order may occur, and a situation of packet loss may also occur, and the embodiment of the present invention provides a solution as follows: the method further comprises the following steps:
starting a timer after sending the resolution packet to a receiver node;
and after the timer is overtime, if the resolution which is not negotiated still exists in the resolution packet, sending the resolution which is not negotiated to a receiver node which does not reply a determination message and corresponds to the resolution which is not negotiated.
An embodiment of the present invention further provides another consistency control method, which is applied to a negotiation process based on message passing, and as shown in fig. 2, the method includes:
201: a receiver node receives a resolution packet from a coordinating node, wherein the resolution packet comprises at least two resolutions;
since at least two resolution packages are contained in the resolution package, the coordination node needs to complete the packaging operation of the resolution package to obtain the resolution package.
In this embodiment, the resolution packet is sent to the receiver node, so that a TCP-like protocol is not necessarily used, and therefore the scheme for sending the resolution packet provided by the embodiment of the present invention may be as follows: the receiver node receiving the resolution packet from the coordinating node comprises:
the receiver node receives a resolution packet sent by the coordination node by adopting a communication protocol requiring order accessibility; alternatively, the receiver node receives a resolution packet from the coordinating node sent using a communication protocol that does not require orderly reachability.
202: and determining whether the resolution in the resolution packet should be confirmed or not according to the resolution negotiation sequence, if so, replying a confirmation message to the negotiation point, and specifying the confirmed resolution in the confirmation message.
Since at least two resolution packets are packed in the resolution packet, at least two resolution packets can be obtained for one time voting by the receiver node, and at least two resolution packets can be obtained for one time negotiation process, so that the negotiation efficiency of the resolution packets can be improved. And two solutions are sent to the receiver node, the coordinating node only needs to know the negotiation result of each solution, and each solution does not need to arrive at the receiver node in sequence, thereby reducing the requirement of the negotiation process on the communication protocol.
In addition, if the coordinating node determines that the negotiation is passed, the receiver node receives the submission information of the resolution in the resolution packet, and the coordinating node needs to perform the submission in sequence according to the negotiation sequence of the resolution no matter the order of the submission information of the resolution reaching the receiver node in the process of performing the submission, such as downloading the service.
If a communication protocol which does not require to be in order and reachable is adopted, the resolution may be out of order or even lose packets, and the solution provided by the embodiment of the invention is as follows: if the resolution packet is sent by adopting a communication protocol which does not require order accessibility;
the sequentially determining whether the resolution in the resolution packet should be confirmed according to the resolution negotiation sequence includes:
after receiving all the resolution in the resolution packet, sequentially determining whether the resolution in the resolution packet should be confirmed according to a resolution negotiation sequence;
or after receiving any one of the resolution packages, determining whether the received resolution is the current resolution needing negotiation according to the resolution negotiation sequence, if not, caching, and if so, determining whether the received resolution should be confirmed.
The embodiment of the invention mainly relates to the following problems:
(1) and packing at leader nodes, negotiating and voting for packing the application (payload), and voting the payload of one packet (batch) at a time. The method can greatly improve the throughput.
(2) And adopting concurrent negotiation at the leader node and concurrently solving a plurality of proposals, wherein the method can greatly improve the throughput.
(3) The high-performance data synchronization of paxos on an unreliable network can be realized by numbering the contents which are packed and sent concurrently each time, retransmitting overtime by a main node, caching the contents by both the main node and the standby node and the like.
The embodiment of the invention also utilizes cache processing and overtime retransmission to ensure that paxos are not limited by network types and utilizes 'packaging' and 'concurrency' to improve the processing performance of paxos.
The principle of the packing (Batching) technology used by Paxos is that a plurality of resolution proposals submitted by a Client (Client) are received at a Leader end, and the plurality of resolution proposals are sent to a receiver node to complete resolution proposal and service release according to a strategy of limiting a certain time and a packing size.
The principle of the concurrency (Pipelining) technique used by Paxos is to transmit the next resolution while waiting for propagation under the condition that the network propagation delay is large relative to the service processing time. The sequentiality of the messages is guaranteed at the sending and receiving ends.
As shown in fig. 3, the left side is a schematic diagram of pipeline (Pipelining) and the right side is batch (Batching), in the schematic diagram of fig. 3, the left side is the time required by two resolutions in a one-by-one negotiation manner, the time required is i +1, the right side packs the two resolutions into a resolution packet, and the time required for all negotiations is i, so that the time is saved more. In practice, one resolution package can package any number of resolutions, and the two resolution packages in this embodiment should not be construed as limiting the embodiments of the present invention.
Fig. 4 is a diagram illustrating a relationship between exemplary Paxos cluster modules, which includes a coordinating node and several receiver nodes, in the following embodiments, there are two receiver nodes, and actually there may be many receiver nodes, which should not be construed as a unique limitation to the embodiment of the present invention. The following embodiments will describe how to implement the Paxos normal negotiation procedure in case of packet resolution out of order, loss of packet resolution, respectively.
In this scenario, when there is packet content loss during packet parallel transmission, the flow is as shown in fig. 5, as follows:
501: leader packet negotiation resolution, numbered 1, 2, 3.
502: the Leader starts a timer.
503: the Leader sends packet resolution 1, 2, 3 in parallel to Acceptor A, Acceptor B.
504: the AcceptorA receives packet resolution 1 buffer reply ACK.
505: the AcceptorB receives packet resolution 1 buffer reply ACK.
506: the AcceptorA receives packet resolution 2 cache reply ACK.
507: the AcceptorB receives packet resolution 2 cache reply ACK.
508: the AcceptorA receives packet resolution 3 buffer reply ACK.
509: the periodizer times out.
510: the Leader finds that the acceptor b has not yet replied to ACK for packed resolution 3, and sends packed resolution 3 to acceptor b again, waiting for its reply.
511: packet resolution 3 that receives accepitob buffers a reply ACK.
512: a Commit (Commit) message is sent to the AcceptorA, AcceptorB.
After receiving the Commit message, the Acceptor A and the Acceptor B respectively play the disk recording resolution and complete the negotiation.
The embodiment of the present invention also provides a packet resolution disorder process, as shown in fig. 6, which is a process for a Leader to send a packet resolution in parallel, but the resolution is disordered by using a UDP class protocol that does not need to be reachable in order, and the specific flow is as follows:
601: leader packet negotiation resolution, numbered 1, 2, 3.
602: the Leader starts a timer.
603: the Leader sends resolution packs 1, 2, 3 in parallel to Acceptor A, Acceptor B.
604: acceptor receives Packed resolution 2 cache.
605: acceptor B receives Packed resolution 3 cache.
606: acceptor A receives packet resolution 3 cache.
607: acceptor receives Packed resolution 1 cache.
608: acceptor B receives Packed resolution 1 cache.
609: acceptor B receives Packed resolution 2 cache.
610: accepitora replies with a packet resolution 2 ACK.
611: accepitora replies with packet resolution 3 ACK.
612: acceptor replies with a packet resolution 1 ACK.
613: acceptorb replies with packet resolution 3 ACK.
614: acceptorb replies with a packet resolution 1 ACK.
615: acceptorb replies with a packet resolution 2 ACK.
616: the Leader checks that Acceptor A and Acceptor BACK are normal. The Leader sends Commit information to Acceptor B and Acceptor A.
And after receiving the Commit information, the Acceptor B downloads and records resolution information. After receiving the Commit message, the Acceptor records the resolution message. The negotiation is completed.
The scheme of the embodiment of the invention can improve the negotiation performance of paxos in an unreliable network environment, thereby effectively improving the quantity of data multi-copy synchronization among multiple nodes in a distributed system in unit time.
An embodiment of the present invention further provides a coordinating node, which is applied to a negotiation process based on message passing, and as shown in fig. 7, the coordinating node includes:
a packing unit 701, configured to, after obtaining a resolution, pack the obtained resolution to obtain a resolution packet; said resolution package comprising at least two resolutions;
a packet sending unit 702, configured to send the resolution packet to a receiver node, where the receiver node is a receiver node corresponding to a resolution in the resolution packet;
a confirmation receiving unit 703, configured to receive a confirmation message returned by the receiver node, and determine that the receiver node returning the confirmation message confirms a resolution corresponding to the confirmation message;
a submit control unit 704, configured to determine whether all the solutions in the solution packet pass the negotiation according to the acknowledgement message returned by the receiver node, and if so, submit the solutions in the solution packet.
The coordinating node is the Leader selected to generate, and the other nodes participating in the negotiation are the receiver (Acceptor) nodes. Each resolution within a resolution package should have the same receiver node. The number of the resolution in the resolution package can be dozens in general, and the number of the resolution package can be set arbitrarily.
In this embodiment, since at least two resolution packets are packed in the resolution packet, there may be at least two resolution packets voted at one time at the receiver node, and at least two resolution packets may be negotiated at one negotiation process, thereby improving negotiation efficiency of the resolution packets. And two solutions are sent to the receiver node, the coordinating node only needs to know the negotiation result of each solution, and each solution does not need to arrive at the receiver node in sequence, thereby reducing the requirement of the negotiation process on the communication protocol.
In this embodiment, the resolution packet is sent to the receiver node, so that a TCP-like protocol is not necessarily used, and therefore the scheme for sending the resolution packet provided by the embodiment of the present invention may be as follows: optionally, the packet sending unit 702 is specifically configured to send the resolution packet to a receiver node by using a communication protocol that requires order reachability; alternatively, the resolution packet may be sent to the receiver node using a communication protocol that does not require order reachability.
The communication protocol requiring orderly reachability may be TCP, etc., the communication protocol not requiring orderly reachability may be User Datagram Protocol (UDP), etc., and the communication requirements of various protocols are well known to those skilled in the art, so the embodiment is not an example.
Further, because the embodiment of the present invention may not use a TCP-like protocol to send a resolution, a situation of out-of-order may occur, and a situation of packet loss may also occur, and the embodiment of the present invention provides a solution as follows: as shown in fig. 8, the coordinating node further includes:
a timer unit 801, configured to start a timer after the packet sending unit 702 sends the resolution packet to a receiver node;
the packet sending unit 702 is further configured to, after the timer expires, if a resolution that is not negotiated through still exists in the resolution packet, send the resolution that is not negotiated through to a receiver node that does not reply to a determination message corresponding to the resolution that is not negotiated through.
An embodiment of the present invention further provides a receiver node, which is applied to a negotiation process based on message passing, and as shown in fig. 9, the receiver node includes:
a packet receiving unit 901, configured to receive a resolution packet from a coordinating node, where the resolution packet includes at least two resolutions;
a resolution control unit 902, configured to determine whether the resolution in the resolution packet should be confirmed in sequence according to a resolution negotiation sequence;
an acknowledgement sending unit 903, configured to reply an acknowledgement message to the coordination node if the determination result of the resolution control unit 902 is yes, and specify a confirmed resolution in the acknowledgement message.
Since at least two resolution packages are contained in the resolution package, the coordination node needs to complete the packaging operation of the resolution package to obtain the resolution package.
Since at least two resolution packets are packed in the resolution packet, at least two resolution packets can be obtained for one time voting by the receiver node, and at least two resolution packets can be obtained for one time negotiation process, so that the negotiation efficiency of the resolution packets can be improved. And two solutions are sent to the receiver node, the coordinating node only needs to know the negotiation result of each solution, and each solution does not need to arrive at the receiver node in sequence, thereby reducing the requirement of the negotiation process on the communication protocol.
In this embodiment, the resolution packet is sent to the receiver node, so that a TCP-like protocol is not necessarily used, and therefore the scheme for sending the resolution packet provided by the embodiment of the present invention may be as follows: the packet receiving unit 901 is specifically configured to receive a resolution packet sent by a coordinating node according to a communication protocol that requires order accessibility; alternatively, the receiver node receives a resolution packet from the coordinating node sent using a communication protocol that does not require orderly reachability.
If a communication protocol which does not require to be in order and reachable is adopted, the resolution may be out of order or even lose packets, and the solution provided by the embodiment of the invention is as follows: if the resolution packet is sent by adopting a communication protocol which does not require order accessibility;
the above-mentioned resolution control unit 902, configured to, after the above-mentioned packet receiving unit receives all the resolutions in the above-mentioned resolution packet, sequentially determine whether the resolutions in the above-mentioned resolution packet should be confirmed according to a resolution negotiation order;
or,
the above-mentioned resolution control unit 902 is configured to, after the above-mentioned packet receiving unit receives any one of the above-mentioned resolution packets, determine whether the received resolution is a current resolution that needs to be negotiated according to a resolution negotiation sequence, if not, buffer, and if so, determine whether the received resolution should be confirmed.
An embodiment of the present invention further provides a consistency control system, as shown in fig. 10, including: the coordinating node 1001 and the receiver node 1002 are applied to a negotiation process based on message passing, where the coordinating node 1001 is a coordinating node according to any one of embodiments of the present invention, and the receiver node 1002 is a receiver node according to any one of embodiments of the present invention.
An embodiment of the present invention further provides another coordination node, as shown in fig. 11, including: a receiver 1101, a transmitter 1102, a processor 1103, and a memory 1104;
the processor 1103 is configured to, after obtaining a resolution, pack the obtained resolution to obtain a resolution packet; said resolution package comprising at least two resolutions; sending said resolution packet to a receiver node, said receiver node being a receiver node corresponding to a resolution in said resolution packet; receiving the confirmation message returned by the receiver node, and determining that the receiver node returning the confirmation message confirms the resolution corresponding to the confirmation message; and determining whether the resolution in the resolution packet passes the negotiation according to the confirmation message returned by the receiver node, and if so, submitting the resolution in the resolution packet.
The coordinating node is the Leader selected to generate, and the other nodes participating in the negotiation are the receiver (Acceptor) nodes. Each resolution within a resolution package should have the same receiver node. The number of the resolution in the resolution package can be dozens in general, and the number of the resolution package can be set arbitrarily.
The receiver node corresponding to the resolution is the receiver node that needs to participate in the resolution negotiation. At least one receiver node, and therefore the receiver node in this step is a generic term and does not refer to a receiver node.
In this embodiment, since at least two resolution packets are packed in the resolution packet, there may be at least two resolution packets voted at one time at the receiver node, and at least two resolution packets may be negotiated at one negotiation process, thereby improving negotiation efficiency of the resolution packets. And two solutions are sent to the receiver node, the coordinating node only needs to know the negotiation result of each solution, and each solution does not need to arrive at the receiver node in sequence, thereby reducing the requirement of the negotiation process on the communication protocol.
In this embodiment, the resolution packet is sent to the receiver node, so that a TCP-like protocol is not necessarily used, and therefore the scheme for sending the resolution packet provided by the embodiment of the present invention may be as follows: the processor 1103 configured to send the resolution packet to a receiver node comprises: sending the resolution packet to a receiver node by adopting a communication protocol which requires order to be reachable; alternatively, the resolution packet may be sent to the receiver node using a communication protocol that does not require order reachability.
Further, because the embodiment of the present invention may not use a TCP-like protocol to send a resolution, a situation of out-of-order may occur, and a situation of packet loss may also occur, and the embodiment of the present invention provides a solution as follows: the processor 1103 is further configured to start a timer after sending the resolution packet to the receiver node; and after the timer is overtime, if the resolution which is not negotiated still exists in the resolution packet, sending the resolution which is not negotiated to a receiver node which does not reply a determination message and corresponds to the resolution which is not negotiated.
An embodiment of the present invention further provides another receiver node, as shown in fig. 12, including: a receiver 1201, a transmitter 1202, a processor 1203, and a memory 1204;
wherein the processor 1103 is configured to receive a resolution packet from a coordinating node, where the resolution packet includes at least two resolutions; and determining whether the resolution in the resolution packet should be confirmed or not according to the resolution negotiation sequence, if so, replying a confirmation message to the negotiation point, and specifying the confirmed resolution in the confirmation message.
Since at least two resolution packets are packed in the resolution packet, at least two resolution packets can be obtained for one time voting by the receiver node, and at least two resolution packets can be obtained for one time negotiation process, so that the negotiation efficiency of the resolution packets can be improved. And two solutions are sent to the receiver node, the coordinating node only needs to know the negotiation result of each solution, and each solution does not need to arrive at the receiver node in sequence, thereby reducing the requirement of the negotiation process on the communication protocol.
In this embodiment, the resolution packet is sent to the receiver node, so that a TCP-like protocol is not necessarily used, and therefore the scheme for sending the resolution packet provided by the embodiment of the present invention may be as follows: the processor 1103, configured to enable the receiver node to receive the resolution packet from the coordinating node, includes: receiving a resolution packet sent by a coordination node by adopting a communication protocol requiring order accessibility; alternatively, a resolution packet is received from the coordinating node sent using a communication protocol that does not require orderly reachability.
In addition, if the coordinating node determines that the negotiation is passed, the receiver node receives the submission information of the resolution in the resolution packet, and the coordinating node needs to perform the submission in sequence according to the negotiation sequence of the resolution no matter the order of the submission information of the resolution reaching the receiver node in the process of performing the submission, such as downloading the service.
If a communication protocol which does not require to be in order and reachable is adopted, the resolution may be out of order or even lose packets, and the solution provided by the embodiment of the invention is as follows: if the resolution packet is sent by adopting a communication protocol which does not require order accessibility;
the processor 1103, configured to sequentially determine whether the resolution in the resolution packet should be confirmed according to the resolution negotiation order, includes:
after receiving all the resolution in the resolution packet, sequentially determining whether the resolution in the resolution packet should be confirmed according to a resolution negotiation sequence;
or after receiving any one of the resolution packages, determining whether the received resolution is the current resolution needing negotiation according to the resolution negotiation sequence, if not, caching, and if so, determining whether the received resolution should be confirmed.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (13)

1. A consistency control method is applied to a negotiation process based on message passing, and is characterized by comprising the following steps:
after the coordination node obtains a resolution, packaging the obtained resolution to obtain a resolution packet; the resolution packet comprises at least two resolutions;
sending the resolution package to a receiver node, the receiver node being a receiver node corresponding to a resolution in the resolution package;
receiving a confirmation message returned by the receiver node, and determining that the receiver node returning the confirmation message confirms a resolution corresponding to the confirmation message;
and determining whether the resolution in the resolution packet passes the negotiation according to the confirmation message returned by the receiver node, and if so, submitting the resolution in the resolution packet.
2. The method of claim 1, wherein said sending said resolution packet to a receiver node comprises:
sending the resolution packet to a receiver node using a communication protocol requiring order reachability; alternatively, the resolution packet is sent to the receiver node using a communication protocol that does not require order reachability.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
starting a timer after sending the resolution packet to a receiver node;
and after the timer is overtime, if the resolution which is not negotiated still exists in the resolution packet, sending the resolution which is not negotiated to a receiver node which does not reply a determination message and corresponds to the resolution which is not negotiated.
4. A consistency control method is applied to a negotiation process based on message passing, and is characterized by comprising the following steps:
a receiver node receives a resolution packet from a coordinating node, the resolution packet including at least two resolutions;
and sequentially determining whether the resolution in the resolution packet should be confirmed according to the resolution negotiation sequence, if so, replying a confirmation message to the coordination node, and specifying the confirmed resolution in the confirmation message.
5. The method of claim 4, wherein the receiver node receiving a resolution packet from a coordinating node comprises:
the receiver node receives a resolution packet sent by a coordination node by adopting a communication protocol requiring order accessibility; alternatively, the receiver node receives a resolution packet from the coordinating node sent using a communication protocol that does not require orderly reachability.
6. A method as in claim 4 or 5 wherein if said resolution packet is sent using a communication protocol that does not require in-order reachability;
said determining in sequence, according to a resolution negotiation order, whether a resolution in said resolution packet should be confirmed comprises:
after receiving all the resolution in the resolution packet, sequentially determining whether the resolution in the resolution packet should be confirmed according to a resolution negotiation sequence;
or after receiving any one of the resolution in the resolution packet, determining whether the received resolution is the current resolution needing negotiation according to the resolution negotiation sequence, if not, caching, and if so, determining whether the received resolution should be confirmed.
7. A coordinating node for use in a messaging based negotiation process, comprising:
the packing unit is used for packing the obtained resolution to obtain a resolution packet after the resolution is obtained; the resolution packet comprises at least two resolutions;
a packet sending unit, configured to send the resolution packet to a receiver node, where the receiver node is a receiver node corresponding to a resolution in the resolution packet;
a confirmation receiving unit, configured to receive a confirmation message returned by the receiver node, and determine that the receiver node returning the confirmation message confirms a resolution corresponding to the confirmation message;
and the submission control unit is used for determining whether the resolution in the resolution packet passes the negotiation according to the confirmation message returned by the receiver node, and if so, submitting the resolution in the resolution packet.
8. The coordinating node of claim 7,
the packet sending unit is specifically configured to send the resolution packet to a receiver node by using a communication protocol that requires order reachability; alternatively, the resolution packet is sent to the receiver node using a communication protocol that does not require order reachability.
9. The coordinating node of claim 7 or 8, wherein the coordinating node further comprises:
a timer unit, configured to start a timer after the packet sending unit sends the resolution packet to the receiver node;
the packet sending unit is further configured to, after the timer expires, if a resolution that is not negotiated through still exists in the resolution packet, send the resolution that is not negotiated through to a receiver node that does not reply to the determination message and corresponds to the resolution that is not negotiated through.
10. A receiver node for use in a message-passing based negotiation process, comprising:
a packet receiving unit, configured to receive a resolution packet from a coordinating node, where the resolution packet includes at least two resolutions;
a resolution control unit, configured to determine whether a resolution in the resolution packet should be confirmed in sequence according to a resolution negotiation order;
and a confirmation sending unit, configured to reply a confirmation message to the coordinating node if the determination result of the resolution control unit is yes, and specify a confirmed resolution in the confirmation message.
11. The receiver node of claim 10,
the packet receiving unit is specifically configured to receive, by the receiver node, a resolution packet sent by a coordination node according to a communication protocol that requires order reachability; alternatively, the receiver node receives a resolution packet from the coordinating node sent using a communication protocol that does not require orderly reachability.
12. The receiver node of claim 10 or 11, wherein if said resolution packet is sent using a communication protocol that does not require ordered reachability;
the resolution control unit is configured to determine whether the resolution in the resolution packet should be confirmed in sequence according to a resolution negotiation sequence after the packet receiving unit receives all the resolutions in the resolution packet;
or,
and the resolution control unit is used for determining whether the received resolution is the current resolution which needs to be negotiated according to the resolution negotiation sequence after the packet receiving unit receives any one of the resolution in the resolution packet, if not, caching, and if so, determining whether the received resolution should be confirmed.
13. A coherency control system comprising: coordinating node and receiver node for use in a message-based negotiation process, wherein the coordinating node is a coordinating node according to any of claims 9-10 and the receiver node is a receiver node according to any of claims 11-12.
CN201410795095.0A 2014-12-18 2014-12-18 Consistency control method, device and system Pending CN105763519A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410795095.0A CN105763519A (en) 2014-12-18 2014-12-18 Consistency control method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410795095.0A CN105763519A (en) 2014-12-18 2014-12-18 Consistency control method, device and system

Publications (1)

Publication Number Publication Date
CN105763519A true CN105763519A (en) 2016-07-13

Family

ID=56340801

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410795095.0A Pending CN105763519A (en) 2014-12-18 2014-12-18 Consistency control method, device and system

Country Status (1)

Country Link
CN (1) CN105763519A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106547610A (en) * 2016-10-11 2017-03-29 北京国电通网络技术有限公司 The method and system that a kind of distributed transaction is submitted to
CN110753005A (en) * 2019-10-17 2020-02-04 腾讯科技(深圳)有限公司 Speed limiting method, device and system, electronic equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1659500A2 (en) * 2004-11-23 2006-05-24 Microsoft Corporation Generalized paxos
CN102882927A (en) * 2012-08-29 2013-01-16 华南理工大学 Cloud storage data synchronizing framework and implementing method thereof
CN103200116A (en) * 2013-04-28 2013-07-10 成都市欧冠信息技术有限责任公司 Non-connection-oriented reliable UDP transmission protocol and data transmission method
CN103914313A (en) * 2012-12-31 2014-07-09 北京新媒传信科技有限公司 Paxos example updating method, device and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1659500A2 (en) * 2004-11-23 2006-05-24 Microsoft Corporation Generalized paxos
CN102882927A (en) * 2012-08-29 2013-01-16 华南理工大学 Cloud storage data synchronizing framework and implementing method thereof
CN103914313A (en) * 2012-12-31 2014-07-09 北京新媒传信科技有限公司 Paxos example updating method, device and system
CN103200116A (en) * 2013-04-28 2013-07-10 成都市欧冠信息技术有限责任公司 Non-connection-oriented reliable UDP transmission protocol and data transmission method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
HUA CHAI: "PERFORMANCE ENGINEERING OF A LIGHTWEIGHT FAULT TOLERANCE FRAMEWORK", 《HTTPS://ETD.OHIOLINK.EDU/PG_10?0::NO:10:P10_ACCESSION_NUM:CSU1260912144》 *
NUNO SANTOS: "Optimizing Paxos with batching and pipelining", 《THEORETICAL COMPUTER SCIENCE》 *
PARISA JALILI MARANDI: "Ring Paxos: High-Throughput Atomic Broadcast", 《IEEE/IFIP INTERNATIONAL CONFERENCE ON DEPENDABLE SYSTEMS & NETWORKS》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106547610A (en) * 2016-10-11 2017-03-29 北京国电通网络技术有限公司 The method and system that a kind of distributed transaction is submitted to
CN110753005A (en) * 2019-10-17 2020-02-04 腾讯科技(深圳)有限公司 Speed limiting method, device and system, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
US10788992B2 (en) System and method for efficient access for remote storage devices
US11770344B2 (en) Reliable, out-of-order transmission of packets
US10917344B2 (en) Connectionless reliable transport
US9888048B1 (en) Supporting millions of parallel light weight data streams in a distributed system
CN109690510B (en) Multicast apparatus and method for distributing data to multiple receivers in high performance computing networks and cloud-based networks
US20180278540A1 (en) Connectionless transport service
US9003053B2 (en) Message acceleration
JP4872952B2 (en) TCP buffer copy distributed parallel processing apparatus, method and program
US9007944B2 (en) One-to-many and many-to-one communications on a network
US20100217889A1 (en) Accelerated block option for trivial file transfer protocol (tftp)
GB2531864A (en) Supporting RMA API over active message
US10601722B2 (en) Method and device for dynamically managing the message retransmission delay on an interconnection network
US9069834B2 (en) Control method and storage controller apparatus
US20160359950A1 (en) Systems and methods for improved trivial file transfer protocol
CN110445666B (en) Network quality detection method and device and server
CN105763519A (en) Consistency control method, device and system
JP6438110B2 (en) Method and device for signaling in a communication network
EP3886396A1 (en) Methods for dynamically controlling transmission control protocol push functionality and devices thereof
CN111404842B (en) Data transmission method, device and computer storage medium
US20150112929A1 (en) Parallel Truncation Point Management for Log Based Replication
US9509780B2 (en) Information processing system and control method of information processing system
US20220327526A1 (en) Method for enabling efficient evaluation of transactions in a distributed ledger network
US10248708B2 (en) Storage and replication in distributed computing environments
US20230370521A1 (en) Blockchain machine broadcast protocol with loss recovery
WO2021214945A1 (en) Communication control device, communication control method, and communication control program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160713