Information processing method, device and electronic equipment

By introducing a voting mechanism in the distributed storage system and judging the node status based on heartbeats and agreed parameters, the problem of business blocking when the two-node cluster is expanded to three nodes and then back to two nodes is solved, and non-blocking expansion and contraction operations are realized. , improving the scalability and reliability of the system.

CN113886129BActive Publication Date: 2024-08-23LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111226676.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-21
Publication Date
2024-08-23
Estimated Expiration
2041-10-21

AI Technical Summary

Technical Problem

In a distributed storage system, when a two-node cluster is expanded to three nodes and then back to two nodes, quorum nodes need to be frequently removed and re-added, causing business congestion.

Method used

By introducing a voting mechanism in the cluster, the node status is judged based on the heartbeat and agreed parameters to determine whether the voting conditions are met, and then it is decided whether to vote for the slave node to perform business as the new master node or to remove the original master node, avoiding the need for the second master node. Remove and add operations of a node.

Benefits of technology

It reduces the blocking time of read and write services during the expansion and contraction process, improves the scalability and reliability of the system, and avoids business interruptions caused by node removal and addition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113886129B
    Figure CN113886129B
Patent Text Reader

Abstract

The present application provides an information processing method, device and system, in which the first slave node initiates a voting request to the first node if it does not receive the first heartbeat of the master node within the first preset time period. If the voting conditions are met, the first node votes for the first slave node; if the voting conditions are not met, the first node is prohibited from voting for the first slave node. If the cluster includes a master node and a slave node, the first node votes for the slave node so that the slave node serves as the new master node in the cluster; voting for the slave node is prohibited to prohibit the first slave node from performing business as the new master node. In a two-node cluster, its vote plays a decisive role; in a three-node cluster, the vote of the first node has no substantial effect. Therefore, in the process of expanding a two-node cluster to three nodes and then changing back to two nodes, there is no need to remove the first node and then join the cluster, thereby reducing the blocking time of the read and write business caused by executing this operation process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information technology, and more specifically, to an information processing method, device and electronic device. Background Art

[0002] In distributed storage systems, building a scalable two-node cluster has attracted widespread attention in order to save costs. The arbitration node (witness) in a two-node cluster is used to distinguish between node failures and split-brain scenarios, which is essential, while a three-node cluster no longer requires an arbitration node (witness), which brings challenges to the handling of witnesses when the cluster is expanded.

[0003] In the prior art, when a two-node cluster is expanded to three nodes and then changed back to two nodes,

[0004] When the cluster is expanded to three nodes, the witness needs to be removed, and when it becomes two nodes, the witness needs to be added back. Therefore, during the expansion and contraction of the cluster, the removal and introduction of the witness will cause business congestion. Summary of the invention

[0005] In view of this, the present application provides an information processing method as follows:

[0006] An information processing method, applied to a first node connected to a cluster, comprising:

[0007] receiving a voting request sent by a first slave node, wherein the voting request indicates that the first slave node has not received a first heartbeat of a master node within a first preset time period;

[0008] Based on the voting condition being met, voting for the first slave node; based on the voting condition not being met, prohibiting voting for the first slave node;

[0009] wherein, based on the fact that the cluster includes a master node and a slave node, voting for the first slave node so that the first slave node executes services as a new master node in the cluster and removes the original master node; prohibiting voting for the first slave node so as to prohibit the first slave node from executing services as a new master node;

[0010] Among them, based on the fact that the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node, so that the first slave node executes the business as the new master node in the cluster and removes the original master node; the first node is prohibited from voting for the first slave node, and the second slave node and the first slave node vote for the first slave node, so that the first slave node executes the business as the new master node in the cluster and removes the original master node.

[0011] Optionally, in the above method, the voting weight of the slave node is 1, and the voting weight of the first node is greater than 0 and less than 1.

[0012] Wherein, based on the fact that the cluster includes a master node and a slave node, the first node and the first slave node vote for the first slave node so that the number of votes for the first slave node in the cluster exceeds half of the total number of nodes in the cluster; the first node is prohibited from voting for the first slave node so that the number of votes for the first slave node in the cluster does not exceed half of the total number of nodes in the cluster;

[0013] Among them, based on the fact that the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node so that the number of votes for the first slave node in the cluster exceeds half of the total number of nodes in the cluster; the first node is prohibited from voting for the first slave node, and the second slave node and the first slave node vote for the first slave node so that the number of votes for the first slave node in the cluster exceeds half of the total number of nodes in the cluster.

[0014] Optionally, the above method, before receiving the voting request sent by the first slave node, further includes:

[0015] Receive a second heartbeat sent by the master node, where the second heartbeat carries the agreed parameters;

[0016] The agreed parameters are recorded, where the agreed parameters include lease information.

[0017] Optionally, the above method, determining whether the voting condition is met, includes:

[0018] Based on the agreed parameters, determining whether the lease with the master node has expired at the time of receiving the voting request;

[0019] If it has not expired, the voting condition is not met, so that the first slave node continues to send voting requests after a second preset time period;

[0020] If it expires, based on the agreed parameters of the first slave node carried in the voting request, it is determined whether the agreed parameters of the first slave node meet the preset conditions. If the preset conditions are met, it is determined that the voting conditions are met; if the preset conditions are not met, it is determined that the voting conditions are not met, so that the first slave node exits or restarts.

[0021] Optionally, in the above method, the agreed parameters further include a version number and a latest log number, and judging whether the agreed parameters of the first slave node meet preset conditions includes:

[0022] Determine whether the version number of the first slave node is greater than the recorded version number, and obtain a first determination result;

[0023] Determine whether the latest log number of the first slave node is greater than the latest recorded historically submitted log number, and obtain a second determination result;

[0024] Based on the fact that the first judgment result represents that the version number of the first slave node is greater than the recorded version number and the second judgment result represents that the latest log number of the first slave node is greater than the latest recorded historically submitted log number, it is determined that the agreed parameters of the first slave node meet the preset conditions; otherwise, the agreed parameters of the first slave node do not meet the preset conditions.

[0025] Optionally, the above method further includes:

[0026] The receiving master node removes the first slave node based on the failure to receive the third heartbeat of the first node within a third preset time period, triggering a second heartbeat, wherein the second heartbeat carries the agreed parameters.

[0027] Optionally, the above method further includes:

[0028] Receive a second heartbeat triggered when the master node controls the second slave node to join the cluster, the second heartbeat includes the agreed parameters of the master node, and the second slave node is the same as or different from the first slave node;

[0029] Receive the heartbeat of the second slave node.

