IP Library › Granted Patent US 12,131,176
Granted Patent B2
US 12,131,176 · App. 17/579,342 · Granted Oct 29, 2024

Cluster leader selection via ping tasks of service instances

Inventors: Atanas Todorov (Sofia, BG); Ventsyslav Raikov (Sofia, BG)
Assignee: VMware LLC
G06F9/45558G06F9/4881G06F2009/4557
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,131,176
App. No.
17/579,342
Granted
Oct 29, 2024
Kind
B2
Abstract

An example method of executing a periodic task of a service having service instances replicated across hosts in a cluster of a virtualized computing system, the service instances executing in pods implemented by virtual machines (VMs) on the hosts, the method including: persisting, by ping tasks of the service instances, records in a pod information table of a database, the records including pod identifiers of the pods and leader indicators; determining, by a first ping task, a leaderless condition in that the leader indicator in each of the records is false; setting to true, by the first ping task in response to the leaderless condition, the leader indicator in a first record having a first pod identifier for a first pod in which the first ping task executes; and executing the periodic task in the first pod to the exclusion of each other of the pods.

Claims (50)

1. A method of executing a periodic task of a service having service instances replicated across hosts in a cluster of a virtualized computing system, the service instances executing in pods implemented by virtual machines (VMs) on the hosts, the method comprising:

persisting, by ping tasks of the service instances, records in a pod information table of a database, the records including pod identifiers of the pods and leader indicators, the database configured such that the leader indicator in only one of the records can be set to true;

determining, by a first ping task of the ping tasks, a leaderless condition in that the leader indicator in each of the records is false;

setting to true, by the first ping task in response to the leaderless condition, the leader indicator in a first record of the records having a first pod identifier of the pod identifiers for a first pod of the pods in which the first ping task executes; and

executing the periodic task in the first pod to the exclusion of each other of the pods.

2. The method of claim 1 , wherein the records include timestamps indicating time of last update by the ping tasks.

3. The method of claim 2 , further comprising:

querying, by the first ping task, the pod information table for at least one of the records the timestamp of which is older than a threshold time; and

deleting, by the first ping task, the at least one record from the pod information table.

4. The method of claim 1 , further comprising:

setting to false, by the first ping task in response to execution of the periodic task in the first pod, the leader indicator in the first record.

5. The method of claim 1 , further comprising:

determining, by a second ping task of the ping tasks, a leader condition in that the leader indicator in the first record is true; and

preventing execution of the periodic task in a second pod of the pods in which the second ping task executes in response to the leader condition.

6. The method of claim 1 , wherein the virtualized computing system comprises a container orchestrator, wherein the container orchestrator cooperates with hypervisors in the hosts to deploy the VMs, and wherein the services instances execute in containers of the VMs managed by the container orchestrator.

7. The method of claim 1 , wherein the service is one of a plurality of services of an application, and wherein the database is a component of the application configured to persist data for the plurality of services.

8. A non-transitory computer readable medium comprising instructions to be executed in a computing device to cause the computing device to carry out a method of executing a periodic task of a service having service instances replicated across hosts in a cluster of a virtualized computing system, the service instances executing in pods implemented by virtual machines (VMs) on the hosts, the method comprising:

persisting, by ping tasks of the service instances, records in a pod information table of a database, the records including pod identifiers of the pods and leader indicators, the database configured such that the leader indicator in only one of the records can be set to true;

determining, by a first ping task of the ping tasks, a leaderless condition in that the leader indicator in each of the records is false;

setting to true, by the first ping task in response to the leaderless condition, the leader indicator in a first record of the records having a first pod identifier of the pod identifiers for a first pod of the pods in which the first ping task executes; and

executing the periodic task in the first pod to the exclusion of each other of the pods.

9. The non-transitory computer readable medium of claim 8 , wherein the records include timestamps indicating time of last update by the ping tasks.

10. The non-transitory computer readable medium of claim 9 , further comprising:

querying, by the first ping task, the pod information table for at least one of the records the timestamp of which is older than a threshold time; and

deleting, by the first ping task, the at least one record from the pod information table.

11. The non-transitory computer readable medium of claim 8 , further comprising:

setting to false, by the first ping task in response to execution of the periodic task in the first pod, the leader indicator in the first record.

12. The non-transitory computer readable medium of claim 8 , further comprising:

determining, by a second ping task of the ping tasks, a leader condition in that the leader indicator in the first record is true; and

preventing execution of the periodic task in a second pod of the pods in which the second ping task executes in response to the leader condition.

13. The non-transitory computer readable medium of claim 8 , wherein the virtualized computing system comprises a container orchestrator, wherein the container orchestrator cooperates with hypervisors in the hosts to deploy the VMs, and wherein the services instances execute in containers of the VMs managed by the container orchestrator.

14. The non-transitory computer readable medium of claim 8 , wherein the service is one of a plurality of services of an application, and wherein the database is a component of the application configured to persist data for the plurality of services.

15. A virtualized computing system, comprising:

a cluster of hosts; and

a service having service instances replicated across the hosts, the service instances implemented by virtual machines (VMs) on the hosts;

wherein a periodic task of the service is executed by:

persisting, by ping tasks of the service instances, records in a pod information table of a database, the records including pod identifiers of the pods and leader indicators, the database configured such that the leader indicator in only one of the records can be set to true;

determining, by a first ping task of the ping tasks, a leaderless condition in that the leader indicator in each of the records is false;

setting to true, by the first ping task in response to the leaderless condition, the leader indicator in a first record of the records having a first pod identifier of the pod identifiers for a first pod of the pods in which the first ping task executes; and

executing the periodic task in the first pod to the exclusion of each other of the pods.

16. The virtualized computing system of claim 15 , wherein the records include timestamps indicating time of last update by the ping tasks.

17. The virtualized computing system of claim 16 , wherein the periodic task is further executed by:

querying, by the first ping task, the pod information table for at least one of the records the timestamp of which is older than a threshold time; and

deleting, by the first ping task, the at least one record from the pod information table.

18. The virtualized computing system of claim 15 , wherein the periodic task is further executed by:

setting to false, by the first ping task in response to execution of the periodic task in the first pod, the leader indicator in the first record.

19. The virtualized computing system of claim 15 , wherein the periodic task is further executed by:

determining, by a second ping task of the ping tasks, a leader condition in that the leader indicator in the first record is true; and

preventing execution of the periodic task in a second pod of the pods in which the second ping task executes in response to the leader condition.

20. The virtualized computing system of claim 15 , wherein the virtualized computing system comprises a container orchestrator, wherein the container orchestrator cooperates with hypervisors in the hosts to deploy the VMs, and wherein the services instances execute in containers of the VMs managed by the container orchestrator.

Assignments (2)
CHANGE OF NAME Recorded Apr 15, 2024
From: VMWARE, INC.
To: VMWARE LLC
Reel/Frame 067102/0242 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 18, 2022
From: TODOROV, ATANAS; RAIKOV, VENTSYSLAV
To: VMWARE, INC.
Reel/Frame 059047/0709 →
Continuity (1)
Related Publication 20230229475A1 · Jul 20, 2023
Cited By (1)
US 12,579,161