[go: up one dir, main page]

Optimize list_refs usage by skipping unnecesary calls

What does this MR do and why?

Contributes to #556727 (closed)

Problem

New feature flag ref_existence_check_gitaly migrates reference existance checks from Redis to Gitaly. But some endpoints generate suboptimal chain of calls that lead to N+1 Gitaly calls.

Solution

  • Skip the branch check for default branch
  • Preload references for BranchesController

References

[FF] `ref_existence_check_gitaly` -- use Gitaly... (#556727 - closed)

How to set up and validate locally

  1. Enable feature flag Feature.enable(:ref_existence_check_gitaly)
  2. Visit http://gdk.test:3000/gitlab-org/gitlab-test/-/branches
  3. You should see only one ListRefs call
Before After
Screenshot_2025-09-10_at_14.51.47 Screenshot_2025-09-10_at_14.34.18

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.

Related to #556727 (closed)

Edited by Vasilii Iakliushin

Merge request reports

Loading