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 -x commits independently target 19-3-stable-ee, based on fresh origin/19-3-stable-ee at 97e1a8d8b6e2 (19.3.3-ee). GitLab 19.3 lacks this code; both refresh fixes were first verified shipped default-on in 19.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_lookup is a project-scoped beta flag with default_enabled: true; disable it for the project to restore the old path.
  • git diff --check passed; each commit's git patch-id matches upstream. RuboCop passed for all four changed Ruby files.

References

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
  • This MR has been approved by a maintainer (only one approval is required).
  • Ensure the e2e:test-on-omnibus-ee job 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:

Edited by Marc Shaw

Merge request reports

Loading
Loading