Skip to content

Disconnect alternates when unlinking from a repository pool

James Fargher requested to merge disconnect_alternates into master

What does this MR do and why?

Fixes #344880 (closed)

Previous to this fix when a project removed the fork relationship, this would also remove the pool repository link in the database but left the physical git repository link. Then when the original project is deleted, since there is no database link anymore, gitlab thinks the pool is now has no projects associated with it and deletes it. Once this happens, the fork can no longer access the objects it is using from the pool repository and so the repository is broken.

To fix this, we now tell gitaly to remove the physical link before we remove the database link via the DisconnectAlternates RPC.

How to set up and validate locally

  1. Create a public project on GDK.
  2. Fork this project.
  3. On the fork: Settings -> General -> Advanced -> Remove fork relationship
  4. On the original project: Settings -> General -> Advanced -> Delete project
  5. Refresh the fork project page and check that the files show. If nothing shows, then the fork is broken.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by James Fargher

Merge request reports