Geo - Make sure project does not meet selective sync rule before deleting it

Summary

When an admin set or change the selective sync criteria on the Geo primary node we trigger a Geo::RepositoriesChangedEvent event, when we process it on the Geo secondary node we clean up the repositories that do not satisfy the criteria.

Our current implementation schedules the Geo::RepositoriesCleanUpWorker to be performed in one hour, this worker is responsible for scheduling a GeoRepositoryDestroyWorker to be performed asynchronously for each project that does not satisfy the constraint.

We should change it or the underline Geo::RepositoryDestroyService service to check if the project still not meet the selective sync constraint before deleting it in case that the admin made a mistake while changing the selective sync constraint on the primary node or the changed it multiple times in a small interval of time.

/cc @rnienaber

Edited Jan 29, 2019 by Douglas Barbosa Alexandre
Assignee Loading
Time tracking Loading