Geo - Project removal leaves orphaned data on disk
Summary
While removing a project, Geo leaves +deleted
folder behind on secondaries. This happens because GitlabShellWorker
that is responsible for deleting this folder is inside a run_after_commit` callback since we don't perform any database operation this callback will never be triggered.
Steps to reproduce
- Enable the feature flag:
Feature.enable(:geo_project_registry_ssot_sync)
; - Enable the selective sync on the group level;
- Wait for the replication to finish;
- Disable the selective sync;
- Wait a few minutes;
- Check the background pages on the Geo secondary node;
Screenshots
Possible fixes
Schedule the repository deletion to remove the +deleted folder after we trash the repositories in EE::Projects::DestroyService#geo_replicate method.