Skip to content

Add project_id to merge_request_diff_files_99208b8fac

What does this MR do and why?

Adds project_id to merge_request_diff_files_99208b8fac as a desired sharding key for eventual backfill and schedules an index to be created asynchronously.

Database

Up

SQL
main: == [advisory_lock_connection] object_id: 121220, pg_backend_pid: 70787
main: == 20240802203135 AddProjectIdToMergeRequestDiffFiles99208b8fac: migrating ====
main: -- add_column(:merge_request_diff_files_99208b8fac, :project_id, :bigint)
main:    -> 0.0088s
main: == 20240802203135 AddProjectIdToMergeRequestDiffFiles99208b8fac: migrated (0.0138s) 

main: == [advisory_lock_connection] object_id: 121220, pg_backend_pid: 70787
ci: == [advisory_lock_connection] object_id: 121500, pg_backend_pid: 70789
ci: == 20240802203135 AddProjectIdToMergeRequestDiffFiles99208b8fac: migrating ====
ci: -- add_column(:merge_request_diff_files_99208b8fac, :project_id, :bigint)
ci:    -> 0.0016s
ci: == 20240802203135 AddProjectIdToMergeRequestDiffFiles99208b8fac: migrated (0.0090s) 

ci: == [advisory_lock_connection] object_id: 121500, pg_backend_pid: 70789
main: == [advisory_lock_connection] object_id: 121920, pg_backend_pid: 70792
main: == 20240802203140 PrepareIndexMergeRequestDiffFiles99208b8facOnProjectId: migrating 
main: -- index_exists?(:merge_request_diff_files_99208b8fac, :project_id, {:name=>"index_merge_request_diff_files_99208b8fac_on_project_id", :algorithm=>:concurrently})
main:    -> 0.0016s
main: -- add_index_options(:merge_request_diff_files_99208b8fac, :project_id, {:name=>"index_merge_request_diff_files_99208b8fac_on_project_id", :algorithm=>:concurrently})
main:    -> 0.0002s
main: == 20240802203140 PrepareIndexMergeRequestDiffFiles99208b8facOnProjectId: migrated (0.0995s) 

main: == [advisory_lock_connection] object_id: 121920, pg_backend_pid: 70792
ci: == [advisory_lock_connection] object_id: 122400, pg_backend_pid: 70794
ci: == 20240802203140 PrepareIndexMergeRequestDiffFiles99208b8facOnProjectId: migrating 
ci: -- index_exists?(:merge_request_diff_files_99208b8fac, :project_id, {:name=>"index_merge_request_diff_files_99208b8fac_on_project_id", :algorithm=>:concurrently})
ci:    -> 0.0011s
ci: -- add_index_options(:merge_request_diff_files_99208b8fac, :project_id, {:name=>"index_merge_request_diff_files_99208b8fac_on_project_id", :algorithm=>:concurrently})
ci:    -> 0.0001s
ci: == 20240802203140 PrepareIndexMergeRequestDiffFiles99208b8facOnProjectId: migrated (0.0155s) 

ci: == [advisory_lock_connection] object_id: 122400, pg_backend_pid: 70794

Down

SQL
main: == [advisory_lock_connection] object_id: 118460, pg_backend_pid: 80308
main: == 20240802203140 PrepareIndexMergeRequestDiffFiles99208b8facOnProjectId: reverting 
main: -- index_name(:merge_request_diff_files_99208b8fac, "index_merge_request_diff_files_99208b8fac_on_project_id")
main:    -> 0.0000s
main: == 20240802203140 PrepareIndexMergeRequestDiffFiles99208b8facOnProjectId: reverted (0.0200s) 

main: == [advisory_lock_connection] object_id: 118460, pg_backend_pid: 80308
main: == [advisory_lock_connection] object_id: 117880, pg_backend_pid: 84793
main: == 20240802203135 AddProjectIdToMergeRequestDiffFiles99208b8fac: reverting ====
main: -- remove_column(:merge_request_diff_files_99208b8fac, :project_id)
main:    -> 0.0013s
main: == 20240802203135 AddProjectIdToMergeRequestDiffFiles99208b8fac: reverted (0.0046s) 

main: == [advisory_lock_connection] object_id: 117880, pg_backend_pid: 84793
ci: == [advisory_lock_connection] object_id: 117880, pg_backend_pid: 89284
ci: == 20240802203140 PrepareIndexMergeRequestDiffFiles99208b8facOnProjectId: reverting 
ci: -- index_name(:merge_request_diff_files_99208b8fac, "index_merge_request_diff_files_99208b8fac_on_project_id")
ci:    -> 0.0000s
ci: == 20240802203140 PrepareIndexMergeRequestDiffFiles99208b8facOnProjectId: reverted (0.0228s) 

ci: == [advisory_lock_connection] object_id: 117880, pg_backend_pid: 89284
ci: == [advisory_lock_connection] object_id: 117880, pg_backend_pid: 93452
ci: == 20240802203135 AddProjectIdToMergeRequestDiffFiles99208b8fac: reverting ====
ci: -- remove_column(:merge_request_diff_files_99208b8fac, :project_id)
ci:    -> 0.0015s
ci: == 20240802203135 AddProjectIdToMergeRequestDiffFiles99208b8fac: reverted (0.0110s) 

ci: == [advisory_lock_connection] object_id: 117880, pg_backend_pid: 93452

Related to #464109 (closed)

Edited by Matt Kasa

Merge request reports

Loading