[0030] An information processing device, comprising:

[0031] A receiving unit, configured to receive a voting request sent by a first slave node, wherein the voting request indicates that the first slave node has not received a first heartbeat of a master node within a first preset time period;

[0032] a voting unit, configured to vote for the first slave node if a voting condition is met, and prohibit voting for the first slave node if the voting condition is not met;

[0033] Wherein, in a cluster including a master node and a slave node, voting for the first slave node enables the first slave node to execute services as a new master node in the cluster and remove the original master node; prohibiting voting for the first slave node to prohibit the first slave node from executing services as a new master node;

[0034] Among them, based on the fact that the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node, so that the first slave node executes the business as the new master node in the cluster and removes the original master node; the first node is prohibited from voting for the first slave node, and the second slave node and the first slave node vote for the first slave node, so that the first slave node executes the business as the new master node in the cluster and removes the original master node.

[0035] An information processing system, comprising:

[0036] The master node is used to generate a first heartbeat carrying the agreed parameters and send it to the slave node, so that the log of the master node is synchronized to the slave node, and generate a second heartbeat carrying the agreed parameters and send it to the first node;

[0037] At least one slave node is used to receive the first heartbeat and generate a third heartbeat carrying the agreed parameters and send it to the master node to reply to the first heartbeat, and generate a fourth heartbeat and send it to the first node; wherein the first slave node generates a voting request and sends it to the first node if it does not receive the first heartbeat of the master node in the first preset time period;

[0038] a first node, configured to vote for the first slave node based on receiving the voting request and satisfying a voting condition, and to prohibit voting for the first slave node based on not satisfying the voting condition;

[0039] Wherein, in a cluster including a master node and a slave node, voting for the first slave node enables the first slave node to execute services as a new master node in the cluster and remove the original master node; prohibiting voting for the first slave node to prohibit the first slave node from executing services as a new master node;

[0040] Among them, based on the fact that the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node, so that the first slave node executes the business as the new master node in the cluster and removes the original master node; the first node is prohibited from voting for the first slave node, and the second slave node and the first slave node vote for the first slave node, so that the first slave node executes the business as the new master node in the cluster and removes the original master node.

[0041] Optionally, in the above-mentioned system, the master node is used to determine that the system is a faulty system and execute the response method of the faulty system if it does not receive the third heartbeat from the slave node within a preset time period; after removing the slave node in the faulty system, it executes the response method of the normal system and triggers the second heartbeat to be sent to the first node.

[0042] Through the above technical solution, it can be known that compared with the prior art, the present application provides an information processing method, which is applied to a first node connected to a cluster. The first slave node does not receive the first heartbeat of the master node in the first preset time period and initiates a voting request to the first node. Based on satisfying the voting conditions, the first node votes for the first slave node; based on not satisfying the voting conditions, the first node is prohibited from voting for the first slave node; wherein, if the cluster includes a master node and a slave node, the first node votes for the first slave node, so that the first slave node performs the business as the new master node in the cluster and removes the original master node; prohibiting voting for the first slave node to prohibit the first slave node from performing the business as the new master node; wherein, if the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node, and the first slave node performs the business as the new master node in the cluster and removes the original master node; the first node is prohibited from voting for the first slave node, and the second slave node and the first slave node vote for the first slave node, and the first slave node can still perform the business as the new master node in the cluster and remove the original master node. In this solution, due to the voting rights of the first node, in a two-node cluster, its vote plays a decisive role; in a three-node cluster, the vote of the first node has no substantial effect. Therefore, in the process of expanding a two-node cluster to three nodes and then returning to two nodes, there is no need to remove the first node and then add it to the cluster, reducing the blocking time of read and write services caused by executing this operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work.

[0044] Figure 1 is a flow chart of Example 1 of an information processing method provided by the present application;

[0045] Figure 2 This is a cluster diagram in Example 1 of an information processing method provided by the present application;

[0046] Figure 3 It is a schematic diagram of cluster expansion and contraction in the prior art and an information processing method provided by this application;

[0047] Figure 4 is a flow chart of Example 2 of an information processing method provided by the present application;

[0048] Figure 5 This is a voting diagram of a split-brain failure in a cluster in Example 2 of an information processing method provided by the present application;

[0049] Figure 6 is a flow chart of Example 3 of an information processing method provided by the present application;

[0050] Figure 7 is a flowchart of Example 4 of an information processing method provided by the present application;

[0051] Figure 8 is a flowchart of Example 5 of an information processing method provided by the present application;

[0052] Fig. 9 It is a structural schematic diagram of an information processing device embodiment provided by the present application;

[0053] Fig.10 It is a structural diagram of an information processing system embodiment provided by the present application. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0055] like Figure 1 The figure is a flowchart of an information processing method embodiment 1 provided by the present application. The method is applied to an electronic device, which serves as a first node connected to a cluster. The method includes the following steps:

[0056] Step S101: receiving a voting request sent by a first slave node;

[0057] The voting request indicates that the first slave node has not received the first heartbeat of the master node within a first preset time period.

[0058] Moreover, if the first slave node does not receive the first heartbeat of the master node within the first preset time period, the first slave node determines that the current cluster fails, initiates a vote to the master node and the first node, and suspends receiving service requests from clients.

[0059] The cluster includes two or three nodes, specifically: one master node and one slave node, or one master node and two slave nodes. The master node in the cluster can control the addition or removal of slave nodes, while the slave node has no authority to control the addition of other slave nodes or the removal of the master node and other slave nodes.

[0060] In the specific implementation, all operation logs in the cluster are synchronized from the master node to the slave node, and the slave node synchronizes its log to the master node. Log synchronization is not performed between slave nodes.

[0061] Specifically, log synchronization between nodes is achieved through heartbeat.

[0062] like Figure 2 The diagram shows a cluster, where (1) shows a two-node cluster, which includes a master node and a slave node, and the master node and the slave node communicate with each other via heartbeats; (2) shows a three-node cluster, which includes a master node and two slave nodes, and the master node and the slave node communicate with each other via heartbeats, and there is no heartbeat interaction between the two slave nodes.

[0063] Specifically, when the first slave node does not receive the first heartbeat of the master node within the first preset time period, it sends a voting request to the first node. The first node determines whether the current cluster meets the voting condition based on the voting request.

[0064] For example, the period for the master node to send the first heartbeat to the first slave node is 1 second, and the first preset time period can be a time greater than the period for sending the first heartbeat, such as 3 seconds or 5 seconds. This application does not impose any restrictions on the period for sending heartbeats and the value of the first preset time period.

