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
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) - This is a fix for a change not yet released
-
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.