Skip to content

Fix accessors mislabeled as mutators

Patrick Steinhardt requested to merge pks-proto-mislabeled-accessors into master

Besides other things, the accessor/mutator label for RPCs influences routing decisions, queueing of replication jobs and registration of transactions. While accessors may get routed to any up-to-date node, mutators will need to get routed either to the primary or to all nodes at once when strong consistency is enabled. As a result, accessors are typically served a lot more efficiently.

We currently have two functions which seem to be mislabeled as mutators while they will only access repository info:

- /gitaly.RepositoryService/RepositorySize: this reports the
  repository size by spawning `du -sk` on the repository.

- /gitaly.SSHService/SSHUploadArchive: this spawns `git
  upload-archive`, which will create a Git archive on the server
  side and feed it into a client-side `git archive` call.

Both are readonly and thus shouldn't have a mutator label, so let's fix this and reclassify them as accessors.

Merge request reports

Loading