[0065] It should be noted that only the slave node initiates the voting request, and the master node does not need to vote. Because the master node will not vote for the slave node, other slave nodes vote for the slave nodes, and the first node determines whether to initiate voting for the slave node based on whether the voting conditions are met.

[0066] Step S102: Determine whether voting conditions are met;

[0067] The first node determines whether the voting condition is met based on the current cluster situation, and if so, executes step S103; otherwise, executes step S104.

[0068] Step S103: voting for the first slave node;

[0069] Step S104: prohibiting voting for the first slave node.

[0070] wherein, based on the fact that the cluster includes a master node and a slave node, voting for the first slave node so that the first slave node executes services as a new master node in the cluster and removes the original master node; prohibiting voting for the first slave node so as to prohibit the first slave node from executing services as a new master node;

[0071] Among them, based on the fact that the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node, so that the first slave node executes the business as the new master node in the cluster and removes the original master node; the first node is prohibited from voting for the first slave node, and the second slave node and the first slave node vote for the first slave node, so that the first slave node executes the business as the new master node in the cluster and removes the original master node.

[0072] It should be noted that in this application, the Raft algorithm is used.

[0073] Specifically, Raft reaches consensus through elected leaders (master nodes). A server (node) in a cluster is either a leader (master node) or a follower (slave node), and can be a candidate in the precise case of an election (the leader is unavailable). The leader is responsible for replicating the log to the followers. It periodically notifies followers of its existence by sending heartbeat messages. Each follower has a timeout for which it expects a heartbeat from the leader. The timeout is reset when a heartbeat is received. If no heartbeat is received when the timeout expires, the follower changes its state to a candidate and starts a leadership election.

[0074] It should be noted that the Raft algorithm follows the majority principle. All operation logs in the cluster are synchronized from the master node to the slave nodes. They can be applied to the state machine only after being accepted by the majority of nodes. The master node sends heartbeats to the slave nodes regularly. In addition, the Raft algorithm provides log synchronization (to ensure data consistency between the master and slave nodes), election (election of the master node), voting and other functions. Generally, the Raft algorithm requires at least three nodes (majority principle) to work.

[0075] In this embodiment, in a two-node cluster, the first node can be regarded as a virtual node in raft, which does not store specific data and does not accept raft logs. It only determines whether to vote when a slave node requests a vote, and votes for the slave node when the voting conditions are met.

[0076] The voting weight of the slave node is 1, and the voting weight of the first node is greater than 0 and less than 1.

[0077] Wherein, based on the fact that the cluster includes a master node and a slave node, the first node and the first slave node vote for the first slave node so that the number of votes for the first slave node exceeds half of the total number of nodes in the cluster; the first node is prohibited from voting for the first slave node so that the number of votes for the first slave node does not exceed half of the total number of nodes in the cluster;

[0078] Wherein, based on the fact that the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node so that the number of votes for the first slave node exceeds half of the total number of nodes in the cluster; the first node is prohibited from voting for the first slave node, and the second slave node and the first slave node vote for the first slave node so that the number of votes for the first slave node exceeds half of the total number of nodes in the cluster.

[0079] Specifically, since the voting weight of the first node is less than 1, when the cluster has only a master node and a slave node, the vote of the first node is decisive. When there is a master node and two slave nodes in the cluster, the first slave node that initiates the voting request votes for itself, and the second slave node votes for the first slave node. The first slave node gets two votes, which exceeds half of the nodes in the cluster. Whether the first node votes for the first slave node or not does not affect the voting result, as long as the principle of majority of nodes is followed. Therefore, when the cluster is expanded from a two-node cluster to a three-node cluster, there is no need to remove the first node, and when the three nodes are changed back to two nodes, there is no need to add the first node back, which will not cause business blockages during the expansion and contraction of the cluster due to the removal and introduction of the first node.

[0080] like Figure 3 The diagram shows a cluster expansion and contraction diagram in an information processing method provided by the prior art and the present application. The prior art includes: expanding two nodes to three nodes, from two nodes and one arbitration node to three nodes, during which the arbitration node is removed; shrinking three nodes to two nodes, from three nodes to two nodes and an arbitration node, wherein the arbitration node is added, and during the above cluster expansion and contraction process, the arbitration node needs to be removed and added. In this solution, it includes: expanding two nodes to three nodes, from two nodes and a first node to three nodes and a first node; shrinking three nodes to two nodes, from three nodes and a first node to two nodes and a first node, and during the above cluster expansion and contraction process, the first node does not need to be removed and added.

[0081] In summary, the present embodiment provides an information processing method, in which the first slave node does not receive the first heartbeat of the master node in the first preset time period and initiates a voting request to the first node, based on the voting condition being met, the first node votes for the first slave node; based on the voting condition not being met, the first node is prohibited from voting for the first slave node; wherein, if the cluster includes a master node and a slave node, the first node votes for the first slave node, so that the first slave node performs the service as the new master node in the cluster and removes the original master node; prohibits voting for the first slave node to prohibit the first slave node from performing the service as the new master node; wherein, if the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node, the first slave node performs the service as the new master node in the cluster and removes the original master node; the first node is prohibited from voting for the first slave node, the second slave node and the first slave node vote for the first slave node, and the first slave node can still perform the service as the new master node in the cluster and remove the original master node. In this scheme, due to the voting rights of the first node, its vote plays a decisive role in a two-node cluster; while in a three-node cluster, the vote of the first node has no substantial effect. Therefore, in the process of expanding a two-node cluster to three nodes and then changing back to two nodes, there is no need to remove the first node and then add it to the cluster, thereby reducing the blocking time of read and write services caused by executing this operation.

[0082] like Figure 4 The figure is a flowchart of Embodiment 2 of an information processing method provided by the present application, and the method comprises the following steps:

[0083] Step S401: receiving a second heartbeat sent by the master node, where the second heartbeat carries agreed parameters;

[0084] The first node receives the second heartbeat sent to it by the master node, and the second heartbeat only includes the agreed parameters but does not include the log content.

[0085] The first node is used as an arbitration node and is only used for voting arbitration when a cluster failure occurs.

[0086] Therefore, neither the master node nor the slave node synchronizes the log content to the first node.

[0087] Among them, the first node can determine that the master node is operating normally and no failure occurs based on the second heartbeat sent by the master node.

[0088] Step S402: Record the agreed parameters, where the agreed parameters include lease information;

[0089] Specifically, the first node sends the agreed parameters to the master node through the second heartbeat.

