Upload migration lease key is incorrect for non-mounted uploaders
We use an exclusive lease when migrating an upload to object storage. The current lease key is derived from the model, which works fine when the file and the model have a 1-1 association.
In the case of the FileUploader
, this causes problem, because there are N files that use the same model. We should change the lease key to be derived from the Upload
when an Uploader
extends RecordsUpload
.
Lease keys would then become:
- LfsObjectUploader: object_storage_migrate:Project:1
- ArtifactsUploader: object_storage_migrate:JobArtifact:1
- FileUploader: object_storage_migrate:Upload:1
- AvatarUploader: object_storage_migrate:Upload:2
/cc @ayufan @jprovaznik
Edited by Micaël Bergeron