Conversation: CommitService::CommitsAreAncestors
Stages:
-
~"Client Preparation": -
~"Client Implementation": Create Issue -
~"Acceptance Testing": Create Issue
RPC Endpoints:
Endpoint::Name
Known Client Routes:
- Known client endpoints
Spawned from https://gitlab.com/gitlab-com/infrastructure/issues/2138#note_35962567
The mirror process in GitLab-EE is currently causing an n + 1 issue in Gitaly by calling CommitIsAncestor from within a loop.
Looking at refs_to_delete we may require a bulk version of the CommitIsAncestor method.
Something along the lines of
message CommitsAreAncestorsRequest {
Repository repository = 1;
string child_id = 2;
repeated string ancestor_id = 3;
}
message CommitsAreAncestorsResponse {
repeated string ancestor_id = 1;
}
service CommitService {
// Given a list of `ancestor_id` references and a single `child_id`, returns a subset of
// `ancestor_id` that are in fact ancestors
rpc CommitsAreAncestors(CommitsAreAncestorsRequest) returns (CommitsAreAncestorsResponse) {}
}
@jacobvosmaer-gitlab and I discussed this on a call. The first step would be to create a GitLab::Git bulk commits_are_ancestors method (names TBD).
Once this method is created and in use by update_remote_mirror_service, we port the method to Gitaly using the usual process.
Edited by Andrew Newdigate