[0090] Specifically, the agreed parameters include lease information and master node identity, etc. The master node agrees on a lease term with the first node based on the lease information. Within the lease term, the first node recognizes the node that sends the lease information as the master node of the cluster.

[0091] The lease period agreed in the lease information is greater than the period of the second heartbeat.

[0092] For example, the period of the second heartbeat is 1 second, and the lease period agreed in the lease information may be 4 seconds, 5 seconds, or other values ​​that are greater than the period of the second heartbeat.

[0093] Due to various factors such as network delay, the time it takes for the first node to receive the second heartbeat may be greater than the cycle. Therefore, if the second heartbeat is not received during the heartbeat cycle, but the second heartbeat is received within the agreed lease period, it can be determined that the master node is operating normally and has no faults.

[0094] It should be noted that each time the first node receives the second heartbeat, it updates the agreed period between the first node and the master node based on the lease information therein.

[0095] Step S403: receiving a voting request sent by the first slave node;

[0096] Among them, step S403 is consistent with step S101 in embodiment 1, and is not described in detail in this embodiment.

[0097] Step S404: Based on the agreed parameters, determining whether the lease with the master node has expired at the time of receiving the voting request;

[0098] Wherein, based on the agreed lease period recorded in the agreed parameter, it is determined whether the lease between the first node and the master node has expired when the voting request is received.

[0099] Specifically, the time difference between the time when the voting request is received and the time when the second heartbeat carrying the agreed parameter is received is used to determine whether the time difference is greater than the agreed lease period.

[0100] As an example, the time when the voting request is received is 12:23:55'26, the time when the second heartbeat is received is 12:23:54'26, the agreed lease period is 5 seconds, and the time difference between the two times is 1 second, which is less than the agreed lease period, and the lease has not expired.

[0101] As an example, the time when the voting request is received is 12:23:59'26, the time when the second heartbeat is received is 12:23:53'26, the agreed lease period is 5 seconds, and the time difference between the two times is 6 seconds, which is greater than the agreed lease period, and the lease expires.

[0102] If it has not expired, that is, within the agreed lease period, the first node maintains a lease relationship with the master node and the voting condition is not met, step S408 is executed so that the first slave node continues to send voting requests after the second preset time period;

[0103] Among them, within the agreed lease period, the first node maintains the lease relationship, and it can be determined that the master node is normal and not faulty. The first slave node fails to receive the first heartbeat sent to it by the master node within the first preset time period. It may be due to network delay or brain split caused by the master-slave node network partition. In order to further determine the cause of the failure, the first slave node continues to send voting requests to the first node after waiting for the second preset time period until the lease of the master node and the first node expires.

[0104] Among them, the value of the second preset time period can be the same as or different from the value of the first preset time period. The present application does not limit the values ​​of the two preset time periods, and it only needs to be greater than the period of the first heartbeat.

[0105] Among them, if it expires, that is, exceeds the agreed lease period, and no heartbeat transmission is performed between the first node and the master node during the agreed lease period, the first node can consider that the master node has failed, and whether the first slave node can serve as the master node needs further judgment, and step S405 is executed.

[0106] Step S405: obtaining the agreed parameters of the first slave node from the voting request;

[0107] When the first slave node sends a voting request to the first node, the voting request carries the agreed parameters of the first slave node.

[0108] The agreed parameters of the first slave node include relevant information of the first slave node.

[0109] Step S406: Determine whether the agreed parameters of the first slave node meet the preset conditions. If so, determine that the voting conditions are met and execute step S407; if not, determine that the voting conditions are not met and execute step S408 to make the first slave node exit or restart.

[0110] Specifically, it is determined based on the agreed parameters of the first slave node whether the preset adjustment is met. If so, the first slave node can serve as the new master node, and the first node votes for the first slave node; if not, the first slave node cannot serve as the new master node, and the first node is prohibited from voting for the first slave node.

[0111] Specifically, when the lease between the master node and the first node expires, the first slave node still has not received the vote from the first node, that is, it is determined that the cluster failure is the partition of the master node (split brain), the first node is prohibited from voting for the first slave node, and the number of votes received by the first slave node fails to exceed half of the base points in the cluster. In order to resolve the split brain, the first node exits or restarts.

[0112] Figure 5 The figure shows a voting diagram for a split-brain failure in a cluster. In (1), in a two-node cluster, a slave node requests a vote from the first node. The first node responds with a rejection of the vote, and the slave node kills itself to exit. In (2), in a three-node cluster, slave node 1 requests a vote from the first node and slave node 2. Slave node 2 agrees to vote, and the first node responds with a rejection of the vote. The number of votes for slave node 1 is 2, reaching the majority and becoming the master node.

[0113] Step S407: voting for the first slave node;

[0114] Step S408: Forbid voting for the first slave node.

[0115] Among them, steps S407-408 are consistent with steps S103-104 in Example 1 and are not described in detail in this embodiment.

[0116] In summary, in an information processing method provided by this embodiment, during the normal operation of the cluster, the first node receives the second heartbeat sent by the master node, and the second heartbeat carries agreed parameters; the agreed parameters are recorded, and the agreed parameters include lease information; after the first node receives the voting request from the first slave node, a judgment is made based on the agreed parameters to determine whether to vote for the first slave node.

[0117] like Figure 6 The flowchart shown is a third embodiment of an information processing method provided by the present application, and the method comprises the following steps:

[0118] Step S601: receiving a second heartbeat sent by the master node, where the second heartbeat carries agreed parameters;

[0119] Step S602: Record the agreed parameters, where the agreed parameters include lease information.

[0120] Step S603: receiving a voting request sent by the first slave node;

[0121] Step S604: Based on the agreed parameters, determine whether the lease with the master node has expired at the time of receiving the voting request;

[0122] If it has not expired and the voting condition is not met, step S608 is executed so that the first slave node continues to send voting requests after the second preset time period;

[0123] If it is expired, execute step S605.

[0124] Step S605: Obtain the agreed parameters of the first slave node from the voting request;

[0125] Among them, steps S601-605 are consistent with steps S401-405 in Example 2, and are not described in detail in this embodiment.

[0126] Step S606: determining whether the version number of the first slave node is greater than the recorded version number, and obtaining a first determination result;

[0127] The agreed parameters include a version number and a latest log number.

[0128] The agreed parameters included in the second heartbeat include lease information, version number and latest log number, and the first node records the above content.

[0129] Specifically, the information in the first node is maintained as follows:

