Swap FK ci_daily_build_group_report_results to projects for LFK
What does this MR do and why?
Per &7249 (closed)
As part of our CI "decomposition" efforts we need to remove all foreign keys that are cross-database (ie. between the planned main
and ci
databases). We are going to replace them all with "loose foreign keys".
This foreign key have been determined to be safe for swapping to loose foreign keys per #348267 (closed).
We use
Ci::DailyBuildGroupReportResult.project_id
to build coverage analytic at the project level. Impossible to access the analytic page (groups/group_id/project_id/-/graphs/master/charts
) without aproject_id
.
Related issue: #348267 (closed)
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Merge request reports
Activity
changed milestone to %14.7
assigned to @tkuah
- A deleted user
added backend database databasereview pending labels
1 Message This merge request adds or changes files that require a review from the Database team. This merge request requires a database review. To make sure these changes are reviewed, take the following steps:
- Ensure the merge request has database and databasereview pending labels. If the merge request modifies database files, Danger will do this for you.
- Prepare your MR for database review according to the docs.
- Assign and mention the database reviewer suggested by Reviewer Roulette.
The following files require a review from the Database team:
db/post_migrate/20220112232723_remove_projects_ci_daily_build_group_report_results_project_id_fk.rb
db/schema_migrations/20220112232723
db/structure.sql
lib/gitlab/database/gitlab_loose_foreign_keys.yml
Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Niko Belokolodov ( @nbelokolodov
) (UTC+13, same timezone as@tkuah
)Jarka Košanová ( @jarka
) (UTC+1, 12 hours behind@tkuah
)database Matthias Käppler ( @mkaeppler
) (UTC+1, 12 hours behind@tkuah
)Adam Hegyi ( @ahegyi
) (UTC+1, 12 hours behind@tkuah
)~migration No reviewer available No maintainer available To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Dangermarked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed
added typefeature label
added 1 commit
- 24ebace5 - Add LFK ci_daily_build_group_report_results to projects
added 1 commit
- 60d4e39d - Add LFK ci_daily_build_group_report_results to projects
mentioned in issue #348267 (closed)
mentioned in epic &7249 (closed)
Database migrations
Migrations included in this change have been executed on gitlab.com data for testing purposes. For details, please see the migration testing pipeline (limited access).
Migration Type Total runtime Result DB size change 20220112232723 - RemoveProjectsCiDailyBuildGroupReportResultsProjectIdFk Post deploy 1.4 s +0.00 B Runtime Histogram for all migrations
Query Runtime Count 0 seconds - 0.01 seconds 0 0.01 seconds - 0.1 seconds 2 0.1 seconds - 1 second 0 1 second - 5 minutes 0 5 minutes + 0 Migration: 20220112232723 - RemoveProjectsCiDailyBuildGroupReportResultsProjectIdFk
- Type: Post deploy
- Duration: 1.4 s
- Database size change: +0.00 B
Query Calls Total Time Max Time Mean Time Rows ALTER TABLE "ci_daily_build_group_report_results" DROP CONSTRAINT "fk_rails_0667f7608c" /*application:test,db_config_name:main*/
1 6.2 ms 6.2 ms 6.2 ms 0 LOCK projects, ci_daily_build_group_report_results IN ACCESS EXCLUSIVE MODE /*application:test,db_config_name:main*/
1 0.2 ms 0.2 ms 0.2 ms 0 Histogram for RemoveProjectsCiDailyBuildGroupReportResultsProjectIdFk
Query Runtime Count 0 seconds - 0.01 seconds 0 0.01 seconds - 0.1 seconds 2 0.1 seconds - 1 second 0 1 second - 5 minutes 0 5 minutes + 0
Other migrations pending on GitLab.com
Migration Type Total runtime Result DB size change 20211207081708 - AddIndexCiJobArtifactsProjectIdFileType Post deploy 1.8 s +0.00 B 20211217174331 - MarkRecalculateFindingSignaturesAsCompleted Post deploy 1.8 s +1.18 MiB 20220111221516 - RemoveProjectsCiPendingBuildsFk Post deploy 1.7 s +0.00 B 20220112230642 - RemoveProjectsCiUnitTestsProjectIdFk Post deploy 1.4 s +0.00 B 20220113015830 - RemoveProjectsCiBuildReportResultsProjectIdFk Post deploy 1.5 s +0.00 B 20220113035519 - RemoveUsersCiJobTokenProjectScopeLinksAddedByIdFk Post deploy 1.5 s +0.00 B 20220113040447 - RemoveUsersCiPipelineSchedulesOwnerIdFk Post deploy 1.4 s +0.00 B Clone Details
Clone ID Clone Created At Clone Data Timestamp Expected Removal Time database-testing-987627
2022-01-14 12:07:07 UTC 2022-01-14 08:01:31 UTC 2022-01-15 00:09:34 +0000 Artifacts
Brought to you by gitlab-org/database-team/gitlab-com-database-testing. Epic
added 68 commits
-
60d4e39d...134c16cc - 67 commits from branch
master
- bbfe662a - Add LFK ci_daily_build_group_report_results to projects
-
60d4e39d...134c16cc - 67 commits from branch
removed review request for @morefice
added databasereviewed label and removed databasereview pending label
@morefice
, thanks for approving this merge request.This is the first time the merge request is approved. To ensure full test coverage, a new pipeline has been started.
For more info, please refer to the following links:
- A deleted user
added database-testing-automation label
- Resolved by Adam Hegyi
added 232 commits
-
bbfe662a...8e93523b - 230 commits from branch
master
- 578d5d95 - Add LFK ci_daily_build_group_report_results to projects
- b7349395 - Add extra locking to avoid deadlock errors
-
bbfe662a...8e93523b - 230 commits from branch
- Resolved by Adam Hegyi
Hi, @pbair! Could you take a look? I added the extra table locking statement.
Edited by Adam Hegyi
requested review from @pbair
added databaseapproved label and removed databasereviewed label
enabled an automatic merge when the pipeline for 1da26134 succeeds
mentioned in commit 5cd90bb9
added workflowstaging-canary label and removed workflowin dev label
added workflowstaging label and removed workflowstaging-canary label
added workflowcanary label and removed workflowstaging label
added workflowproduction label and removed workflowcanary label
added releasedcandidate label
added releasedpublished label and removed releasedcandidate label
mentioned in merge request kubitus-project/kubitus-installer!562 (merged)
added devopsdata stores label and removed devopssystems label