Move pipeline etag expiration to a bg worker

What does this MR do and why?

ExpirePipelineCacheService runs an unpartitioned query against the ci_pipelines table. This causes LockManager LWLock contention on the CI primary database.

This MR moves the ETag cache expiration logic from ExpirePipelineCacheService into a background worker, allowing the query to be routed to a replica. This reduces load on the CI primary database by offloading the unpartitioned ci_pipelines query to a read replica.

Changelog: fixed

References

gitlab-com/gl-infra/production#21562

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Marius Bobin

Merge request reports

Loading