[0130] For the version number: initialized to -1, when the version number received from the master node is greater than the current version number, update; for the master node id: initialized to -1, when the heartbeat of the master node is not received after the lease period, reset to -1. If there is no abnormality in the master node, you can always renew the contract with the first node. For the log number: initialized to -1, when the log number update of the master node is received, update; for the node survival status: when the node heartbeat is received, the node status is updated to active (survival); voting function FUNC (version number, log number, lease time), used to decide whether to vote when running for the master node.

[0131] After the lease with the master node expires, it is necessary to determine whether the first slave node is eligible to become the new master node.

[0132] Step S607: Determine whether the latest log number of the first slave node is greater than the latest submitted log number in the history, and obtain a second determination result;

[0133] Specifically, the version number and log number of the first slave node are judged.

[0134] Specifically, if the version number of the first slave node is greater than the recorded version number, it is determined whether the version number of the first slave node is the latest in the cluster; if the latest log number of the first slave node is greater than the latest historical log number recorded, it is determined whether the latest log number of the first slave node is the latest in the cluster, so the first slave node is eligible to become the new master node. Otherwise, the master node is still available, the first slave node is not eligible to become the new master node, and the cluster failure is caused by brain split, so the first slave node exits the cluster or restarts and joins the cluster again.

[0135] Based on the fact that the first judgment result represents that the version number of the first slave node is greater than the recorded version number and the second judgment result represents that the latest log number of the first slave node is greater than the latest recorded historically submitted log number, it is determined that the agreed parameters of the first slave node meet the preset conditions, and step S608 is executed; otherwise, the agreed parameters of the first slave node do not meet the preset conditions, and step S609 is executed.

[0136] Step S608: voting for the first slave node;

[0137] Step S609: Forbid voting for the first slave node.

[0138] Among them, steps S608-609 are consistent with steps S407-408 in Example 2, and are not described in detail in this embodiment.

[0139] In summary, in an information processing method provided by this embodiment, the first node determines whether the master node fails based on the agreed lease period with the master node, and judges whether the slave node is qualified to become the master node in combination with the version number and the latest log number. Only a small amount of information of the master node and the slave node is needed to make the judgment, and the amount of data processing is small.

[0140] like Figure 7 The figure is a flowchart of Embodiment 4 of an information processing method provided by the present application, and the method comprises the following steps:

[0141] Step S701: receiving a voting request sent by a first slave node;

[0142] Step S702: Determine whether voting conditions are met;

[0143] If satisfied, execute step S703; otherwise, execute step S704;

[0144] Step S703: voting for the first slave node;

[0145] Step S704: prohibiting voting for the first slave node;

[0146] Among them, steps S701-704 are consistent with steps S101-104 in Example 1 and are not described in detail in this embodiment.

[0147] Step S705: receiving a second heartbeat triggered when the master node removes the first slave node based on not receiving the third heartbeat of the first node within a third preset time period, wherein the second heartbeat carries the agreed parameters.

[0148] It should be noted that step S705 can be executed before step S701 when the first node has not received the first heartbeat of the master node within the first preset time period, or it can be executed after step S704 when voting for the first slave node is prohibited.

[0149] In a specific implementation, the master node can control the addition and removal of slave nodes in the cluster, but the slave nodes cannot control the master node.

[0150] Among them, when a slave node fails, the master node can control the removal of the slave node.

[0151] This embodiment is for the case where a slave node fails.

[0152] Among them, if the master node does not receive the third heartbeat of the first slave node within the third preset time period, the master node can determine that the first slave node has failed. At this time, the master node removes the first slave node from the cluster, and the master node generates a second heartbeat. The second heartbeat carries agreed parameters, which include the time when the first slave node is removed, the version number of the master node, the latest log number and lease information, the master node identity, etc.

[0153] In a specific implementation, the master node does not receive the third heartbeat of the first slave node within a third preset time period. Since a node in the cluster fails, the cluster cannot provide normal read and write services as a faulty cluster. First, the master node controls the cluster's read request to become a degraded read and suspends the write request service. Then, the master node removes the faulty slave node from the cluster and controls the cluster to continue to provide read and write services as a normal cluster.

[0154] It should be noted that the generation of the second heartbeat has nothing to do with the heartbeat period sent by the master node to the first node. The master node sends heartbeats to the first node according to the set period. When changes occur in the cluster, the master node generates a heartbeat to send the agreed parameters of the master node when the change occurs to the first node for it to record.

[0155] The period of the third heartbeat may be the same as or different from the period of the first heartbeat.

[0156] It should be noted that the third preset time period is a time period greater than the third heartbeat cycle.

[0157] For example, the period for sending the third heartbeat from the slave node to the master node is 0.5 seconds, and the third preset time period can be a time greater than the period for sending the third heartbeat, such as 2 seconds or 5 seconds. This application does not limit the period for sending the third heartbeat and the value of the third preset time period.

[0158] In a specific implementation, the third preset time period and the first preset time period may have the same or different values.

[0159] In summary, in an information processing method provided by this embodiment, when a slave node fails, the master node removes the slave node and generates a second heartbeat to send to the first node, so that the first node records the agreed parameters of the master node when the cluster changes.

[0160] like Figure 8 The figure is a flowchart of Embodiment 5 of an information processing method provided by the present application, and the method comprises the following steps:

[0161] Step S801: receiving a voting request sent by a first slave node;

[0162] Step S802: Determine whether voting conditions are met;

[0163] If satisfied, execute step S803; otherwise, execute step S804;

[0164] Step S803: voting for the first slave node;

[0165] Step S804: prohibiting voting for the first slave node;

[0166] Step S805: receiving a second heartbeat triggered when the master node removes the first slave node based on not receiving the third heartbeat of the first node within a third preset time period, wherein the second heartbeat carries an agreed parameter;

[0167] Among them, steps S801-805 are consistent with steps S101-104 in Example 1 and are not described in detail in this embodiment.

[0168] Step S806: receiving a second heartbeat triggered when the master node controls the second slave node to join the cluster, wherein the second heartbeat includes the agreed parameters of the master node;

[0169] In this embodiment, the second slave node is the same as or different from the first slave node.

[0170] The solution in this application is for a two-node or three-node cluster.

[0171] A slave node is added to the cluster. The slave node can be a previously removed slave node / master node or a newly added slave node.

[0172] It should be noted that the master node in step S806 may be a new master node in the cluster after the failed master node is removed, or may be a master node that has not failed.

