Disconnect alternates when unlinking from a repository pool
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
- Create a public project on GDK.
- Fork this project.
- On the fork: Settings -> General -> Advanced -> Remove fork relationship
- On the original project: Settings -> General -> Advanced -> Delete project
- 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.
-
I have evaluated the MR acceptance checklist for this MR.