Draft: Allow selective sync by orgs for Merge Request Diff

What does this MR do and why?

This change improves how GitLab's Geo replication system handles merge request diffs (the code changes in merge requests) across different GitLab instances.

The main improvements include:

  1. Better selective sync support: Added a new verifiables method that determines which merge request diffs should be checksummed and replicated based on whether the system is running on a primary or secondary GitLab instance.

  2. Enhanced filtering logic: Updated the selective_sync_scope method to be more efficient when filtering which diffs to sync, especially when dealing with large datasets. It now better handles cases where only specific ranges of records need to be processed.

  3. Improved replication method: Enhanced replicables_for_current_secondary to work better with the selective sync feature, ensuring secondary instances only receive the diffs they actually need.

  4. Test reorganization: Restructured the test file to better organize Geo-related tests under a dedicated section, making the code more maintainable and adding comprehensive test coverage for the new selective sync behavior.

These changes make GitLab's Geo replication more efficient by ensuring that secondary instances only sync and verify the merge request diffs that are relevant to them, reducing unnecessary network traffic and storage usage.

References

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.

Merge request reports

Loading