Multi-leader election in distributed computing systems
Patent Information
- Application Number
- CN202111558591.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-17
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2041-12-17
Smart Images

Figure CN116266129B_ABST
Abstract
Description
Technical Field
[0001] This field generally involves distributed computing systems that include clusters of nodes, and more specifically, leader election within such systems. Background Technology
[0002] Various types of distributed computing systems are known. For example, distributed computing systems based on the open-source Kubernetes container orchestration platform consist of clusters of nodes, each node implementing one or more "pods" of containers to execute containerized workloads of distributed applications. Technologies for these and other distributed computing systems are needed, particularly regarding improvements to leader election. Summary of the Invention
[0003] Technical problems in distributed computing systems are related to leader election, because conventional methods often require electing only a specific node from the nodes as the leader at any given time, which can lead to processing bottlenecks for the specific node currently elected as the leader.
[0004] The illustrative implementations disclosed herein provide techniques for multi-leader election in distributed computing systems. For example, some implementations provide a technical solution to the aforementioned technical problem by configuring multiple nodes in a cluster to cooperate with each other to elect multiple leaders for the corresponding processing tasks in a manner that helps balance the processing tasks on the nodes, thereby improving the overall performance within the distributed computing system.
[0005] In one embodiment, an apparatus includes at least one processing unit, the at least one processing unit including a processor coupled to memory. The at least one processing unit is configured to: establish, together with a coordination service for one or more distributed applications, a participant identifier for a given participant in a multi-leader election algorithm implemented in a distributed computing system, the distributed computing system including a plurality of computing nodes, each computing node corresponding to a participant having a corresponding participant identifier; and interact with the coordination service during the execution of iterations of the multi-leader election algorithm to determine the current assignment of a corresponding participant among the participants as the leader of a corresponding processing task in the distributed computing system.
[0006] In some embodiments, the at least one processing device illustratively includes at least a portion of a specific computing node among the computing nodes of the distributed computing system, and the coordination service includes one or more servers outside the distributed computing system.
[0007] In some implementations, the coordination service includes the open-source Apache ZooKeeper coordination service, but in other implementations, other types of coordination services may be used.
[0008] In some implementations, establishing the participant identifier of a given participant in a multi-leader election algorithm, together with a coordination service for one or more distributed applications, includes: requesting the creation of a participant identifier tree node of the given participant as a sequential and ephemeral node; and receiving the participant identifier of the given participant in response to the request.
[0009] Additionally or alternatively, in some embodiments, interacting with the coordination service during the iteration of the multi-leader election algorithm illustratively includes: obtaining values for participant identifier tree nodes and election result tree nodes from the coordination service; and using the obtained values to maintain a stack data structure, wherein the participants are categorized as entries in the stack data structure based at least in part on the number of processing tasks assigned to them as leaders. In response to at least one of the processing tasks not currently having an assigned leader, interacting with the coordination service includes: assigning the participant to a given processing task among previously unassigned processing tasks based at least in part on the position of the particular participant's entry in the stack data structure; updating the stack data structure and one or more corresponding values of the election result tree nodes via the coordination service; and repeating the assignment and the update until a leader is assigned to all of the processing tasks.
[0010] These and other illustrative embodiments include, but are not limited to, devices, systems, methods, and processor-readable storage media. Attached Figure Description
[0011] Figure 1 This is a block diagram of an information processing system including a distributed computing system in an illustrative implementation scheme, the distributed computing system including a cluster of nodes that implement multi-leader election.
[0012] Figure 2 This is a flowchart of an example process for multi-leader election in an illustrative implementation.
[0013] Figure 3 An example of a participant identifier tree for multi-leader election is shown in an illustrative implementation.
[0014] Figure 4 An example of an election decision tree and associated decision stack data structure for multi-leader election is shown in an illustrative implementation.
[0015] Figure 5An example of a monitoring tree for multi-leader election is shown in an illustrative implementation.
[0016] Figures 6 to 12 An example multi-leader election process using a participant identifier tree, election decision tree, and associated decision stack data structures is shown in an illustrative implementation.
[0017] Figure 13 and Figure 14 An example of a processing platform that can be used to implement at least a portion of an information processing system is shown in an illustrative implementation. Detailed Implementation
[0018] This document describes illustrative embodiments with reference to exemplary information processing systems and associated computers, servers, storage devices, and other processing apparatuses. However, it should be understood that these and other embodiments are not limited to the specific illustrative system and apparatus configurations shown. Therefore, the term "information processing system" as used herein is intended to be interpreted broadly to encompass processing systems, such as those including cloud computing and storage systems, as well as other types of processing systems that include various combinations of physical and virtual processing resources. Thus, an information processing system may include, for example, at least one data center or other cloud-based systems that include one or more clouds hosting shared cloud resources for multiple tenants. The term "information processing system" also encompasses many different types of enterprise computing and storage systems, as used extensively herein.
[0019] Figure 1 An information processing system 100 configured according to an illustrative embodiment is shown. The information processing system 100 includes a distributed computing system 102 configured to communicate via one or more networks with a coordination service 104 for one or more distributed applications executed by the distributed computing system 102 and possibly for other distributed applications executed by other distributed computing systems not explicitly shown in the figure.
[0020] The coordination service 104 illustratively includes open-source coordination services for distributed applications that are appropriately configured in the manner disclosed herein, such as the well-known Apache ZooKeeper coordination service, but other types of coordination services may be used in other implementations.
[0021] The distributed computing system 102 more specifically includes compute nodes 105-1, 105-2, ... 105-M, collectively referred to herein as compute nodes 105. In some embodiments, the distributed computing system 102 is assumed to be based on the open-source Kubernetes container orchestration platform and illustratively includes a cluster of compute nodes 105, each compute node implementing one or more container sets 110 to execute containerized workloads of distributed applications. In this example, each container set 110 illustratively includes a set of N containers, which may be Docker containers or other types of Linux containers (LXC). In other embodiments, different container sets in container sets 110-1, 110-2, ... 110-M may include different numbers of containers. Moreover, in this embodiment, the values N and M represent any integer values assumed to be greater than or equal to 2.
[0022] In some implementations, the distributed computing system 102 is referred to herein as a "cluster," and the computing node 105 is simply referred to as a "node." In some implementations, each node comprises a single set of containers, while in other implementations, one or more of the nodes may each comprise multiple sets of containers.
[0023] In some implementations, computing node 105 is implemented as a corresponding host device and is assumed to have associated persistent storage resources. Host devices illustratively include servers or other types of computers in a multi-node arrangement of enterprise computer systems, cloud-based computer systems, or distributed computing systems.
[0024] Other distributed computing systems may include varying numbers and arrangements of computing nodes, and possibly one or more additional components. For example, in some implementations, a distributed computing system may include a system manager, which may be implemented on one of the computing nodes or on one or more separate nodes.
[0025] In some implementations, compute nodes can interact with storage arrays or other types of storage systems via one or more networks. Storage systems may include, for example, distributed storage systems comprising multiple storage nodes, but many other arrangements are possible.
[0026] Computing node 105 illustratively includes corresponding processing means of one or more processing platforms. For example, each computing node 105 may include one or more processing means, each having a processor and memory.
[0027] Compute node 105 can be implemented on a common processing platform or on a separate processing platform.
[0028] In some implementations, cloud infrastructure is used to implement compute node 105. For example, compute node 105 may be configured to provide computing services to users according to a Platform as a Service (PaaS) model, an Infrastructure as a Service (IaaS) model, and / or a Function as a Service (FaaS) model; however, it should be understood that many other cloud infrastructure deployments can be used. Moreover, illustrative implementations can be implemented outside the context of cloud infrastructure, as is the case with stand-alone compute and storage systems implemented within a given enterprise.
[0029] Computing nodes 105 communicate with each other and with coordination service 104 via one or more networks. In some embodiments, such a network is assumed to be part of a global computer network including the Internet, but additional or alternative types of networks may be part of that network, including wide area networks (WANs), local area networks (LANs), satellite networks, telephone or cable networks, cellular networks (such as 4G or 5G cellular networks), wireless networks (such as WiFi or WiMAX networks), or portions or combinations of these and other types of networks. Thus, in some embodiments, the network includes a combination of multiple different types of networks, each network including processing means configured to communicate using Internet Protocol (IP) or other communication protocols.
[0030] As a more specific example, some implementations may utilize one or more high-speed local area networks, in which associated processing devices communicate with each other using peripheral component Fast Interconnect (PCIe) cards and networking protocols such as unlimited bandwidth, gigabit Ethernet, or Fibre Channel. In a given implementation, as those skilled in the art will appreciate, many alternative networking arrangements are possible.
[0031] In some implementations, the computing nodes 105 of the distributed computing system 102 are interconnected with each other in a full mesh network.
[0032] As previously indicated, compute nodes 105 collectively constitute an example of a possible implementation of a distributed computing system. The term "distributed computing system" as used herein is intended to be interpreted broadly to encompass many other clusters of compute nodes. The term "compute node" as used herein is also intended to be interpreted broadly to encompass, for example, one or more processing units that implement storage and networking resources in addition to the computing resources used to execute one or more distributed applications.
[0033] Compute node 105 illustratively provides various services by executing processing tasks of one or more distributed applications. Typically, compute nodes 105 need to collectively agree that one of them will act as a leader for one or more such processing tasks.
[0034] As previously indicated, the technical problem that arises in a distributed computing system is that conventional methods typically require only a particular node among the nodes to be elected as the leader at any given time, which can lead to a processing bottleneck for the particular node currently elected as the leader. For example, in the context of Kubernetes, load scaling can be achieved by simply adding more pod sets to a given deployment. Each such pod set illustratively represents a node in the cluster and can run the same container image, where the workload is evenly distributed among these nodes. However, if a leader is required in such a deployment, then one of the pod sets will act as the leader and will run the additional tasks assigned to the leader. Thus, the leader pod set can become a performance bottleneck for the deployment. External workloads can be offloaded to additional pod sets, but the tasks designated for the leader can only be run on one pod set.
[0035] In the illustrative embodiments herein, the computing node 105 is advantageously configured to implement the function of multi-leader election in the distributed computing system 102 by executing a multi-leader election algorithm that involves interacting with the coordination service 104.
[0036] For example, some embodiments provide a technical solution to the above technical problem by configuring the computing nodes 105 to cooperate with each other to elect multiple leaders for respective processing tasks in a manner that helps balance the processing tasks on the computing nodes 105, thereby resulting in an improvement in the overall performance within the distributed computing system 102.
[0037] The disclosed arrangement advantageously avoids the situation where a single leader is overloaded by running a series of leader-only processing tasks. Instead of electing a single node as the leader to run all of these processing tasks, the illustrative embodiments allow multiple nodes to assume responsibility for these tasks through a multi-leader election algorithm executed by each node. In such an arrangement, the leader responsibilities are effectively shared among multiple nodes.
[0038] In some embodiments, the multi-leader election process is triggered when a node joins or leaves the cluster. After this process is completed, all the running nodes reach a consensus on the election result.
[0039] For example, assume that T is the number of tasks and N is the number of nodes. In some embodiments, the multi-leader election algorithm is configured such that multiple leaders are assigned to different processing tasks as follows:
[0040] If T = N, then each node is assigned as the leader for one task;
[0041] If T < N, then each node is assigned as the leader for one or zero tasks; and
[0042] If T>N, then each node is assigned as the leader of either int(T / N) or int(T / N)+1 tasks, where "int(·)" represents an integer function.
[0043] In other implementations, other types of task assignments can be provided based on multi-leader election.
[0044] In some implementations, the multi-leader election algorithm illustratively ensures that tasks are assigned substantially evenly to available nodes, regardless of the number of tasks or nodes. The algorithm can also handle cases where the number of nodes increases or decreases proportionally.
[0045] As previously indicated, Figure 1 The compute nodes 105 of the distributed computing system 102 interact with a coordination service 104, and more specifically with one or more servers 106 of the coordination service 104, wherein the one or more servers 106 store a participant identifier tree, an election result tree, and a monitoring tree for use in a multi-leader election performed by the compute nodes 105. Such trees are examples of what is more generally referred to herein as “data structures” maintained by the coordination service 104 for use in a multi-leader election performed collaboratively by the compute nodes 105. Other types of data structures may be used in other embodiments. The one or more servers 106 are examples of servers “external” to the distributed computing system 102. In this context, the term “external” is intended to be interpreted broadly to encompass servers, for example, those of one or more of the compute nodes 105 of the distributed computing system 102 that are network-accessible but not implemented within those one or more compute nodes 105.
[0046] Computing node 105 utilizes the corresponding instances of the multi-leader election logic 112-1, 112-2, ... 112-M within the corresponding computing node 105 and the corresponding decision stacks 114-1, 114-2, ... 114-M to implement the corresponding part of the multi-leader election function.
[0047] In operation, a given compute node in compute node 105, together with coordination service 104, establishes its participant identifier as a participant in the multi-leader election algorithm implemented in distributed computing system 102. In some implementations, compute node 105 corresponds to a participant with a corresponding participant identifier, but other arrangements are possible. A given compute node interacts with coordination service 104 while executing iterations of the multi-leader election algorithm to determine the current assignment of the appropriate participant among the participants as the leader of the corresponding processing task in distributed computing system 102. It is assumed that each of compute nodes 105 performs similar operations.
[0048] As described above, the coordination service 104 maintains one or more data structures via one or more of its servers 106 for use in a multi-leader election algorithm implemented in the distributed computing system 102.
[0049] In some implementations, one or more data structures include at least a participant identifier tree and an election result tree, wherein, as in Figure 3 As shown in the example, the participant identifier tree includes multiple leaf nodes for the corresponding participant identifiers in the participant identifiers, and as in Figure 4 As shown in the example, the election result tree includes multiple leaf nodes indicating the respective participants among the participants who are currently elected as the leader of the corresponding processing task. These example participant identifier trees and election result trees are described in more detail elsewhere in this document.
[0050] In some implementations, a given compute node is illustratively configured with the coordination service 104 to establish its participant identifier as a given participant in a multi-leader election algorithm by requesting the creation of a tree node of the given participant's participant identifier as a sequential and ephemeral node, and by receiving the participant identifier of the given participant in response to the request. Terms such as “request” and “at request” as used herein are intended to be interpreted broadly to encompass the various arrangements utilized by a given compute node in interacting with the coordination service to establish its participant identifier.
[0051] Alternatively or additionally, a given compute node, illustratively speaking, interacts with the coordination service 104 during the iteration of a multi-leader election algorithm by obtaining values for participant identifier tree nodes and election result tree nodes from the coordination service 104, and using the obtained values to maintain a stack data structure, wherein the participants are categorized as entries in the stack data structure based at least in part on the number of processing tasks assigned to them as leaders. The decision stack 114 of compute node 105 is an example of such a stack data structure. Another example of a stack data structure maintained by a given compute node is also... Figure 4 It is shown in the figure and described in more detail elsewhere in this article.
[0052] In response to at least one of the processing tasks not currently having an assigned leader, a given compute node assigns the participant to a given processing task that was not previously assigned, at least in part, based on the position of the participant's entry in the stack data structure. The stack data structure and one or more corresponding values of the election result tree node are updated via a coordination service, and the assignment and update are repeated until a leader is assigned to all processing tasks.
[0053] In some implementations, each entry in at least a subset of the stack data structure includes a participant identifier and information indicating one or more of the processing tasks assigned to the corresponding participant as a leader.
[0054] The entries in the stack data structure are descriptively organized in ascending order of the number of processing tasks assigned to the corresponding participant as leader. The first participant, with the highest number of assigned processing tasks, has the lowest number of entries in the stack data structure, and the second participant, with the lowest number of assigned processing tasks, has the highest number of entries. Entry placement for participants with the same number of assigned processing tasks is resolved using their respective participant identifiers. It should be understood that other types and configurations of stack data structures can be used.
[0055] In some implementations, a participant is assigned to a given processing task that has not been previously assigned, at least in part based on the position of the participant's entry in the stack data structure. This includes, illustratively, assigning the participant with the highest entry in the stack data structure as the leader of the given processing task.
[0056] Alternatively or additionally, a given computing node is illustratively configured to rebalance task assignments among participants in response to detecting at least a threshold difference between the corresponding number of processing tasks assigned to a first participant with the highest number of assigned processing tasks and a second participant with the lowest number of assigned processing tasks.
[0057] Rebalancing task assignment among participants illustratively includes reassigning at least one of the tasks from the first participant to the second participant, and updating the stack data structure and one or more corresponding values of the election result tree nodes through a coordination service.
[0058] In some implementations, during the iteration of the multi-leader election algorithm, interaction with the coordination service illustratively includes establishing at least a portion of a monitoring loop among the participants based on a monitoring tool of the coordination service 104, and utilizing the monitoring loop to detect one or more participants withdrawing from the multi-leader election algorithm. An example of a monitoring tree based on the monitoring tool of the coordination service 104 is provided in... Figure 5 It is shown in the figure and described in more detail elsewhere in this article.
[0059] The monitoring loop is illustratively configured at least in part based on participant identifiers, wherein each participant monitors another participant in the monitoring loop that is adjacent to it, according to its corresponding participant identifier. In other embodiments, other types of monitoring loops or participant exit mechanisms may be used.
[0060] In some implementations, a given computing node is also configured to determine, via coordination service 104, whether the given participant is currently assigned as the leader of a specific processing task in the processing task for at least one of the distributed applications executed by distributed computing system 102, and in response to an affirmative determination, to cause the given participant to perform the specific processing task.
[0061] The above text combined Figure 1 The specific multi-leader election features and functions described should in no way be construed as limiting, and various other distributed implementations of system components such as the coordination service 104 and the compute node 105, as well as their associated multi-leader election logic 112 and the corresponding decision stack 114, are possible.
[0062] Figure 1 The computing nodes 105 of the example distributed computing system 102 shown are assumed to be implemented using at least one processing platform, wherein each such processing platform includes one or more processing devices, and each such processing device includes a processor coupled to memory. Such processing devices may illustratively include a particular arrangement of computing, storage, and network resources.
[0063] Alternatively, compute node 105 can be implemented on different processing platforms, but many other arrangements are possible. For example, different subsets of compute node 105 can be implemented on different processing platforms.
[0064] Similarly, the coordination service 104 is illustratively implemented using one or more processing platforms that implement one or more servers 106, which are configured to store a participant identifier tree, an election result tree, a monitoring tree, and / or additional or alternative data structures for multi-leader election.
[0065] As used herein, the term "processing platform" is intended to be interpreted broadly to encompass (by way of example and not limitation) multiple sets of processing devices and associated storage systems configured to communicate over one or more networks. For example, some components of system 100 may reside in a data center located in a first geographic location, while other components of system 100 may reside in one or more other data centers located in one or more other geographic locations that may be far from the first geographic location. Therefore, in some implementations of system 100, different subsets of compute nodes 105 may reside in different data centers. In other implementations, many other distributed implementations of compute nodes 105 and one or more servers 106 of coordination service 104 are possible.
[0066] Additional examples of the processing platform used in the illustrative implementation scheme to implement the distributed computing system and possibly associated coordination services will be incorporated below. Figure 13 and Figure 14 To describe in more detail.
[0067] It should be understood that these and other features of the illustrative implementation are presented by way of example only and should not be construed as limiting in any way.
[0068] Therefore, in other implementations, different numbers, types and arrangements of system components, such as distributed computing system 102, coordination service 104 and computing nodes 105, can be used.
[0069] It should be understood that specific module groups and such are presented only through examples. Figure 1 Other components are shown as implemented in a distributed computing system. In other implementations, only a subset of these components may be used, or additional or alternative sets of components may be used, and such components may exhibit alternative functionality and configuration.
[0070] For example, in other implementations, certain portions of the multi-leader election functionality disclosed herein may be implemented on one or more processing devices in computing node 105.
[0071] Now refer to Figure 2 The flowchart of the illustrative implementation further details the operation of the information processing system 100, which implements a process for multi-leader election in a distributed computing system. This process can be viewed as including at least part of... Figure 1 This document describes an example multi-leader election algorithm executed by compute node 105 in a distributed computing system. For instance, this algorithm illustratively utilizes at least in part one or more instances of multi-leader election logic 112 in the respective compute nodes of compute node 105 for execution. These and other algorithms disclosed herein are more generally applicable to a wide variety of other distributed computing systems, each comprising two or more compute nodes.
[0072] Now for reference Figure 2 The multi-leader election process illustrated in the figure includes steps 200 to 210, and is illustratively performed by a given compute node in compute node 105, but it is assumed that each of the other compute nodes 105 performs the process similarly, such that compute nodes 105 collectively implement multi-leader election in distributed computing system 102. For example, different instances of the multi-leader election process are illustratively performed at least partially in parallel by different compute nodes in compute node 105, so as to allow compute nodes 105 to cooperate with each other when implementing multi-leader election functionality within distributed computing system 102.
[0073] In step 200, a given compute node in compute node 105 uses coordination service 104 to establish the participant identifier for that compute node.
[0074] In step 202, the compute node interacts with the coordination service to obtain the current values of the participant tree and the election result tree, examples of which are shown in... Figure 3 and Figure 4 As shown in the image.
[0075] In step 204, the compute node uses the obtained values to maintain its decision stack data structure for use in conjunction with instances executing its multi-leader election algorithm.
[0076] In step 206, the compute node uses its decision stack data structure and a multi-leader election algorithm to assign one or more leaders to one or more processing tasks. If necessary, the compute node also rebalances the leader assignments to the processing tasks.
[0077] In step 208, the compute node updates its decision stack data structure to reflect the updated leader assignment.
[0078] In step 210, the compute nodes interact with the coordination service to update the election result tree.
[0079] In parallel with steps 202 to 210, the compute nodes use a monitoring loop, illustratively implemented at least in part via the monitoring tools of the coordination service, to detect one or more other compute nodes withdrawing from the multi-leader election algorithm.
[0080] Each of the computing nodes in the distributed computing system illustratively repeats at least a portion of steps 200 to 210 for multiple iterations. This arrangement allows the computing nodes to collaborate with each other to implement a multi-leader election function within the distributed computing system.
[0081] For the sake of clarity and simplicity, Figure 2 The steps of the process are shown in sequence, and some steps may at least partially overlap with other steps. In other embodiments, additional or alternative steps may be used.
[0082] Combination Figure 2The specific processing operations and other system functions described in the flowcharts are presented by way of illustrative example only and should not in any way be construed as limiting the scope of this disclosure. Alternative embodiments may use other types of processing operations to implement multi-leader election in a distributed computing system. For example, as indicated above, in other embodiments, the ordering of process steps may vary, or certain steps may be performed at least partially simultaneously with each other rather than sequentially. Moreover, one or more of the process steps may be repeated periodically, or multiple instances of the process may be executed in parallel with each other to implement multi-leader election on multiple computing nodes within the distributed computing system.
[0083] Such as combination Figure 2 The functionality described in the flowchart can be implemented, at least in part, in the form of one or more software programs stored in memory and executed by a processor of a processing device such as a computer or server. As will be described below, the memory or other storage device embodying the executable program code of one or more software programs is an example of what is more generally referred to herein as a "processor-readable storage medium".
[0084] A computing node may be implemented as part of a processing platform, more generally referred to herein, which includes one or more processing devices, each including a processor coupled to memory.
[0085] In some implementations, such a processing device may correspond to one or more virtual machines or other types of virtualization infrastructure, such as Docker containers or Linux containers (LXC). Host devices, storage controllers, and other system components may be implemented at least in part using the processing device of such a processing platform. For example, the corresponding logical instance, data structure, or other processing module of a compute node may be implemented within a corresponding container running on the corresponding processing device of the processing platform.
[0086] The examples of the participant identifier tree, election result tree, and monitoring tree maintained by Coordination Service 104 will now be combined separately. Figure 3 , Figure 4 and Figure 5 This will be described below. Figure 4 This also includes an example of the aforementioned decision stack data structure maintained by a given compute node in compute node 105.
[0087] In these examples, it is assumed, without limitation, that Apache ZooKeeper is used to implement the coordination service 104 to synchronize election-related data among compute nodes 105, but other types of coordination services can be used. As previously indicated, ZooKeeper is an open-source coordination service for distributed applications. ZooKeeper allows distributed processes to collaborate with each other through a shared hierarchical namespace organized in a manner similar to a standard file system, and utilizes a data structure commonly referred to as a "znode". Users can create znodes and access them via the root node of the hierarchical tree data structure in a manner similar to a file system. Each znode may also have one or more corresponding values that can be set by the user. A znode descriptively represents a node created in a ZooKeeper hierarchical tree. Therefore, znodes are also referred to as "nodes" in this document, but should not be confused with compute nodes in a distributed computing system.
[0088] Entities participating in a multi-leader election algorithm are generally referred to herein as “participants.” For example, each of compute nodes 105 is, illustratively, a participant in a multi-leader election algorithm executed within the distributed computing system 102 via interaction with the coordination service 104. In other embodiments, other types of participants may be specified. For example, in other embodiments, a specific thread or process of a given compute node may be a participant.
[0089] As previously indicated, the illustrative implementation described below utilizes ZooKeeper to synchronize information among participants, and leverages the following three features provided by ZooKeeper:
[0090] Sequentiality. When a znode is created, it can be set to "sequential". ZooKeeper will append the suffix 'i' to the znode, where i is an integer. Once such a znode is created, the sequence number will be incremented by 1. For example, if a participant creates a sequential node named P_, ZooKeeper will create node P_0. If another participant creates another sequential node named P_, ZooKeeper will create node P_1.
[0091] Transient. Participants can also create znodes as "transient." If the session between a participant and the ZooKeeper server expires, ZooKeeper will automatically remove the znode. Such session expiration events may be caused, for example, by a compute node crash or by a participant opting out.
[0092] Monitors and participants can set up monitoring functionality for znodes. This functionality will be invoked when any changes occur on the znode. Possible changes include updating the znode value or deleting the znode.
[0093] As previously mentioned, in some implementations, the coordination service 104 maintains various types of data structures for multi-leader elections, which illustratively include participant identifier trees, election result trees, and monitoring trees, examples of which are provided in the corresponding... Figure 3 , Figure 4 and Figure 5 As shown in the diagram. Such trees are also called subtrees because they illustratively share the common root node of the ZooKeeper hierarchical tree.
[0094] Now for reference Figure 3 Data structure 300 includes a root node 301 and a participant identifier tree 302 under the root node 301. In this example, the participant identifier tree is represented as Tree_PID. When any participant starts, it interacts with the coordination service 104 to create a node named ID_ under this tree, which has both sequential and transient settings. Figure 3 In the example, three participants create such nodes in Tree_PID, resulting in three leaf nodes with corresponding sequence values ID_0, ID_1, and ID_2. These are the identifiers or PIDs of the respective participants. Since the automatically generated sequence numbers are unique, each participant can read this number and use it as its own ID number during a multi-leader election process.
[0095] like Figure 4 As shown, data structure 400 includes a root node 401 and an election result tree 402 below the root node 401. In this example, the election result tree is represented as Tree_Elect. Although shown as a separate root node in the diagram, root node 401 is illustratively identical to root node 301, making... Figure 3 Tree_PID and Figure 4 Both `Tree_Elect` and `Tree_Elect` are subtrees of the same root node. The leaf nodes of `Tree_Elect` descriptively store the leader election results for the corresponding processing task, where the znode name represents a specific processing task and the znode value is the ID number of the participant currently assigned as the leader of that task. Figure 4 In the example, it is also assumed that there are three participants with corresponding participant identifiers ID_0, ID_1, and ID_2, referred to as 0, 1, and 2. Each participant can perform a lookup of Tree_Elect via the coordination service 104 to determine the current election result. After the multi-leader election process is completed, the tree will also be updated to reflect the most recent leader election decision.
[0096] exist Figure 4 The example further assumes that during the election process, there are five tasks A, B, C, D, and E that need to elect a leader from three participants 0, 1, and 2. The diagram shows the updated tree after the multi-leader election process is completed. In this example, participant 0 is elected as the leader of tasks A and D, participant 1 is elected as the leader of tasks B and E, and participant 2 is elected as the leader of task C.
[0097] Figure 4 The document also illustrates an example decision stack used by a given compute node as part of a multi-leader election process. In this example, the decision stack is also referred to herein as S_elect. Participants executing the multi-leader election process will use the decision stack S_elect to make their election decisions. During the multi-leader election process, this decision stack is populated and updated by looking up Tree_PID and Tree_Elect.
[0098] The following rules are used illustratively to generate the decision stack S_elect, but additional or alternative rules may be used. Participants are categorized by the number of tasks currently assigned to them as leaders. Participants with the most tasks are categorized towards the bottom of the stack. If multiple participants each have the same number of tasks, they are further categorized by their corresponding ID numbers, with higher ID numbers categorized towards the bottom of the stack. The stack also maintains a list of assigned tasks for each participant. Therefore, a given entry in the stack includes the participant ID and a list of processing tasks (if any) currently assigned to that participant as a leader.
[0099] When any processing task requires the assignment of a leader, the example multi-leader election process using the tree and decision stack described above is illustratively configured to select the top participant from the stack S_elect as a candidate, as it has been assigned the fewest tasks. If multiple participants are eligible according to the rules above, the participant with the lowest ID number wins. Furthermore, the multi-leader election process rebalances the tasks among the participants until the tasks are evenly distributed among them. Each participant is assumed to execute the multi-leader election process when that participant starts, but alternatively, the process may be executed under other conditions.
[0100] In this example, the multi-leader election process includes the following steps, but additional or alternative steps may be used:
[0101] Step 1: Create a znode ID_ in the Tree_PID and set it to be sequential and ephemeral.
[0102] Step 2: Retrieve the number from the automatically generated znode name ID_n and save the number n as the participant's ID.
[0103] Step 3: Create list L1 based on the Tree_Elect information:
[0104] L1: Tasks without assigned leaders
[0105] Step 4: Locate Tree_PID and Tree_Elect. Create the stack S_elect using the tree information.
[0106] Step 5: If L1 is empty, proceed to step 6. Otherwise:
[0107] For task_i in L1:
[0108] {
[0109] Assign the top participant in S_elect as the leader of task_i.
[0110] Update Tree_Elect
[0111] Recreate S_elect based on Tree_PID and Tree_Elect
[0112] }
[0113] Step 6: Rebalance tasks among participants:
[0114] When (true):
[0115] {
[0116] t_diff = (Number of tasks for bottom participants) – (Number of tasks for top participants)
[0117] If (t_diff <= 1):
[0118] Complete the election process
[0119] otherwise:
[0120] {
[0121] Move the first task from the bottom participant to the top participant.
[0122] Update Tree_Elect
[0123] Recreate S_elect based on Tree_PID and Tree_Elect
[0124] }
[0125] }
[0126] Similarly, this particular multi-leader election process is presented only as an illustrative example and should in no way be construed as limiting.
[0127] As previously mentioned, some implementations utilize monitoring loops to handle situations where participants leave the cluster.
[0128] Figure 5 Data structure 500 is shown, which includes a root node 501 and a watch tree 502 below the root node 501. The watch tree is also represented as Tree_Watch. As shown in the attached figure, this watch tree has only a single node.
[0129] This implementation utilizes ZooKeeper's monitoring tools to create a monitoring loop, ensuring that any crash, malfunction, exit, or other departure event of a participant is detected by another participant. Illustrated, the monitoring loop is formed such that each participant monitors the other participant with the closest lower ID number, and the participant with the lowest ID number monitors the participant with the highest ID number.
[0130] The loop is updated each time a participant initiates the process. The steps in a sample monitoring loop update process performed by a given participant are described below, but additional or alternative steps may be used:
[0131] Step 1: The participant learns the ID numbers of all running participants by examining the znode created under Tree_PID. Set i to the ID number of that participant.
[0132] Step 2: Find the number j, where j is the largest number, such that j < i.
[0133] Step 3: If j exists, then set a watch for znode ID_j and update znode Tree_Watch. Otherwise, this participant is the only running participant in the cluster, and set a watch for Tree_Watch.
[0134] As is evident from step 3, when a new participant initiates, the participant with the lowest ID number will be notified. Upon receiving this notification, the participant with the lowest ID number will perform the following steps, but additional or alternative steps may also be used:
[0135] Step 1: Obtain its current monitoring IDp and the maximum IDq among all participants.
[0136] Step 2: If p exists, then stop monitoring p.
[0137] Step 3: Set up monitoring for q.
[0138] Since each znode under Tree_PID is set to be ephemeral, it will be automatically deleted when the ZooKeeper session between the participant and the server is terminated, meaning that the participant has left the cluster.
[0139] If p is set as a participant leaving the cluster, and q is a monitor of p, then q will perform the following operations upon receiving the notification:
[0140] Step 1: Update Tree_Elect. For any task with leader p, now mark its leader as null.
[0141] Step 2: Begin the election process.
[0142] Step 3: Re-establish the monitoring loop. If q is the lowest ID, then set a watch on the highest ID and Tree_Watch. Otherwise, set a watch on participant j, where j is the highest ID, such that j < q.
[0143] Detailed examples of the illustrative procedures used to implement at least some of the multi-leader election functionality described above will now be combined with Figures 6 to 12 The illustration is used to describe it.
[0144] In this example, assume there are five tasks A, B, C, D, and E, and five participants 0, 1, 2, 3, and 4 who join the cluster sequentially over time, starting with participant 0. The following description illustrates how the multi-leader election results are updated whenever a new participant joins the cluster, and also how they are updated when a participant leaves the cluster.
[0145] Figure 6 The diagram shows the Tree_PID tree, Tree_Elect tree, and decision stack after participant 0 joins the cluster and the multi-leader election algorithm is executed, resulting in participant 0 being assigned the leader of all tasks (since there are no other participants in the cluster at this point).
[0146] Figure 7 The diagram illustrates the updated Tree_PID tree, Tree_Elect tree, and decision stack after participant 1 joins the cluster and executes the multi-leader election algorithm, resulting in participant 1 being assigned the leader of tasks A and B while participant 0 remains the leader of tasks C, D, and E. Therefore, participant 1 takes over tasks from participant 0 until the difference in the number of tasks between participant 1 and 0 equals 1, which occurs after participant 1 accepts tasks A and B.
[0147] Figure 8The diagram shows the updated Tree_PID tree, Tree_Elect tree, and decision stack after participant 2 joins the cluster and the multi-leader election algorithm is executed, resulting in participant 2 being assigned the leader of task C, participant 0 remaining the leader of tasks D and E, and participant 1 remaining the leader of tasks A and B. In this iteration of the multi-leader election algorithm, participant 2 takes over task C from participant 0, and at this point, the difference in the number of tasks between the top and bottom participants in the decision stack equals 1, thus ending the iteration.
[0148] Figure 9 The diagram illustrates the updated Tree_PID tree, Tree_Elect tree, and decision stack after participant 3 joins the cluster and the multi-leader election algorithm is executed, resulting in participant 3 being assigned the leader of task A, participant 0 remaining the leader of tasks D and E, participant 1 remaining the leader of task B, and participant 2 remaining the leader of task C. In this iteration of the multi-leader election algorithm, participant 3 takes over task A from participant 1, and at this point, the difference in the number of tasks between the top and bottom participants in the decision stack equals 1, thus ending the iteration.
[0149] Figure 10 The diagram shows the updated Tree_PID tree, Tree_Elect tree, and decision stack after participant 4 joins the cluster and the multi-leader election algorithm is executed, resulting in participant 4 being assigned the leader of task D, participant 0 remaining the leader of task E, participant 1 remaining the leader of task B, participant 2 remaining the leader of task C, and participant 3 remaining the leader of task A. In this iteration of the multi-leader election algorithm, participant 4 takes over task D from participant 0, and at this point, the difference in the number of tasks between the top and bottom participants in the decision stack is equal to 0, thus ending the iteration.
[0150] Suppose that in this example, participant 3 crashes. Since participant 4 is monitoring participant 3 in the monitoring loop, it will be notified and will begin iterating the multi-leader election algorithm.
[0151] Figure 11 This illustrates the scenario where participant 3 crashes, malfunctions, or otherwise becomes unable to participate. In response, its corresponding znode is removed from Tree_PID, and no leader is assigned to task A in Tree_Elect and the decision stack. This scenario is detected by participant 4 using a monitoring loop.
[0152] Since task A currently has no assigned leader, the iteration of the multi-leader election algorithm initiated by participant 4 will first determine which of the remaining participants will become the leader of task A. Based on the previously described illustrative rules, the top participant in the decision stack is the most qualified to take over the new task, where the hierarchy shifts to the lower participant IDs, and therefore participant 0 will win and be assigned as the leader of task A.
[0153] Figure 12 The diagram shows the updated Tree_PID tree, Tree_Elect tree, and decision stack after participant 4 executes the multi-leader election algorithm iteration, resulting in participant 0 being assigned the leader of task A and still being assigned the leader of task E. Participant 1 remains the leader of task B, participant 2 remains the leader of task C, and participant 4 remains the leader of task D. In this iteration of the multi-leader election algorithm, participant 0 takes over task A from the failed participant 3, and at this point, the difference in the number of tasks between the top and bottom participants in the decision stack equals 1, thus ending the iteration. Furthermore, according to the updated monitoring loop, participant 4 will now begin monitoring participant 2.
[0154] As previously indicated, the type of multi-leader election disclosed herein is illustratively utilized by one or more distributed applications executing on compute node 105 of distributed computing system 102.
[0155] In some implementations, determining when and how to utilize the election results depends on the application. For example, if a distributed application is running a set of tasks, where one or more of these tasks run periodically as background jobs, the compute nodes can control the execution of a given task as follows:
[0156] When (true):
[0157] {
[0158] Execute task i action
[0159] Sleep (n_sec)
[0160] }
[0161] To utilize the results of the multi-leader election process, the application can modify the execution control described above as follows:
[0162] When (true):
[0163] {
[0164] If (isLeaderofTask(i) == true):
[0165] {
[0166] Execute task i action
[0167] }
[0168] Sleep (n_sec)
[0169] }
[0170] The function isLeaderofTask(i) can be implemented by a compute node checking Tree_Elect using its participant ID to determine whether it has been assigned as the leader of task i.
[0171] It should be understood that the above description and by Figures 6 to 12 The specific example algorithms illustrated are presented by way of example only and should not be construed as limiting in any way. Additional or alternative steps may be used, and in other embodiments, the order of steps may vary, and each of one or more steps may be performed at least partially in parallel with one or more other steps.
[0172] The embodiments disclosed herein and other implementations offer significant advantages over conventional methods.
[0173] For example, illustrative implementations provide techniques for multi-leader election in distributed computing systems. In some implementations, such techniques configure multiple nodes in a cluster to cooperate with each other to elect multiple leaders for the corresponding processing tasks in a manner that helps balance the processing tasks on the nodes, thereby improving the overall performance within the distributed computing system.
[0174] In some implementations, each participant implements the same multi-leader election code via an instance of its multi-leader election logic, thereby greatly simplifying the deployment of multi-leader election functionality in distributed computing systems. Furthermore, distributed computing systems can be easily scaled up and down to more or fewer compute nodes in a given deployment without imposing any significant additional work or impact on the compute nodes.
[0175] In the illustrative implementation, a multi-leader election algorithm is provided that requires no modification regardless of the number of participants and tasks. In some implementations, the algorithm is advantageously configured to always ensure that tasks are evenly distributed among the available participants.
[0176] By leveraging ZooKeeper or other coordination services to provide participant identifier trees, election result trees, monitoring trees, and / or other data structures for multi-leader election, the illustrative implementation facilitates interaction regarding leader election among computing nodes in a distributed computing system, while providing convenient, reliable, and high-performance access to the required information.
[0177] The illustrative implementation scheme advantageously allows for better utilization of the available processing resources of each node and thereby improves the overall system performance.
[0178] It should be understood that the specific advantages described above and elsewhere in this document are associated with specific illustrative embodiments and do not need to exist in other embodiments. Furthermore, the features and functions of the specific type of information processing system illustrated in the figures and described above are merely exemplary, and many other arrangements may be used in other embodiments.
[0179] An illustrative implementation scheme for a processing platform for implementing a host device and a distributed computing system with multi-leader election functionality will now be referenced. Figure 13 and Figure 14 A more detailed description follows. Although described in the context of System 100, these platforms may also be used to implement at least a portion of other information processing systems in other embodiments.
[0180] Figure 13 An example processing platform including cloud infrastructure 1300 is illustrated. Cloud infrastructure 1300 includes a combination of physical and virtual processing resources that can be used to implement at least a portion of information processing system 100. Cloud infrastructure 1300 includes multiple virtual machines (VMs) and / or container groups 1302-1, 1302-2...1302-L implemented using virtualization infrastructure 1304. Virtualization infrastructure 1304 runs on physical infrastructure 1305 and illustratively includes one or more hypervisors and / or operating system-level virtualization infrastructures. Operating system-level virtualization infrastructure illustratively includes a kernel control group of a Linux operating system or other types of operating system.
[0181] Cloud infrastructure 1300 also includes multiple sets of applications 1310-1, 1310-2, ... 1310-L running on corresponding VM / container groups 1302-1, 1302-2, ... 1302-L under the control of virtualization infrastructure 1304. VM / container group 1302 may include a corresponding VM, one or more containers of the corresponding group, or one or more containers of the corresponding group running in a VM.
[0182] exist Figure 13In some implementations of the scheme, VM / container group 1302 includes corresponding VMs implemented using virtualization infrastructure 1304 including at least one hypervisor. Such implementations can provide multi-leader election functionality in distributed computing systems of the type described above by using one or more processes running on a given VM within the VM. For example, each VM may implement a logical instance, data structures, and / or other components for implementing functionality associated with multi-leader election in system 100.
[0183] A hypervisor platform can be used to implement a hypervisor within the virtualization infrastructure 1304. This hypervisor platform may include an associated virtual infrastructure management system. The underlying physical machines may include one or more distributed processing platforms, which in turn include one or more storage systems.
[0184] exist Figure 13 In other implementations of the scheme, VM / container group 1302 includes corresponding containers implemented using virtualization infrastructure 1304, which provides operating system-level virtualization capabilities, such as supporting Docker containers running on bare metal hosts or VMs. The containers are implemented illustratively using the corresponding kernel control group of the operating system. Such implementations can also provide multi-leader election capabilities in distributed computing systems of the type described above. For example, a container host device supporting multiple containers in one or more container groups may implement logical instances, data structures, and / or other components for implementing multi-leader election capabilities in system 100.
[0185] As is evident from the foregoing, one or more of the processing devices or other components of system 100 may each run on a computer, server, storage device, or other processing platform element. Such a given element may be considered as an example of what is more generally referred to herein as a “processing device.” Figure 13 The cloud infrastructure 1300 shown may represent at least a portion of a processing platform. Another example of such a processing platform is... Figure 14 The processing platform shown is 1400.
[0186] In this embodiment, the processing platform 1400 includes a portion of the system 100 and includes a plurality of processing devices denoted as 1402-1, 1402-2, 1402-3, ... 1402-K, which communicate with each other via a network 1404.
[0187] Network 1404 may include any type of network, such as global computer networks (such as the Internet), WAN, LAN, satellite networks, telephone or cable networks, cellular networks, wireless networks (such as WiFi or WiMAX networks), or various parts or combinations of these and other types of networks.
[0188] The processing device 1402-1 in the processing platform 1400 includes a processor 1410 coupled to a memory 1412.
[0189] Processor 1410 may include a microprocessor, microcontroller, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), graphics processing unit (GPU) or other types of processing circuitry, and portions or combinations of such circuitry elements.
[0190] Memory 1412 may include random access memory (RAM), read-only memory (ROM), flash memory, or other types of memory in any combination. Memory 1412 and other memories disclosed herein should be considered as illustrative examples of what is more generally referred to as a “processor-readable storage medium” storing executable program code of one or more software programs.
[0191] Articles of manufacture including such processor-readable storage media are considered illustrative embodiments. Given such articles of manufacture, they may include, for example, storage arrays, storage disks, or integrated circuits containing RAM, ROM, flash memory, or other electronic memory, or any of a wide variety of other types of computer program products. As used herein, the term "article of manufacture" should be understood to exclude transient propagating signals. Many other types of computer program products including processor-readable storage media may be used.
[0192] The processing device 1402-1 also includes a network interface circuit 1414 for interfacing the processing device with the network 1404 and other system components, and may include a conventional transceiver.
[0193] It is assumed that the other processing devices 1402 of the processing platform 1400 are configured in a manner similar to that shown for processing device 1402-1 in the figures.
[0194] Similarly, the particular processing platform 1400 shown in the figures is presented by way of example only, and the system 100 may include additional or alternative processing platforms, as well as a number of different processing platforms in any combination, each of which includes one or more computers, servers, storage devices or other processing devices.
[0195] For example, other processing platforms used to implement the illustrative implementation scheme may include various arrangements of converged infrastructure.
[0196] Therefore, it should be understood that in other embodiments, different arrangements of additional or alternative elements may be used. At least a subset of these elements may be implemented jointly on a common processing platform, or each such element may be implemented on a separate processing platform.
[0197] As previously indicated, components of the information processing system disclosed herein may be implemented, at least in part, as one or more software programs stored in memory and executed by a processor of a processing device. For example, the multi-leader election functionality provided by one or more components of a storage system as disclosed herein is at least partially implemented, illustratively, as software running on one or more processing devices.
[0198] It should be emphasized again that the embodiments described above are presented for illustrative purposes only. Many variations and other alternative embodiments may be used. For example, the disclosed techniques are applicable to a wide variety of other types of information processing systems, distributed computing systems, coordination services, computing nodes, multi-leader election logic instances, data structures, and other components. Moreover, in other embodiments, the specific configurations of the system and apparatus elements illustratively shown in the figures, as well as the associated processing operations, may vary. Furthermore, the various assumptions made in the description of the illustrative embodiments above should be considered exemplary and not as requirements or limitations of this disclosure. Many other alternative embodiments within the scope of the appended claims will be apparent to those skilled in the art.
Claims
1. A device for multi-leader election in a distributed computing system, the device comprising: At least one processing device, the at least one processing device including a processor coupled to a memory; The at least one processing device is configured to: A participant identifier is established in a multi-leader election algorithm implemented in a distributed computing system, together with a coordination service for one or more distributed applications, for a given participant. The distributed computing system includes multiple computing nodes, each corresponding to a participant with a corresponding participant identifier. as well as During the iteration of the multi-leader election algorithm, the system interacts with the coordination service to determine the current assignment of the appropriate participant among the participants as the leader of the corresponding processing task in the distributed computing system. Interacting with the coordination service during the iteration of the multi-leader election algorithm includes: The value of one or more of the participant identifier data structure and the election result data structure is obtained from the coordination service; The obtained values are used to maintain a stack data structure, wherein the participants are categorized as entries in the stack data structure based at least in part on the number of processing tasks assigned to them as leaders; and In response to at least one of the processing tasks not currently having an assigned leader: The participant is assigned to a given processing task among previously unassigned processing tasks, at least in part based on the position of the participant's entry in the stack data structure. The coordination service updates one or more corresponding values of at least one of the stack data structure, the participant identifier data structure, and the election result data structure; and Repeat the assignment and update process until a leader is assigned to all the processing tasks.
2. The device of claim 1, wherein the at least one processing means comprises at least a portion of a specific computing node in the computing nodes of the distributed computing system.
3. The device of claim 1, wherein the coordination service includes one or more servers outside the distributed computing system.
4. The device of claim 1, wherein the coordination service maintains one or more data structures for use in the multi-leader election algorithm implemented in the distributed computing system.
5. The device of claim 4, wherein the one or more data structures include at least a participant identifier tree and an election result tree, the participant identifier tree including a plurality of leaf nodes for a corresponding participant identifier among the participant identifiers, and the election result tree including a plurality of leaf nodes indicating a corresponding participant among the participants currently elected as the leader of the corresponding processing task in the processing task.
6. The device of claim 1, wherein the participant identifier for a given participant in a multi-leader election algorithm, established in conjunction with a coordination service for one or more distributed applications, comprises: The request is to create the participant identifier tree node for the given participant as a sequential and ephemeral node; as well as In response to the request, the participant identifier of the given participant is received.
7. The device of claim 1, wherein the value of the participant identifier data structure includes the value of the participant identifier tree node, and the value of the election result data structure includes the value of the election result tree node.
8. The device of claim 7, wherein each of the entries in at least a subset of the stack data structure includes a participant identifier and information indicating one or more of the processing tasks to which the corresponding participant is assigned as a leader.
9. The device of claim 7, wherein the entries of the stack data structure are organized in ascending order of the number of processing tasks assigned to the corresponding participant as leader, wherein the first participant with the highest number of assigned processing tasks has the lowest number of entries in the stack data structure, and the second participant with the lowest number of assigned processing tasks has the highest number of entries in the stack data structure, wherein entry positioning for participants with the same number of assigned processing tasks is resolved using their respective participant identifiers.
10. The device of claim 7, wherein assigning a participant to a given processing task among the previously unassigned processing tasks based at least in part on the position of the participant's entry in the stack data structure includes assigning the participant with the highest entry in the stack data structure as the leader of the given processing task.
11. The apparatus of claim 7, wherein the at least one processing means is further configured to rebalance task assignments among the participants in response to detecting at least a threshold difference between the corresponding number of processing tasks assigned to a first participant with the highest number of assigned processing tasks and a second participant with the lowest number of assigned processing tasks.
12. The device of claim 11, wherein the rebalancing of task assignment among participants comprises reassigning at least one of the processing tasks from the first participant to the second participant, and updating the stack data structure and one or more corresponding values of the election result tree node via the coordination service.
13. The device of claim 1, wherein interacting with the coordination service during the iteration of the multi-leader election algorithm comprises: At least a portion of a monitoring loop is established between the participants based on the monitoring tools of the coordination service; as well as The monitoring loop is used to detect when one or more of the participants withdraw from the multi-leader election algorithm. The monitoring loop is configured at least in part based on participant identifiers, wherein each participant monitors another participant in the monitoring loop that is adjacent to it, according to its corresponding participant identifier.
14. The apparatus of claim 1, wherein the at least one processing means is further configured to target at least one of the distributed applications: The coordination service determines whether a given participant is currently assigned as the leader of a specific processing task within the processing task; and In response to an affirmative confirmation, the given participant performs the specific processing task.
15. A computer program product comprising a non-transitory processor-readable storage medium wherein program code of one or more software programs is stored, wherein the program code, when executed by at least one processing means including a processor coupled to memory, causes the at least one processing means to: A participant identifier is established in a multi-leader election algorithm implemented in a distributed computing system, together with a coordination service for one or more distributed applications, for a given participant. The distributed computing system includes multiple computing nodes, each corresponding to a participant with a corresponding participant identifier. as well as During the iteration of the multi-leader election algorithm, the system interacts with the coordination service to determine the current assignment of the appropriate participant among the participants as the leader of the corresponding processing task in the distributed computing system. Interacting with the coordination service during the iteration of the multi-leader election algorithm includes: The value of one or more of the participant identifier data structure and the election result data structure is obtained from the coordination service; The obtained values are used to maintain a stack data structure, wherein the participants are categorized as entries in the stack data structure based at least in part on the number of processing tasks assigned to them as leaders; and In response to at least one of the processing tasks not currently having an assigned leader: The participant is assigned to a given processing task among previously unassigned processing tasks, at least in part based on the position of the participant's entry in the stack data structure. The coordination service updates one or more corresponding values of at least one of the stack data structure, the participant identifier data structure, and the election result data structure; and Repeat the assignment and update process until a leader is assigned to all the processing tasks.
16. The computer program product of claim 15, wherein the participant identifier for a given participant in a multi-leader election algorithm, established in conjunction with a coordination service for one or more distributed applications, comprises: The request is to create the participant identifier tree node for the given participant as a sequential and ephemeral node; as well as In response to the request, the participant identifier of the given participant is received.
17. The computer program product of claim 15, wherein the value of the participant identifier data structure includes the value of the participant identifier tree node, and the value of the election result data structure includes the value of the election result tree node.
18. A method for multi-leader election in a distributed computing system, the method comprising: A participant identifier is established in a multi-leader election algorithm implemented in a distributed computing system, together with a coordination service for one or more distributed applications, for a given participant. The distributed computing system includes multiple computing nodes, each corresponding to a participant with a corresponding participant identifier. as well as During the iteration of the multi-leader election algorithm, the system interacts with the coordination service to determine the current assignment of the appropriate participant among the participants as the leader of the corresponding processing task in the distributed computing system. Interacting with the coordination service during the iteration of the multi-leader election algorithm includes: The value of one or more of the participant identifier data structure and the election result data structure is obtained from the coordination service; The obtained values are used to maintain a stack data structure, wherein the participants are categorized as entries in the stack data structure based at least in part on the number of processing tasks assigned to them as leaders; and In response to at least one of the processing tasks not currently having an assigned leader: The participant is assigned to a given processing task among previously unassigned processing tasks, at least in part based on the position of the participant's entry in the stack data structure. The coordination service updates one or more corresponding values of at least one of the stack data structure, the participant identifier data structure, and the election result data structure; and Repeat the assignment and update process until a leader is assigned to all the processing tasks.
19. The method of claim 18, wherein establishing the participant identifier for a given participant in a multi-leader election algorithm, together with a coordination service for one or more distributed applications, comprises: The request is to create the participant identifier tree node for the given participant as a sequential and ephemeral node; as well as In response to the request, the participant identifier of the given participant is received.
20. The method of claim 18, wherein the value of the participant identifier data structure includes the value of the participant identifier tree node, and the value of the election result data structure includes the value of the election result tree node.
Citation Information
Patent Citations
Network function virtualization platform based on container
CN111522653A
Information processing apparatus, parallel computer system and job schedule setting program
US20170010918A1