Perform deletes atomically by marking the repository as deleted in the database
Deletes are problematic currently as they may fail in multiple ways. The deletion may succeed on the disk but Praefect may fail to update the database state. This creates an inconsistency. Likewise, it may not be possible to delete the repository from all the replicas. The stale replicas can cause problems when the repository is being recreated, for example through a backup restoration.
Praefect should intercept RemoveRepository
calls and simply delete the database record for the repository. This would make the deletion operation atomic to the client, the record either succeeds at being deleted or not. Praefect would then in the background schedule deletion jobs to remove the stale replicas.
This is blocked by #3485 (closed) as the stale state of the secondaries would prevent recreating the repository otherwise.