Skip to content

Implement DeleteReplica replication job type

Sami Hiltunen requested to merge smh-delete-replica-job-type into master
  • RepositoryStore has DeleteRepository for deleting a repository from the store. It deletes the repository's record from the repositories table to indicate the repository should not exist on any storages anymore. It then also deletes the storage's record of having a replica of the repository. This works fine for the flow where it is currently called, namely when Rails deletes a repository. In that case, the deletion should be replicated everywhere and we should delete any records of it from the database.

    Reconciler is gaining support for deleting repositories from storages which should not contain them anymore. In this case, we only want to delete the replica of the repository on a given storage. We don't want to replicate the deletion anywhere else nor do we want to delete the repository's entry in repositories table as the repository should still exist and be accessible via other storages. To support this use case, this commit introduces a DeleteReplica method on the Repository Store to delete a record of a replica from a given storage without affecting any other state in the database.

  • This commit adds a 'delete_replica' replication job type. It differs from 'delete' type by only deleting the specific replica without marking the repository deleted from the virtual storage completely.

    While we could update 'delete' to be handled in a similar manner, this would require us to do the work over multiple releases as old Praefect's could delete repositories completely during an upgrade. For this reason, let's implement a new job type on the side an remove the old 'delete' type in future.

Related to #3361 (closed)

Edited by Sami Hiltunen

Merge request reports

Loading