这是indexloc提供的服务,不要输入任何密码
Skip to content

Draft: Geo Primary Verification: Add keyset pagination

What does this MR do and why?

This MR adds keyset pagination support to the Geo Primary Verification Data Management API, enabling efficient pagination through large datasets of Geo-replicated models. It extends the Orderable concern to support keyset ordering for both simple and composite primary keys, automatically generating supported_keyset_orderings based on the model's primary key structure. The API now accepts cursor and sort parameters, allowing administrators to paginate through verification data without the performance degradation of offset pagination on large tables. This is particularly important for Geo customers managing millions of records (projects, uploads, repositories) who need to efficiently browse and verify data integrity across their distributed GitLab installations.

There is not order_by parameter because we decided to only allow ordering by primary key for performance reasons.

References

Related to #578307

How to set up and validate locally

First, ensure you've got a Geo-enabled GDK.

  1. Enable the primary verification flag: Feature.enable(:geo_primary_verification_view)
  2. Query a model with keyset pagination and non default sort order:
curl -H "Authorization: Bearer <api token>" "http://localhost:3000/api/v4/admin/data_management/project?pagination=keyset&per_page=10&sort=desc"
  1. This will return a list of the last 10 projects, sorted by IDs.

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 Chloe Fons

Merge request reports

Loading