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 Added Rubocop config for background migrations 2017-11-23 13:56:51 +01:00
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 Added Rubocop config for background migrations 2017-11-23 13:56:51 +01:00
create_gpg_key_subkeys_from_gpg_keys.rb Added Rubocop config for background migrations 2017-11-23 13:56:51 +01:00
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 Added Rubocop config for background migrations 2017-11-23 13:56:51 +01:00
migrate_build_stage_id_reference.rb Added Rubocop config for background migrations 2017-11-23 13:56:51 +01:00
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 Added Rubocop config for background migrations 2017-11-23 13:56:51 +01:00
migrate_system_uploads_to_new_folder.rb Added Rubocop config for background migrations 2017-11-23 13:56:51 +01:00
move_personal_snippet_files.rb Added Rubocop config for background migrations 2017-11-23 13:56:51 +01:00
normalize_ldap_extern_uids_range.rb Added Rubocop config for background migrations 2017-11-23 13:56:51 +01:00
populate_fork_networks_range.rb Create fork networks for forks for which the source was deleted. 2017-11-29 12:11:48 +01:00
populate_merge_request_metrics_with_events_data.rb Cache merged and closed events data in merge_request_metrics table 2018-01-02 17:45:25 -02:00
populate_merge_requests_latest_merge_request_diff_id.rb Added Rubocop config for background migrations 2017-11-23 13:56:51 +01:00
populate_untracked_uploads.rb Process normal paths in batch containing bad paths 2017-12-05 14:57:58 -08:00
prepare_untracked_uploads.rb Introduce PredicateMemoization cop and fix offenses 2018-01-12 17:54:55 +08:00