[0173] Among them, when the second slave node added is the slave node / master node that was previously removed, the master node that was previously removed is added as a slave node, and the current master node adds the second slave node to the cluster. The cluster may change from a single-node cluster to a two-node cluster, or from a two-node cluster to a three-node cluster. Due to the change in the cluster, the master node triggers a second heartbeat to send the agreed parameters of the master node when the change occurs to the first node for it to record.

[0174] Among them, when the added second slave node is a new slave node, the master node adds the second slave node to the cluster. The cluster may change from a single-node cluster to a two-node cluster, or from a two-node cluster to a three-node cluster. Due to the cluster change, the master node triggers the second heartbeat to send the agreed parameters of the master node when the change occurs to the first node for recording.

[0175] The second heartbeat carries agreed parameters, including the time when the second slave node is added, the version number of the master node, the latest log number and lease information, the master node identity, etc.

[0176] It should be noted that when the first slave node and the second slave node are the same slave node, the master node needs to synchronize the log increment when removing from the first slave node to the second slave node; when the second slave node and the first slave node are not the same node, the master node will synchronize all logs to the second slave node.

[0177] It should be noted that the generation of the second heartbeat has nothing to do with the heartbeat period sent by the master node to the first node. The master node sends heartbeats to the first node according to the set period. When changes occur in the cluster, the master node generates a heartbeat to send the agreed parameters of the master node when the change occurs to the first node for it to record.

[0178] Step S806: Receive the heartbeat of the second slave node.

[0179] After the second slave node joins the cluster, it also sends heartbeats to the first node periodically so that the first node records its situation.

[0180] In summary, in an information processing method provided by this embodiment, the master node controls the cluster to join the slave node, generates a second heartbeat and sends it to the first node, so that the first node records the agreed parameters of the master node when changes occur, and the second slave node joining the cluster also sends its heartbeat to the first node periodically, so that the first node also monitors the status of the second slave node.

[0181] Corresponding to the above-mentioned information processing method embodiment provided by the present application, the present application also provides an apparatus embodiment applying the information processing method.

[0182] like Fig. 9 The structure diagram of an information processing device embodiment provided by the present application is shown, and the device includes the following structures: a receiving unit 901 and a voting unit 902;

[0183] The receiving unit 901 is used to receive a voting request sent by a first slave node, wherein the voting request indicates that the first slave node has not received a first heartbeat of the master node in a first preset time period;

[0184] The voting unit 902 is configured to vote for the first slave node based on the voting condition being met, and prohibit voting for the first slave node based on the voting condition not being met;

[0185] Wherein, in a cluster including a master node and a slave node, voting for the first slave node enables the first slave node to execute services as a new master node in the cluster and remove the original master node; prohibiting voting for the first slave node to prohibit the first slave node from executing services as a new master node;

[0186] Among them, based on the fact that the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node, so that the first slave node executes the business as the new master node in the cluster and removes the original master node; the first node is prohibited from voting for the first slave node, and the second slave node and the first slave node vote for the first slave node, so that the first slave node executes the business as the new master node in the cluster and removes the original master node.

[0187] Optionally, the voting weight of the slave node is 1, and the voting weight of the first node is less than 1.

[0188] Wherein, based on the fact that the cluster includes a master node and a slave node, the first node and the first slave node vote for the first slave node so that the number of votes for the first slave node in the cluster exceeds half of the total number of nodes in the cluster; the first node is prohibited from voting for the first slave node so that the number of votes for the first slave node in the cluster does not exceed half of the total number of nodes in the cluster;

[0189] Among them, based on the fact that the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node so that the number of votes for the first slave node in the cluster exceeds half of the total number of nodes in the cluster; the first node is prohibited from voting for the first slave node, and the second slave node and the first slave node vote for the first slave node so that the number of votes for the first slave node in the cluster exceeds half of the total number of nodes in the cluster.

[0190] Optionally, the receiving unit is further used for:

[0191] Before receiving the voting request sent by the first slave node, receiving a second heartbeat sent by the master node, wherein the second heartbeat carries the agreed parameters;

[0192] The agreed parameters are recorded, where the agreed parameters include lease information.

[0193] Optionally, voting units are used to:

[0194] Based on the agreed parameters, determining whether the lease with the master node has expired at the time of receiving the voting request;

[0195] If it has not expired, the voting condition is not met, so that the first slave node continues to send voting requests after a second preset time period;

[0196] If it expires, based on the agreed parameters of the first slave node carried in the voting request, it is determined whether the agreed parameters of the first slave node meet the preset conditions. If the preset conditions are met, it is determined that the voting conditions are met; if the preset conditions are not met, it is determined that the voting conditions are not met, so that the first slave node exits or restarts.

[0197] Optionally, the agreed parameters also include a version number and a latest log number. The voting unit is specifically used for:

[0198] Determine whether the version number of the first slave node is greater than the recorded version number, and obtain a first determination result;

[0199] Determine whether the latest log number of the first slave node is greater than the latest recorded historically submitted log number, and obtain a second determination result;

[0200] Based on the fact that the first judgment result represents that the version number of the first slave node is greater than the recorded version number and the second judgment result represents that the latest log number of the first slave node is greater than the latest recorded historically submitted log number, it is determined that the agreed parameters of the first slave node meet the preset conditions; otherwise, the agreed parameters of the first slave node do not meet the preset conditions.

[0201] Optionally, the receiving unit is further used for:

[0202] The receiving master node removes the first slave node based on the failure to receive the third heartbeat of the first node within a third preset time period, triggering a second heartbeat, wherein the second heartbeat carries the agreed parameters.

[0203] Optionally, the receiving unit is further used for:

[0204] Receive a second heartbeat triggered when the master node controls the second slave node to join the cluster, the second heartbeat includes the agreed parameters of the master node, and the second slave node is the same as or different from the first slave node;

[0205] Receive the heartbeat of the second slave node.

[0206] Among them, the structural function explanation of the information processing device provided in this embodiment refers to the explanation of the above-mentioned method embodiment, and is not repeated in this embodiment.

[0207] In summary, the present embodiment provides an information processing device, in which the first slave node does not receive the first heartbeat of the master node in the first preset time period and initiates a voting request to the first node, based on the voting condition being met, the first node votes for the first slave node; based on the voting condition not being met, the first node is prohibited from voting for the first slave node; wherein, if the cluster includes a master node and a slave node, the first node votes for the first slave node, so that the first slave node performs the service as the new master node in the cluster and removes the original master node; prohibits voting for the first slave node to prohibit the first slave node from performing the service as the new master node; wherein, if the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node, the first slave node performs the service as the new master node in the cluster and removes the original master node; the first node is prohibited from voting for the first slave node, the second slave node and the first slave node vote for the first slave node, and the first slave node can still perform the service as the new master node in the cluster and remove the original master node. In this scheme, due to the voting right of the first node, its vote plays a decisive role in a two-node cluster; while in a three-node cluster, the vote of the first node has no substantial effect. Therefore, in the process of expanding a two-node cluster to three nodes and then changing back to two nodes, there is no need to remove the first node and then add it to the cluster, thereby reducing the blocking time of read and write services caused by executing this operation.

