US 12,131,176 B2
Cluster leader selection via ping tasks of service instances
Atanas Todorov, Sofia (BG); and Ventsyslav Raikov, Sofia (BG)
Assigned to VMware LLC, Palo Alto, CA (US)
Filed by VMware, Inc., Palo Alto, CA (US)
Filed on Jan. 19, 2022, as Appl. No. 17/579,342.
Prior Publication US 2023/0229475 A1, Jul. 20, 2023
Int. Cl. G06F 9/455 (2018.01); G06F 9/48 (2006.01)
CPC G06F 9/45558 (2013.01) [G06F 9/4881 (2013.01); G06F 2009/4557 (2013.01)] 20 Claims
OG exemplary drawing
 
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.