Loading
Backport of 'Batch the push commit overlap lookup in RefreshService' (19.3)
What does this MR do and why?
Backport and enable batched commit overlap lookups in RefreshService, querying candidate diffs together in batches of 1,000 pushed SHAs while retaining the full commit list.
Backport rationale, rollback, and verification
- Reduces repeated overlap lookups during push processing. This is a candidate mitigation for high CPU on a GitLab Dedicated tenant; the tenant's root cause is not yet confirmed.
- Two clean
cherry-pick -xcommits independently target19-3-stable-ee, based on freshorigin/19-3-stable-eeat97e1a8d8b6e2(19.3.3-ee). GitLab 19.3 lacks this code; both refresh fixes were first verified shipped default-on in19.4.0. The original batching fix deployed to production on August 20, and its default-on change on September 8. - The original commit's “Cap push commits” message is obsolete: the patch batches lookups and does not cap the commit list.
- Preserves 19.3's
project_id_pruning_enabled?storage behavior without a partitioning refactor.merge_request_refresh_batched_commit_lookupis a project-scoped beta flag withdefault_enabled: true; disable it for the project to restore the old path. git diff --checkpassed; each commit'sgit patch-idmatches upstream. RuboCop passed for all four changed Ruby files.
References
- Issues: #608151 (closed) and #608174 (closed)
- Original fix: !248701 (merged) —
81c7452fd093→e5e806c838ca. - Default-on change: !253940 (merged) —
7a4f177e34b3→b6dd0b3fe9b0. - Related: #628868 (closed) and https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/team/-/work_items/13987
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
- This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
- The MR that fixed the bug on the default branch has been deployed to GitLab.com (not applicable for documentation or spec changes).
- The MR title is descriptive (e.g. "Backport of 'title of default branch MR'"). This is important, since the title will be copied to the patch blog post.
- Required labels have been applied to this merge request
- severity label and bug subtype labels (if applicable)
- If this MR fixes a bug that affects customers, the customer label has been applied.
- This MR has been approved by a maintainer (only one approval is required).
- Ensure the
e2e:test-on-omnibus-eejob has succeeded, or if it has failed, investigate the failures. If you determine the failures are unrelated, you may proceed. If you need assistance investigating, request help in the #s_developer_experience Slack channel to confirm the failures are unrelated to the merge request.
Note to the merge request author and maintainer
If you have questions about the patch release process, please:
- Refer to the patch release runbook for engineers and maintainers for guidance.
- Ask questions on the
#releasesSlack channel (internal only). - Once the backport has been merged, the commit changes will be automatically deployed to a release environment that can be used for manual validation. See after merging runbook for details.
Edited by Marc Shaw