gitlab-org--gitlab-foss/lib/gitlab/background_migration
Yorick Peterse 0054d3838c
Reduce UPDATEs for background column type changes
Prior to this commit we would essentially update all rows in a table,
even those where the source column (e.g. `issues.closed_at`) was NULL.
This in turn could lead to statement timeouts when using the default
batch size of 10 000 rows per job.

To work around this we don't schedule jobs for rows where the source
value is NULL. We also don't update rows where the source column is NULL
(as an extra precaution) or the target column already has a non-NULL
value. Using this approach it should be possible to update 10 000 rows
in the "issues" table in about 7.5 - 8 seconds.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/42158
2018-01-18 14:22:41 +01:00
..
.gitkeep
.rubocop.yml
add_merge_request_diff_commits_count.rb Denormalize commits count for merge request diffs 2018-01-10 20:40:02 +01:00
cleanup_concurrent_type_change.rb Use a background migration for issues.closed_at 2018-01-03 12:28:00 +01:00
copy_column.rb Reduce UPDATEs for background column type changes 2018-01-18 14:22:41 +01:00
create_fork_network_memberships_range.rb
create_gpg_key_subkeys_from_gpg_keys.rb
delete_conflicting_redirect_routes_range.rb Make DeleteConflictingRedirectRoutes no-op 2018-01-03 12:23:20 -08:00
deserialize_merge_request_diffs_and_commits.rb
migrate_build_stage_id_reference.rb
migrate_events_to_push_event_payloads.rb Avoid leaving a push event empty if payload cannot be created 2018-01-03 22:49:02 -08:00
migrate_stage_status.rb
migrate_system_uploads_to_new_folder.rb
move_personal_snippet_files.rb
normalize_ldap_extern_uids_range.rb
populate_fork_networks_range.rb
populate_merge_request_metrics_with_events_data.rb
populate_merge_requests_latest_merge_request_diff_id.rb
populate_untracked_uploads.rb
prepare_untracked_uploads.rb Introduce PredicateMemoization cop and fix offenses 2018-01-12 17:54:55 +08:00