Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not resync services during node tracker startup
When we execute Run() in the service controller code, we wait on purpose for all node tracker add operations to be done, before we set up and start the service and endpoint handlers. Now, every node tracker add operation runs RequestFullSync, which (1) updates OVN LB templates on NBDB; (2) for each service, adds the service key to the service handler queue so that the service can be processed again. This last part is necessary to recompute services when a node is added, updated or deleted, but at startup the service handler hasn't been started yet, so we're just adding the same service keys to the same queue for each node in the cluster, with no worker consuming the keys. This proved to take a significantly long time in large clusters: if adding a key to the queue takes 8 * 10**(-6) seconds, when we have 11500 services and 250 nodes, this takes in total 8 * 10**(-6) * 11500 * 250 = 23 seconds. Soon afterwards, in Run() we setup service and endpointslice handlers and we wait for them to process all add operations: the service handler queue is filled with all existing services anyway and workers are started so that we can finally process each service in the queue. Let's optimize this and use a simple flag to avoid adding all service keys during node tracker startup. Signed-off-by: Riccardo Ravaioli <rravaiol@redhat.com>
- Loading branch information