Skip to content

Add unique index for delete_replica replication events

Sami Hiltunen requested to merge smh-delete-replica-unique-index into master

There should always be only one 'delete_replica' event scheduled to prevent accidentally deleting too many replicas of a repository. If we allow more than one, we could schedule multiple deletion jobs if the assignments are shuffled around. This could lead to Praefect deleting all of the replicas. To prevent this from happening, this commit adds a unique index that ensure we only have a single delete_replica job scheduled for any given (virtual_storage, relative_path) tuple. This index can additionally be used by the reconciler to check whether a deletion job already exists or not.

Edited by Sami Hiltunen

Merge request reports

Loading