[0208] Corresponding to the above-mentioned information processing method embodiment provided by the present application, the present application also provides a system embodiment applying the information processing method.

[0209] like Fig.10 The structure diagram of an information processing system embodiment provided by the present application is shown, and the system includes the following parts: a master node 1001, at least one slave node 1002 and a first node 1003;

[0210] The master node 1001 is used to generate a first heartbeat carrying the agreed parameters and send it to the slave node, so that the log of the master node is synchronized to the slave node, and generate a second heartbeat carrying the agreed parameters and send it to the first node;

[0211] At least one slave node 1002 is configured to receive the first heartbeat and generate a third heartbeat carrying agreed parameters and send it to the master node to reply to the first heartbeat, and generate a fourth heartbeat and send it to the first node; wherein the first slave node generates a voting request and sends it to the first node if it does not receive the first heartbeat of the master node in the first preset time period;

[0212] Among them, the first heartbeat and the third heartbeat transmitted between the master node and the slave node are used to achieve log synchronization between the two nodes.

[0213] The first node 1003 is configured to vote for the first slave node based on receiving the voting request and satisfying the voting condition, and prohibit voting for the first slave node based on not satisfying the voting condition;

[0214] in, Fig.10 Among them, (1) indicates a system with one slave node, and (2) indicates a system with two slave nodes.

[0215] Wherein, in a cluster including a master node and a slave node, voting for the first slave node enables the first slave node to execute services as a new master node in the cluster and remove the original master node; prohibiting voting for the first slave node to prohibit the first slave node from executing services as a new master node;

[0216] Among them, based on the fact that the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node, so that the first slave node executes the business as the new master node in the cluster and removes the original master node; the first node is prohibited from voting for the first slave node, and the second slave node and the first slave node vote for the first slave node, so that the first slave node executes the business as the new master node in the cluster and removes the original master node.

[0217] Optionally, if the master node does not receive the third heartbeat from the slave node within a preset time period, it determines that the system is a faulty system and executes a response method of the faulty system; after removing the slave node in the faulty system, it executes a response method of the normal system and triggers a second heartbeat to be sent to the first node.

[0218] Among them, a master node and at least one slave node form a cluster.

[0219] Optionally, the voting weight of the slave node is 1, and the voting weight of the first node is less than 1.

[0220] Wherein, based on the fact that the cluster includes a master node and a slave node, the first node and the first slave node vote for the first slave node so that the number of votes for the first slave node in the cluster exceeds half of the total number of nodes in the cluster; the first node is prohibited from voting for the first slave node so that the number of votes for the first slave node in the cluster does not exceed half of the total number of nodes in the cluster;

[0221] Among them, based on the fact that the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node so that the number of votes for the first slave node in the cluster exceeds half of the total number of nodes in the cluster; the first node is prohibited from voting for the first slave node, and the second slave node and the first slave node vote for the first slave node so that the number of votes for the first slave node in the cluster exceeds half of the total number of nodes in the cluster.

[0222] Optionally, before the first node receives the voting request sent by the first slave node, the first node further includes:

[0223] Receive a second heartbeat sent by the master node, where the second heartbeat carries the agreed parameters;

[0224] The agreed parameters are recorded, where the agreed parameters include lease information.

[0225] Optionally, the first node determines whether the voting condition is met, including:

[0226] Based on the agreed parameters, determining whether the lease with the master node has expired at the time of receiving the voting request;

[0227] If it has not expired, the voting condition is not met, so that the first slave node continues to send voting requests after a second preset time period;

[0228] If it expires, based on the agreed parameters of the first slave node carried in the voting request, it is determined whether the agreed parameters of the first slave node meet the preset conditions. If the preset conditions are met, it is determined that the voting conditions are met; if the preset conditions are not met, it is determined that the voting conditions are not met, so that the first slave node exits or restarts.

[0229] Optionally, the agreed parameters further include a version number and a latest log number, and the first node determines whether the agreed parameters of the first slave node meet preset conditions, including:

[0230] Determine whether the version number of the first slave node is greater than the recorded version number, and obtain a first determination result;

[0231] Determine whether the latest log number of the first slave node is greater than the latest recorded historically submitted log number, and obtain a second determination result;

[0232] Based on the fact that the first judgment result represents that the version number of the first slave node is greater than the recorded version number and the second judgment result represents that the latest log number of the first slave node is greater than the latest recorded historically submitted log number, it is determined that the agreed parameters of the first slave node meet the preset conditions; otherwise, the agreed parameters of the first slave node do not meet the preset conditions.

[0233] Optionally, the master node controls the second slave node to join the cluster to trigger a second heartbeat, the second heartbeat includes agreed parameters of the master node, and the second slave node is the same as or different from the first slave node;

[0234] The first node also receives the second heartbeat sent by the master node, and receives the heartbeat of the second slave node.

[0235] Specifically, when a master node failure, a slave node failure, or a master node partition (split brain) occurs in the system, in a two-node cluster, the vote of the first node plays a decisive role, while in a three-node cluster, the vote of the first node has no substantial effect.

[0236] In summary, the present embodiment provides an information processing system, in which the first slave node does not receive the first heartbeat of the master node in the first preset time period and initiates a voting request to the first node, based on the voting condition being met, the first node votes for the first slave node; based on the voting condition not being met, the first node is prohibited from voting for the first slave node; wherein, if the cluster includes a master node and a slave node, the first node votes for the first slave node, so that the first slave node performs the business as the new master node in the cluster and removes the original master node; prohibits voting for the first slave node to prohibit the first slave node from performing the business as the new master node; wherein, if the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node, the first slave node performs the business as the new master node in the cluster and removes the original master node; the first node is prohibited from voting for the first slave node, the second slave node and the first slave node vote for the first slave node, and the first slave node can still perform the business as the new master node in the cluster and remove the original master node. In this scheme, due to the voting rights of the first node, its vote plays a decisive role in a two-node cluster; while in a three-node cluster, the vote of the first node has no substantial effect. Therefore, in the process of expanding a two-node cluster to three nodes and then changing back to two nodes, there is no need to remove the first node and then add it to the cluster, thereby reducing the blocking time of read and write services caused by executing this operation.

