PraefectInfoService provides APIs for managing Gitaly cluster operations, including repository replication, data loss detection, and repository metadata.
Service Definition
The PraefectInfoService is defined inproto/praefect.proto and provides cluster management capabilities for Praefect, Gitaly’s replication and high availability solution.
RPC Methods
RepositoryReplicas
Retrieves information about repository replicas across the cluster. Request:RepositoryReplicasRequest
RepositoryReplicasResponse
DatalossCheck
Checks for unavailable repositories in the cluster. This is critical for identifying repositories that may have data loss or availability issues. Request:DatalossCheckRequest
DatalossCheckResponse
SetAuthoritativeStorage
Sets the authoritative storage for a repository on a virtual storage. This marks the current version on the authoritative storage as the latest, overwriting other versions. Request:SetAuthoritativeStorageRequest
SetAuthoritativeStorageResponse (empty)
Usage: Use this RPC when you need to resolve conflicts by designating one storage as authoritative.
MarkUnverified
Marks replicas as unverified to trigger Praefect’s metadata verifier. Unverified replicas are prioritized for verification. Request:MarkUnverifiedRequest
MarkUnverifiedResponse
SetReplicationFactor
Configures the desired replication factor for a repository. This assigns or unassigns storage nodes to meet the target replication level. Request:SetReplicationFactorRequest
SetReplicationFactorResponse
- Replication factor must be >= 1
- Cannot exceed the number of storage nodes in the virtual storage
- The primary node is never unassigned (it must have a copy for writes)
- The primary is the first storage assigned when setting replication factor
- Assignments of unconfigured storages are ignored
GetRepositoryMetadata
Retrieves cluster metadata for a repository including replica information, generation, and health status. Request:GetRepositoryMetadataRequest
GetRepositoryMetadataResponse
NotFound error if the repository does not exist.
Common Use Cases
Checking Cluster Health
Adjusting Replication Factor
Inspecting Repository Metadata
Package Information
Package:gitalyGo Package:
gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypbIntercepted: Yes (all RPCs go through Praefect interceptors)