Don't create partitions assignments when accessing a non-existent repository
Gitaly is currently assigning a repository into a partition as soon as it's accessed for the first time. This is done even if the repository does not exist yet. This has undesired consequences as accessing non-existent repositories will create unnecessary partition records. Rails also checks whether a fork exists before creating a fork. Accessing the non-existent repository first creates the partition assignment and lands the fork a different partition from the pool and the origin repository.
We should not create partition assignments when accessing non-existent repositories. We should instead error out with a repository not found
error as most RPCs would anyway fail.
RepositoryExists
should be special cased to convert the not found
errors into a response message as the RPC does not error out if repository doesn't exist. Previously we would have assigned the repository into a partition first, and then the RPC handler would run normally in a transaction and return the response. As we no longer would start transactions for non-existent repositories that are not about to be created, we need to handle this separately.