[0237] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device provided in the embodiment, since it corresponds to the method provided in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0238] The above description of the embodiments provided enables professionals and technicians in the field to implement or use the present application. Various modifications to these embodiments will be apparent to professionals and technicians in the field, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features provided herein.

Claims

1. An information processing method, applied to a first node connected to a cluster, the method comprising: receiving a voting request sent by a first slave node, wherein the voting request indicates that the first slave node has not received a first heartbeat of a master node within a first preset time period; Based on satisfying the voting condition, voting for the first slave node; Based on the voting condition not being met, prohibiting voting for the first slave node; wherein, based on the fact that the cluster includes a master node and a slave node, voting for the first slave node so that the first slave node executes services as a new master node in the cluster and removes the original master node; prohibiting voting for the first slave node so as to prohibit the first slave node from executing services as a new master node; Wherein, based on the fact that the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node, so that the first slave node executes the service as the new master node in the cluster and removes the original master node; the first node is prohibited from voting for the first slave node, and the second slave node and the first slave node vote for the first slave node, so that the first slave node executes the service as the new master node in the cluster and removes the original master node; The master node will not vote for the slave nodes, and other slave nodes will vote for the slave nodes.

2. The method according to claim 1, wherein the voting weight of the slave node is 1, and the voting weight of the first node is less than 1, in, Based on the cluster including a master node and a slave node, the first node and the first slave node vote for the first slave node so that the number of votes for the first slave node in the cluster exceeds half of the total number of nodes in the cluster; The first node is prohibited from voting for the first slave node, so that the number of votes for the first slave node in the cluster does not exceed half of the total number of nodes in the cluster; Wherein, based on the cluster including a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node, so that the number of votes for the first slave node in the cluster exceeds half of the total number of nodes in the cluster; The first node is prohibited from voting for the first slave node, and the second slave node and the first slave node vote for the first slave node, so that the number of votes for the first slave node in the cluster exceeds half of the total number of nodes in the cluster.

3. The method according to claim 1, before receiving the voting request sent by the first slave node, further comprising: Receive a second heartbeat sent by the master node, where the second heartbeat carries the agreed parameters; The agreed parameters are recorded, where the agreed parameters include lease information.

4. The method according to claim 3, determining whether voting conditions are met comprises: Based on the agreed parameters, determining whether the lease with the master node has expired at the time of receiving the voting request; If it has not expired, the voting condition is not met, so that the first slave node continues to send voting requests after a second preset time period; If it is due, judging whether the agreed parameters of the first slave node carried in the voting request meet the preset conditions based on the agreed parameters of the first slave node, and if the preset conditions are met, judging that the voting conditions are met; If the preset condition is not met, it is determined that the voting condition is not met, so that the first slave node exits or restarts.

5. According to the method of claim 4, the agreed parameters further include a version number and a latest log number, and judging whether the agreed parameters of the first slave node meet preset conditions comprises: Determine whether the version number of the first slave node is greater than the recorded version number, and obtain a first determination result; Determine whether the latest log number of the first slave node is greater than the latest recorded historically submitted log number, and obtain a second determination result; Based on the fact that the first judgment result represents that the version number of the first slave node is greater than the recorded version number and the second judgment result represents that the latest log number of the first slave node is greater than the latest recorded historically submitted log number, it is determined that the agreed parameters of the first slave node meet the preset conditions; otherwise, the agreed parameters of the first slave node do not meet the preset conditions.

6. The method according to claim 1, further comprising: The receiving master node removes the first slave node based on the failure to receive the third heartbeat of the first node within a third preset time period, triggering a second heartbeat, wherein the second heartbeat carries the agreed parameters.

7. The method according to claim 1, further comprising: Receive a second heartbeat triggered when the master node controls the second slave node to join the cluster, the second heartbeat includes the agreed parameters of the master node, and the second slave node is the same as or different from the first slave node; Receive the heartbeat of the second slave node.

8. An information processing device, comprising: A receiving unit, configured to receive a voting request sent by a first slave node, wherein the voting request indicates that the first slave node has not received a first heartbeat of a master node within a first preset time period; a voting unit, configured to vote for the first slave node if a voting condition is met, and prohibit voting for the first slave node if the voting condition is not met; Wherein, in a cluster including a master node and a slave node, voting for the first slave node enables the first slave node to execute services as a new master node in the cluster and remove the original master node; prohibiting voting for the first slave node to prohibit the first slave node from executing services as a new master node; Wherein, based on the fact that the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node, so that the first slave node executes the service as the new master node in the cluster and removes the original master node; the first node is prohibited from voting for the first slave node, and the second slave node and the first slave node vote for the first slave node, so that the first slave node executes the service as the new master node in the cluster and removes the original master node; The master node will not vote for the slave nodes, and other slave nodes will vote for the slave nodes.

9. An information processing system comprising: The master node is used to generate a first heartbeat carrying the agreed parameters and send it to the slave node, so that the log of the master node is synchronized to the slave node, and generate a second heartbeat carrying the agreed parameters and send it to the first node; At least one slave node is used to receive the first heartbeat and generate a third heartbeat carrying the agreed parameters and send it to the master node to reply to the first heartbeat, and generate a fourth heartbeat and send it to the first node; wherein the first slave node generates a voting request and sends it to the first node if it does not receive the first heartbeat of the master node in the first preset time period; a first node, configured to vote for the first slave node based on receiving the voting request and satisfying a voting condition, and to prohibit voting for the first slave node based on not satisfying the voting condition; Wherein, in a cluster including a master node and a slave node, voting for the first slave node enables the first slave node to execute services as a new master node in the cluster and remove the original master node; prohibiting voting for the first slave node to prohibit the first slave node from executing services as a new master node; Wherein, based on the fact that the cluster includes a master node and two slave nodes, the second slave node, the first slave node and the first node vote for the first slave node, so that the first slave node executes the service as the new master node in the cluster and removes the original master node; the first node is prohibited from voting for the first slave node, and the second slave node and the first slave node vote for the first slave node, so that the first slave node executes the service as the new master node in the cluster and removes the original master node; The master node will not vote for the slave nodes, and other slave nodes will vote for the slave nodes.

10. According to the system of claim 9, the master node is used to determine that the system is a faulty system and execute the response method of the faulty system if it does not receive the third heartbeat from the slave node within a preset time period; after removing the slave node in the faulty system, it executes the response method of the normal system and triggers the second heartbeat to be sent to the first node.