Skip to content

Remove transaction when migrating diff commits

What does this MR do?

The background migration MigrateMergeRequestDiffCommitUsers was wrapping its updates in a transaction. This was a left-over from an early draft of the merge request. As the bulk updates can take some time to complete, this can lead to long transaction timings. On production this ultimately lead to the incident described in issue gitlab-com/gl-infra/production#5119 (closed), though fortunately this didn't seem to negatively affect users.

This commit removes the transaction, and adds a migration to reschedule all the background jobs (which have been removed from the queue). Rescheduling all jobs is the simplest solution to ensuring all data is migrated. Rows that have already been migrated will be updated again, but that's not a problem. Any existing data in merge_request_diff_commit_users will just be reused.

See the following for more details:

Does this MR meet the acceptance criteria?

Conformity

Merge request reports