CN103916426B - A kind of paxos examples update method, equipment and system - Google Patents
A kind of paxos examples update method, equipment and system Download PDFInfo
- Publication number
- CN103916426B CN103916426B CN201210593773.6A CN201210593773A CN103916426B CN 103916426 B CN103916426 B CN 103916426B CN 201210593773 A CN201210593773 A CN 201210593773A CN 103916426 B CN103916426 B CN 103916426B
- Authority
- CN
- China
- Prior art keywords
- paxos
- instance
- approval
- approved
- request
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 58
- 230000008569 process Effects 0.000 claims abstract description 29
- 238000002360 preparation method Methods 0.000 claims description 46
- 230000000977 initiatory effect Effects 0.000 claims description 7
- 238000012790 confirmation Methods 0.000 abstract 1
- 230000004044 response Effects 0.000 description 16
- 238000004364 calculation method Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
Landscapes
- Stored Programmes (AREA)
Abstract
The invention discloses a kind of paxos examples update method, methods described includes:Motion node performs learning process, obtains the example information of approved paxos examples under Current protocols, and the example information according to the approved paxos examples obtains updating the example ID of paxos examples;Motion node obtains the sequence number that last time approved paxos example is successfully used, and the sequence number that is successfully used with the last time approved paxos examples and the example ID directly are initiated to ratify a motion to all of approval node, after the approval node receiving described in majority that ratifies a motion, confirmation is described need to update paxos example approveds, and renewal is described need to update paxos examples.Accordingly, the invention also discloses a kind of equipment and system updated for paxos examples, this invention simplifies the execution of paxos algorithms, the execution efficiency of paxos algorithms is improve, solves the problems, such as that existing paxos algorithm performs efficiency is low.
Description
Technical Field
The present invention relates to the field of distributed computing, and in particular, to a paxos instance updating method, device, and system.
Background
Coordinated actions between nodes in a distributed computing system provide users with more reliable access to data and computational resources. Each node in the distributed computing system performs the same task and stores the same information, so the distributed computing system inevitably generates the following errors: slow process, restart and message delay, lost messages, repeated messages, etc.
To ensure that each node in the distributed computing system executes the same command, a "coherency algorithm" needs to be executed on each instruction. The paxos algorithm is a "consistency algorithm" applied to distributed computing systems. In paxos algorithm, if data update operation is performed on all copies once, a learning (learn) process is first required to determine which paxos instance is targeted, a preparation (prepare) process is then performed to obtain an approval (accept) request right and a serial number required for performing the approval process, and finally an approval process is performed.
Disclosure of Invention
The invention provides a method, equipment and a system for realizing consistency of a distributed computing system, which aim to solve the problem of low execution efficiency of the existing paxos algorithm.
The invention provides a paxos instance updating method, which comprises the following steps:
the proposal node executes a learning process to obtain instance information of an approved paxos instance under the current scheme, and obtains an instance ID of the paxos instance to be updated according to the instance information of the approved paxos instance;
and the proposal node acquires the sequence number successfully used by the paxos instance which is approved last time, directly initiates an approval request to all approval nodes by using the sequence number successfully used by the paxos instance which is approved last time and the instance ID, confirms that the paxos instance to be updated is approved after the approval request is accepted by most of the approval nodes, and updates the paxos instance to be updated.
In the above solution, if the approval request is not accepted by a plurality of dispatching the approval nodes, the method further comprises: the proposal node executes a preparation process by using the instance ID and determines a serial number; and the proposal node initiates an approval request to all approval nodes by using the sequence number determined by the preparation process and the instance ID, confirms that the paxos instance to be updated is approved after the approval request is accepted by most approval nodes, and updates the paxos instance to be updated.
In the above solution, the proposal node executes a learning process to obtain instance information of approved paxos instances under the current solution, including: the proposal node receives a scheme updating request initiated by a client and initiates a learning request to all approval nodes; and when the number of approved nodes accepting the learning request meets the requirement of most dispatches, obtaining instance information of approved paxos instances under the current scheme.
In the above solution, the proposal node is a pre-designated main proposal node.
The invention also provides a device for paxos instance update, which comprises: a learning unit and an approval unit; wherein,
the learning unit is used for executing a learning process, obtaining instance information of an approved paxos instance under a current scheme, and obtaining an instance ID of the paxos instance to be updated according to the instance information of the approved paxos instance;
and the approval unit is used for acquiring the sequence number successfully used by the paxos instance approved last time, directly sending an approval request to all approval nodes by using the sequence number successfully used by the paxos instance approved last time and the instance ID, confirming that the paxos instance to be updated is approved and updating the paxos instance to be updated after the approval request is accepted by most of the approval nodes.
In the above scheme, the apparatus further comprises: a preparation unit;
the approving unit is further used for notifying the preparation unit when the approving request is not accepted by a plurality of approving nodes; and the device is used for initiating an approval request to all approval nodes by using the sequence number determined by the preparation unit and the instance ID obtained by the learning unit, confirming that the paxos instance to be updated is approved and updating the paxos instance to be updated after the approval request is accepted by a plurality of approval nodes;
the preparation unit is used for executing a preparation process according to the instance ID obtained by the learning unit and determining a serial number after receiving the notice of the approval unit.
In the above scheme, the learning unit is configured to receive a scheme update request initiated by a client, and initiate a learning request to all approval nodes; and when the number of approved nodes accepting the learning request meets the requirement of most dispatches, obtaining instance information of approved paxos instances under the current scheme.
In the above solution, the device for paxos instance update is a master proposal node pre-designated in the distributed computing system.
The invention also provides a distributed computing system which comprises the equipment for paxos instance updating.
In the above solution, when there are multiple proposal nodes in the distributed computing system, the device for paxos instance update is a pre-designated main proposal node in the distributed computing system.
The embodiment of the invention has the beneficial effects that: when paxos instance updating is executed, the proposal node directly initiates an approval request to all approval nodes by adopting the sequence number which is successfully used by the last approved paxos instance, thus, the maximum sequence number in the used sequence numbers is directly used to initiate the approval request to execute paxos instance updating, the execution success rate is high, the repeated execution of the preparation process can be avoided, the existing criterion of the paxos algorithm is not violated, the execution of the paxos algorithm is simplified, the execution efficiency of the paxos algorithm is improved, and the problem of low execution efficiency of the existing paxos algorithm is solved.
Drawings
FIG. 1 is a flowchart illustrating an implementation of a paxos instance update method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an implementation of an update procedure of paxos instances according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an apparatus for paxos instance update according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating an exemplary component structure of a distributed computing system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The paxos algorithm requires three types of nodes to complete: a proposal node (Proposer), an approval node (Acceptor), and a learning node (Learner), wherein the learning node and the proposal node may be the same node, and at least two approval nodes are required.
In the Paxos algorithm, a proposal node proposes a value (value) to an approval node, namely initiates the update of one Paxos instance, if a plurality of dispatching approval nodes accept the update of the Paxos instance, the update of the Paxos instance is approved, corresponding update operation is executed, if the number of the approval nodes accepting the update of the Paxos instance does not meet the requirement of the plurality of dispatching, the update of the Paxos instance is not approved, and the update of the Paxos instance is returned to be executed again. When the update of paxos instances is approved, the learning node or the proposal node can learn the relevant information of the approved paxos instances from each approval node.
The updating of one paxos instance refers to a complete process of updating a certain value to all nodes of the distributed computing system at a time. After the distributed computing system successfully executes the updating operation of the current paxos instance, the proposal node receives a scheme updating request initiated by the client, starts to execute the updating of the next paxos instance, initiates the updating of the next paxos instance to all the approval nodes, and approves the updating of the next paxos instance and executes the corresponding updating operation when the updating of the next paxos instance is accepted by most of the assignment approval nodes.
In paxos algorithm, a proposed node generally needs three processes to complete the update of one paxos instance: a learning process, a preparation process, and an approval process.
In the learning process, the proposal node initiates a learning request to all the approval nodes to acquire the instance information of the approved paxos instances of a plurality of approval nodes, such as instance IDs, approved values, successfully used serial numbers and the like of the approved paxos instances. Then, the proposal node obtains an instance ID required by the next paxos instance for updating according to the instance information of the approved paxos instance, wherein the next paxos instance is an instance to be approved for updating;
in the preparation process, the proposal node firstly calculates the serial number required by the next paxos instance update, then initiates a preparation request to all approval nodes based on the calculated serial number and the instance ID obtained in the learning process, and if the preparation request is accepted by most of the dispatching approval nodes, the proposal node performs the subsequent approval process by using the serial number contained in the preparation request.
In the approval process, the proposal node initiates an approval request with the sequence number determined in the preparation process and the instance ID obtained in the learning process, the approval request also contains the value proposed by the proposal node (i.e. the value of the next paxos instance), if most of the dispatching approval nodes accept the approval request, the next paxos instance is approved for updating, corresponding updating operation is executed, and the updating process of one paxos instance is finished.
Embodiments of the present invention provide a paxos instance updating method, device, and system, so as to simplify a paxos algorithm and improve execution efficiency thereof.
Referring to fig. 1, a paxos instance updating method provided by the embodiment of the present invention mainly includes the following steps:
step 101: the proposal node executes a learning process to obtain instance information of an approved paxos instance under the current scheme, and obtains an instance ID of the paxos instance to be updated according to the instance information of the approved paxos instance;
step 102: and the proposal node acquires the sequence number successfully used by the paxos instance which is approved last time, directly initiates an approval request to all approval nodes by using the sequence number successfully used by the paxos instance which is approved last time and the instance ID, confirms that the paxos instance to be updated is approved after the approval request is accepted by most of the approval nodes, and updates the paxos instance to be updated.
Wherein the proposal node needs to obtain the sequence number that was last approved for successful use by the paxos instance before executing the next instance. For example, the proposal node may record instance information including a successfully used serial number in a local designated location when confirming that the paxos instance is approved last time, and may directly read from the designated location when executing the next instance subsequently. For another example, the proposal node may also actively obtain the sequence number successfully used by the last approved paxos instance from any one of the approving nodes approving the last approved paxos instance when executing the next instance.
Wherein if the approval request is not accepted by a plurality of dispatching the approval nodes, the method further comprises: the proposal node executes a preparation process by using the instance ID and determines a serial number; and the proposal node initiates an approval request to all approval nodes by using the sequence number determined by the preparation process and the instance ID, confirms that the paxos instance to be updated is approved after the approval request is accepted by most approval nodes, and updates the paxos instance to be updated.
The performing, by the proposal node, a learning process to obtain instance information of an approved paxos instance under the current scheme may include: the proposal node receives a scheme updating request initiated by a client and initiates a learning request to all approval nodes; and when the number of approved nodes accepting the learning request meets the requirement of most dispatches, obtaining instance information of approved paxos instances under the current scheme.
According to the paxos instance updating method provided by the embodiment of the invention, when paxos instance updating is executed, the proposal node directly initiates an approval request to all approval nodes by adopting the sequence number successfully used by the approved instance last time. And when the approval request is not accepted by a plurality of approving nodes, updating the paxos instance according to the processing method of the original paxos algorithm.
According to the criterion of paxos algorithm, that is, the sequence number used in each approval request is larger than the sequence number used in the last approval request for updating the same paxos instance, the sequence number successfully used by adopting the last approved paxos instance is the maximum sequence number used by adopting the last approved paxos instance during updating, so that the sequence number used by updating the paxos instance can be ensured to be the maximum, the probability of updating and approving the paxos instance is improved, and the execution success rate of updating the paxos instance is improved; moreover, in the process of executing a plurality of paxos instances by the same proposal node, a preparation process does not need to be executed when each paxos instance is updated, that is, one preparation process can be shared by a plurality of paxos instances, and on the premise of not violating the rules of the existing paxos algorithm, the paxos algorithm is simplified, the execution efficiency of the paxos algorithm is improved, and the problem of low execution efficiency of the existing paxos algorithm is solved.
If a plurality of proposal nodes execute updating on the same paxos instance, the approved probability is reduced when the proposal node initiates an approval request with the sequence number successfully used by the approved paxos instance last time, and the execution efficiency of the method in the embodiment of the invention is reduced. In order to solve the problem, a proposal node can be pre-designated as a main proposal node, so that a client accesses the main proposal node preferentially, the same paxos instance can be ensured to be updated by the same proposal node, the approval probability of an approval request initiated by a sequence number successfully used by the last approved paxos instance of the proposal node is improved, and correspondingly, the execution efficiency of the method in the embodiment of the invention is also improved.
Specifically, a configuration file may be preset, where the configuration file is used to instruct the clients to have limited access to a specified main proposal node, and all the clients may read the configuration file. In this way, the client can access the master proposal node by reading the configuration file before initiating a more proposal request. Here, the configuration file may be in a text format or other similar format.
The proposal node executing the method shown in fig. 1 in the embodiment of the present invention is preferably a pre-designated master proposal node.
As shown in fig. 2, a specific implementation flow of the paxos instance update process in the embodiment of the present invention may include the following steps:
step 201: a proposal node receives a scheme updating request initiated by a client;
step 202: the proposal node initiates a learning (learn) request to all the approval nodes;
step 203: each approving node receives the learning request and returns a response to the proposal node, wherein the response comprises the example information of the approved paxos example under the current scheme;
specifically, the response may include instance information of an approved paxos instance under the current scheme, where the instance information may include: instance ID, value, and successfully used sequence number for the approved paxos instance.
In practical applications, the value of one paxos instance may be any operation instruction, for example, the value of one paxos instance may be "modify the value of a variable to a certain value", "set the current node as the master node", and so on.
Here, if the approval node has not performed approval under the current situation, an empty response is directly returned or no response is returned.
Step 204: the proposal node receives the responses returned by the approval nodes, if the number of the returned responses meets the requirement of most dispatches, the step 205 is continued; if the number of the returned responses does not meet the majority dispatching requirement, returning to the step 202;
step 205: the proposal node obtains an instance ID updated by paxos instances according to the received response;
specifically, the proposal node may extract instance information of approved paxos instances from the responses, and calculate, by using a pre-agreed algorithm, instance IDs updated by the paxos instances in the current scenario according to the instance IDs of approved paxos instances.
For example, for instance ID1 of a paxos instance, it can be obtained by adding 1 to the instance ID of the last paxos instance under the same scheme. For example, if the instance ID of the previous paxos instance under the same scheme is 2, then the instance ID of the paxos instance is 3.
Step 206: the proposal node acquires the sequence number successfully used by the paxos instance approved last time;
here, the sequence number successfully used by the last approved paxos instance refers to the sequence number included in the approval request accepted by the majority of the delegating approval nodes during the update of the last approved paxos instance.
Here, there are various specific obtaining manners, for example, the proposal node may record instance information including a successfully used sequence number in a local designated location when confirming that the paxos instance is approved last time, and may directly read from the designated location when performing paxos instance update. For another example, when a paxos instance update is executed, the proposal node may also actively obtain, from any one of the approval nodes that approve the last approved paxos instance, a sequence number that was successfully used by the last approved paxos instance.
Step 207: the proposal node initiates an approval request to all approval nodes by using the updated instance ID of the paxos instance and the sequence number successfully used by the last approved paxos instance;
here, the approval request may further include an updated value of the paxos instance. Specifically, the value of the paxos instance can be obtained by using a correlation method existing in the paxos algorithm. For example, the update request may be obtained according to a scheme initiated by the client, or may be obtained according to the value of an approved paxos instance.
Step 208: each approval node receives the approval request, judges whether to accept the approval request, if so, approves the update of the paxos instance, executes the update of the current scheme, and returns an approval response to the proposal node, otherwise, rejects the approval request of the proposal node;
in practical application, the approval node receives the approval request, judges whether the sequence number in the approval request is greater than the sequence number in the approval request replied last time in the same paxos instance, if so, accepts the approval request, returns an OK message to the proposal node, and if not, ignores the preparation request and does not return any message to the proposal node.
Step 209: the proposal node receives the agreement responses returned by each approval node, judges whether the number of the agreement responses meets the requirement of most groups, if so, confirms that the paxos instance is approved for updating, and continues to step 214, otherwise, continues to step 210;
step 210: the proposal node starts to execute the preparation process of paxos instance updating, calculates a serial number SN1 and initiates a preparation request to all the approval nodes by the serial number SN 1;
specifically, the proposal node may calculate the serial number SN by using a pre-agreed calculation method.
For example, the serial number SN may be calculated by a method shown in the following formula (1):
SN=M×N+n (1)
wherein, SN is a serial number, M is a serial number calculation turn of the paxos instance, N is a total number of proposed nodes, and N is a number of a current proposed node. If the current distributed computing system comprises 10 proposal nodes, the number of the proposal nodes is 0 to 9 respectively, the round of computing the sequence number under the paxos instance to be updated is the first time, namely M =0, then the minimum sequence number SN _ INIT of the paxos instance is 0.
Step 211: each approval node receives the preparation request, judges whether to accept the preparation request, and if so, returns an agreement response to the proposal node; if not, ignoring the preparation request of the proposal node;
in practical application, the approval node receives the preparation request, determines whether the sequence number SN1 in the preparation request is greater than the sequence number in the preparation request replied last time by the same paxos instance, accepts the preparation request if the sequence number SN1 in the preparation request is greater than the sequence number in the preparation request replied last time by the same paxos instance, ignores the preparation request if the sequence number SN in the preparation request is not greater than the sequence number in the preparation request replied last time by the same paxos instance.
Step 212: the proposal node receives the agreement response returned by each approval node, if the number of the agreement response meets the requirement of most dispatches, the step 213 is continued, otherwise, the step 210 is returned;
step 213: the proposal node initiates an approval request to all approval nodes with the updated instance ID and serial number SN1 of the paxos instance, and returns to step 208;
here, the updated value of the paxos instance is also included in the approval request. Specifically, the value of the paxos instance can be obtained by using a correlation method existing in the paxos algorithm. For example, the update request may be obtained according to a scheme initiated by the client, or may be obtained according to the value of an approved paxos instance.
Step 214: and the current scheme is updated successfully, and the process is ended.
The majority scheduling requirement may be set according to the requirement of the practical application, for example, the majority scheduling requirement may be more than half, or may be more than three quarters of the total number, and so on. Typically, most pie require more than half the settings to be used.
If a plurality of proposal nodes execute updating on the same paxos instance, the approved probability is reduced when the proposal node initiates an approval request with the sequence number successfully used by the approved paxos instance last time, and the execution efficiency of the method in the embodiment of the invention is reduced. In order to solve the problem, a proposal node can be pre-designated as a main proposal node, so that a client accesses the main proposal node preferentially, the same paxos instance can be ensured to be updated by the same proposal node, the approval probability of an approval request initiated by a sequence number successfully used by the last approved paxos instance of the proposal node is improved, and correspondingly, the execution efficiency of the method in the embodiment of the invention is also improved.
Specifically, a configuration file may be preset, where the configuration file is used to instruct the clients to have limited access to a specified main proposal node, and all the clients may read the configuration file. In this way, the client can access the master proposal node by reading the configuration file before initiating a more proposal request. Here, the configuration file may be in a text format or other similar format.
The proposal node executing the process shown in fig. 2 in the embodiment of the present invention is preferably a pre-designated master proposal node.
An embodiment of the present invention further provides a device for paxos instance update, and as shown in fig. 3, the device for paxos instance update may include: a learning unit 31, and an approval unit 32; wherein,
the learning unit 31 is configured to execute a learning process, obtain instance information of an approved paxos instance in a current scheme, and obtain an instance ID of the paxos instance to be updated according to the instance information of the approved paxos instance;
and the approval unit 32 is configured to obtain a sequence number successfully used by the paxos instance that is approved last time, directly initiate an approval request to all approval nodes by using the sequence number successfully used by the paxos instance that is approved last time and the instance ID, confirm that the paxos instance that needs to be updated is approved after the approval request is accepted by most of the approval nodes, and update the paxos instance that needs to be updated.
Here, the apparatus may further include a preparation unit 33 configured to perform a preparation process with the instance ID obtained by the learning unit 31 to determine a serial number after receiving the notification of the approval unit 32.
Wherein, the approving unit 32 is further configured to notify the preparing unit 33 when the approval request is not accepted by a plurality of the approving nodes; and the processing unit is configured to initiate an approval request to all approval nodes according to the sequence number determined by the preparation unit 33 and the instance ID obtained by the learning unit 31, confirm that the paxos instance to be updated is approved and update the paxos instance to be updated after the approval request is accepted by a plurality of approval nodes;
here, the learning unit 31 is configured to receive a scheme update request initiated by a client, and initiate a learning request to all approval nodes; and when the number of approved nodes accepting the learning request meets the requirement of most dispatches, obtaining instance information of approved paxos instances under the current scheme.
If there are multiple devices performing updates on the same paxos instance, the probability of approval is reduced when the devices initiate an approval request with the sequence number successfully used by the approved paxos instance last time, and the execution efficiency is reduced accordingly.
In order to solve the problem, a proposal node in the distributed computing system may be designated as a main proposal node in advance, and the main proposal node is used as the above device for updating paxos instances, so that a client preferentially accesses the main proposal node, which can ensure that the same paxos instance is updated by the same proposal node, improve the approval probability that the proposal node initiates an approval request with the sequence number successfully used by the last approved paxos instance, and correspondingly improve the execution efficiency of the method in the embodiment of the present invention.
Specifically, a configuration file may be preset, where the configuration file is used to instruct the clients to have limited access to a specified main proposal node, and all the clients may read the configuration file. In this way, the client can access the master proposal node by reading the configuration file before initiating a more proposal request. Here, the configuration file may be in a text format or other similar format.
In the embodiment of the invention, the equipment for updating paxos instances directly initiates the approval requests to all approval nodes by adopting the sequence number which is successfully used by the last approved paxos instance, so that the maximum sequence number in the used sequence numbers is directly used for initiating the approval requests to update the paxos instances, the execution success rate is higher, the repeated execution of the preparation process can be avoided, the existing criterion of the paxos algorithm is not violated, the execution of the paxos algorithm is simplified, the execution efficiency of the paxos algorithm is improved, and the problem of low execution efficiency of the existing paxos algorithm is solved.
The embodiment of the invention provides a distributed computing system, which comprises the equipment for paxos instance updating in the embodiment.
In practical applications, the distributed computing system provided by the embodiment of the present invention mainly includes: at least one proposal node and at least two approval nodes, wherein the interaction between the proposal node and each approval node can implement paxos algorithm, and the proposal node is the device for updating paxos instances in the above embodiment.
If there are multiple proposal nodes in the distributed computing system, the device for paxos instance update is preferably a pre-designated master proposal node.
In practical application, if a plurality of proposal nodes execute updating on the same paxos instance, the approved probability is reduced when the proposal node initiates an approval request with the sequence number successfully used by the previously approved paxos instance, and the efficiency of the system executing updating on paxos instances in the embodiment of the present invention is reduced accordingly. In order to solve the problem, a proposal node can be pre-designated as a main proposal node, so that a client accesses the main proposal node preferentially, the same paxos instance can be ensured to be updated by the same proposal node, the approval probability of an approval request initiated by a sequence number successfully used by the last approved paxos instance of the proposal node is improved, and correspondingly, the execution efficiency of the method in the embodiment of the invention is also improved.
Specifically, a configuration file may be preset, where the configuration file is used to instruct the clients to have limited access to a specified main proposal node, and all the clients may read the configuration file. In this way, the client can access the master proposal node by reading the configuration file before initiating a more proposal request. Here, the configuration file may be in a text format or other similar format.
In practice, the proposal node and the approval node may be computers, mobile devices or other similar devices. There may be one or two or more proposal nodes, and each proposal node may initiate paxos instance update. The approval nodes are completely independent from each other.
Referring to fig. 4, an example of a distributed computing system according to an embodiment of the present invention includes a proposal node 41 and four approval nodes 42.
When the distributed computing system executes paxos instance updating in the embodiment of the invention, the proposal node directly initiates an approval request to all approved nodes by adopting the sequence number which is successfully used by the last approved paxos instance, so that the approval request is directly initiated by adopting the largest sequence number in the used sequence numbers to execute paxos instance updating, the execution success rate is higher, the repeated execution of the preparation process can be avoided, the existing criterion of the paxos algorithm is not violated, the execution of the paxos algorithm is simplified, the execution efficiency of the paxos algorithm is improved, and the problem of low execution efficiency of the existing paxos algorithm is solved.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (8)
1. A paxos instance update method, the method comprising:
the proposal node executes a learning process to obtain instance information of an approved paxos instance under the current scheme, and obtains an instance ID of the paxos instance to be updated according to the instance information of the approved paxos instance;
the proposal node acquires a sequence number successfully used by the paxos instance which is approved last time, directly initiates an approval request to all approval nodes by using the sequence number successfully used by the paxos instance which is approved last time and the instance ID, confirms that the paxos instance which needs to be updated is approved and updates the paxos instance which needs to be updated after the approval request is accepted by most approval nodes;
if the approval request is not accepted by a plurality of dispatching the approval nodes, the method further comprises:
the proposal node executes a preparation process by using the instance ID and determines a serial number;
and the proposal node initiates an approval request to all approval nodes by using the sequence number determined by the preparation process and the instance ID, confirms that the paxos instance to be updated is approved after the approval request is accepted by most approval nodes, and updates the paxos instance to be updated.
2. The method of claim 1, wherein the proposal node performs a learning process to obtain instance information of approved paxos instances under the current solution, comprising:
the proposal node receives a scheme updating request initiated by a client and initiates a learning request to all approval nodes; and when the number of approved nodes accepting the learning request meets the requirement of most dispatches, obtaining instance information of approved paxos instances under the current scheme.
3. The method according to claim 1 or 2, wherein the proposal node is a pre-designated master proposal node.
4. An apparatus for paxos instance update, the apparatus comprising: a learning unit and an approval unit; wherein,
the learning unit is used for executing a learning process, obtaining instance information of an approved paxos instance under a current scheme, and obtaining an instance ID of the paxos instance to be updated according to the instance information of the approved paxos instance;
the approval unit is used for acquiring the sequence number successfully used by the paxos instance approved last time, directly sending an approval request to all approval nodes by using the sequence number successfully used by the paxos instance approved last time and the instance ID, confirming that the paxos instance to be updated is approved and updating the paxos instance to be updated after the approval request is accepted by most of the approval nodes;
the apparatus further comprises: a preparation unit;
the approving unit is further used for notifying the preparation unit when the approving request is not accepted by a plurality of approving nodes; and the device is used for initiating an approval request to all approval nodes by using the sequence number determined by the preparation unit and the instance ID obtained by the learning unit, confirming that the paxos instance to be updated is approved and updating the paxos instance to be updated after the approval request is accepted by a plurality of approval nodes;
the preparation unit is used for executing a preparation process according to the instance ID obtained by the learning unit and determining a serial number after receiving the notice of the approval unit.
5. The device according to claim 4, wherein the learning unit is configured to receive a scheme update request initiated by a client, and initiate a learning request to all approval nodes; and when the number of approved nodes accepting the learning request meets the requirement of most dispatches, obtaining instance information of approved paxos instances under the current scheme.
6. The apparatus of claim 4 or 5, wherein the apparatus for paxos instance update is a pre-designated master proposal node in a distributed computing system.
7. A distributed computing system, characterized in that the system comprises an apparatus for paxos instance update according to any of claims 5 to 6.
8. The system of claim 7, wherein when there are multiple proposal nodes in the distributed computing system, the device for paxos instance update is a pre-designated master proposal node in the distributed computing system.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210593773.6A CN103916426B (en) | 2012-12-31 | 2012-12-31 | A kind of paxos examples update method, equipment and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210593773.6A CN103916426B (en) | 2012-12-31 | 2012-12-31 | A kind of paxos examples update method, equipment and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103916426A CN103916426A (en) | 2014-07-09 |
CN103916426B true CN103916426B (en) | 2017-06-27 |
Family
ID=51041830
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210593773.6A Active CN103916426B (en) | 2012-12-31 | 2012-12-31 | A kind of paxos examples update method, equipment and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103916426B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107707595B (en) * | 2017-03-17 | 2018-06-15 | 贵州白山云科技有限公司 | A kind of member organizes variation and device |
CN108924240B (en) * | 2018-07-19 | 2022-08-12 | 腾讯科技(深圳)有限公司 | Distributed processing method, device and storage medium based on consistency protocol |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1690968A (en) * | 2003-12-30 | 2005-11-02 | 微软公司 | Simplified paxos |
-
2012
- 2012-12-31 CN CN201210593773.6A patent/CN103916426B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1690968A (en) * | 2003-12-30 | 2005-11-02 | 微软公司 | Simplified paxos |
Also Published As
Publication number | Publication date |
---|---|
CN103916426A (en) | 2014-07-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11762697B2 (en) | Method and apparatus for scheduling resource for deep learning framework | |
US20170339536A1 (en) | Offline peer-assisted notification delivery | |
EP4207688A1 (en) | Asynchronous bookkeeping method and apparatus for blockchain, medium, and electronic device | |
US10951572B1 (en) | Watermark-based message queue | |
CN103914313B (en) | A kind of paxos examples update method, equipment and system | |
CN108650667A (en) | Terminal scheduling method and apparatus | |
CN105978938A (en) | Service processing equipment service status determining method and scheduling equipment | |
CN111435315A (en) | Method, apparatus, device and computer readable medium for allocating resources | |
CN103916426B (en) | A kind of paxos examples update method, equipment and system | |
CN109088918B (en) | Interaction method, client device and server device | |
CN103916419B (en) | A kind of paxos examples update method, equipment and system | |
CN111510327A (en) | Network connection method and device for training participants of co-training model | |
CN109245941B (en) | Service compensation method and device | |
CN108628901A (en) | A kind of data-updating method and device | |
CN106790354A (en) | A kind of communication means and its device of anti-data congestion | |
CN114338051B (en) | Method, device, equipment and medium for acquiring random number by block chain | |
CN109728937A (en) | Method and device for updating network state of voice module | |
CN111611068B (en) | Data writing method in distributed system, server and client | |
CN114363988A (en) | Clustering method and device and electronic equipment | |
CN114374681A (en) | Task execution method, device, equipment and storage medium | |
CN112566221A (en) | Information synchronization method, device, equipment and readable storage medium | |
CN115378991B (en) | Message processing method, device, equipment and computer storage medium | |
CN105357243A (en) | Remote interaction method and apparatus with device in the Internet of things | |
CN115622988B (en) | Call response method and device for web interface, electronic equipment and storage medium | |
CN115134405B (en) | Data processing method and device, electronic equipment and computer readable 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP02 | Change in the address of a patent holder |
Address after: Room 810, 8 / F, 34 Haidian Street, Haidian District, Beijing 100080 Patentee after: BEIJING D-MEDIA COMMUNICATION TECHNOLOGY Co.,Ltd. Address before: 100089 Beijing city Haidian District wanquanzhuang Road No. 28 Wanliu new building 6 storey block A room 602 Patentee before: BEIJING D-MEDIA COMMUNICATION TECHNOLOGY Co.,Ltd. |
|
CP02 | Change in the address of a patent holder |