MergeRequestDiff with zero files are not marked as stored_externally, stalling the background migration
Summary
MergeRequestDiff
with zero files are not marked as stored_externally
, stalling the background migration. After a while of enabling the external diffs feature, the MergeRequests::MigrateExternalDiffsService
will enqueue the same set of MergeRequestDiff
records over and over again because stored_externally
is not set to true
for them.
Steps to reproduce
Judging by the behavior observed on staging, just create 1000 MRs with no diffs, then run MergeRequests::MigrateExternalDiffsService.enqueue!
. They won't be marked as stored_externally
.
What is the current bug behavior?
MergeRequestDiff
whose merge_request_diff_files.count == 0
are skipped by the migration.
What is the expected correct behavior?
Either mark the record as stored_externally
or use a special flag that exclude them from MergeRequestDiff.ids_for_external_storage_migration
.