Drop unused ci builds index
Ref: #271620 (closed)
What does this MR do and why?
This MR drops our index_ci_builds_on_project_id_for_successfull_pages_deploy
which does not seem to be used according to Thanos.
Screenshots or screen recordings
Database
List of relations
Schema | Name | Type | Owner | Table | Size | Description
--------+------------------------------------------------------------+-------+---------+-----------+--------+-------------
public | index_ci_builds_on_project_id_for_successfull_pages_deploy | index | joe_292 | ci_builds | 827 MB |
(1 row)
Migrations up
➜ gitlab git:(master) ✗ rails db:migrate:main
ci: == 20220630085003 DropProjectSuccessfullPagesDeployIndexFromCiBuilds: migrating
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- indexes(:ci_builds)
ci: -> 0.0091s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0001s
ci: -- remove_index(:ci_builds, {:algorithm=>:concurrently, :name=>"index_ci_builds_on_project_id_for_successfull_pages_deploy"})
ci: -> 0.0021s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0002s
ci: == 20220630085003 DropProjectSuccessfullPagesDeployIndexFromCiBuilds: migrated (0.0159s)
➜ gitlab git:(master) ✗ rails db:migrate:main
main: == 20220630085003 DropProjectSuccessfullPagesDeployIndexFromCiBuilds: migrating
main: -- transaction_open?()
main: -> 0.0000s
main: -- indexes(:ci_builds)
main: -> 0.0094s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0002s
main: -- remove_index(:ci_builds, {:algorithm=>:concurrently, :name=>"index_ci_builds_on_project_id_for_successfull_pages_deploy"})
main: -> 0.0042s
main: -- execute("RESET statement_timeout")
main: -> 0.0003s
main: == 20220630085003 DropProjectSuccessfullPagesDeployIndexFromCiBuilds: migrated (0.0200s)
Migrations down
➜ gitlab git:(master) ✗ rails db:rollback:ci
ci: == 20220630085003 DropProjectSuccessfullPagesDeployIndexFromCiBuilds: reverting
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- index_exists?(:ci_builds, :project_id, {:where=>"(((type)::text = 'GenericCommitStatus'::text) AND ((stage)::text = 'deploy'::text) AND ((name)::text = 'pages:deploy'::text) AND ((status)::text = 'success'::text))", :name=>"index_ci_builds_on_project_id_for_successfull_pages_deploy", :algorithm=>:concurrently})
ci: -> 0.0084s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0002s
ci: -- add_index(:ci_builds, :project_id, {:where=>"(((type)::text = 'GenericCommitStatus'::text) AND ((stage)::text = 'deploy'::text) AND ((name)::text = 'pages:deploy'::text) AND ((status)::text = 'success'::text))", :name=>"index_ci_builds_on_project_id_for_successfull_pages_deploy", :algorithm=>:concurrently})
ci: -> 0.0033s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0002s
ci: == 20220630085003 DropProjectSuccessfullPagesDeployIndexFromCiBuilds: reverted (0.0163s)
➜ gitlab git:(master) ✗ rails db:rollback:main
main: == 20220630085003 DropProjectSuccessfullPagesDeployIndexFromCiBuilds: reverting
main: -- transaction_open?()
main: -> 0.0000s
main: -- index_exists?(:ci_builds, :project_id, {:where=>"(((type)::text = 'GenericCommitStatus'::text) AND ((stage)::text = 'deploy'::text) AND ((name)::text = 'pages:deploy'::text) AND ((status)::text = 'success'::text))", :name=>"index_ci_builds_on_project_id_for_successfull_pages_deploy", :algorithm=>:concurrently})
main: -> 0.0083s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0001s
main: -- add_index(:ci_builds, :project_id, {:where=>"(((type)::text = 'GenericCommitStatus'::text) AND ((stage)::text = 'deploy'::text) AND ((name)::text = 'pages:deploy'::text) AND ((status)::text = 'success'::text))", :name=>"index_ci_builds_on_project_id_for_successfull_pages_deploy", :algorithm=>:concurrently})
main: -> 0.0028s
main: -- execute("RESET statement_timeout")
main: -> 0.0001s
main: == 20220630085003 DropProjectSuccessfullPagesDeployIndexFromCiBuilds: reverted (0.0151s)
Impact
Reduced ci_builds
size by 0.8GB
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
assigned to @morefice
changed milestone to %Backlog
- Resolved by Marius Bobin
@mbobin could you review this MR please?
requested review from @mbobin
Suggested Reviewers (beta)
The individuals below may be good candidates to participate in the review based on various factors.
You can use slash commands in comments to quickly assign
/assign_reviewer @user1
.Suggested Reviewers @rspeicher
,@mayra-cabrera
,@psimyn
,@jivanvl
,@ahegyi
If you do not believe these suggestions are useful, please apply the label Bad Suggested Reviewer. You can also provide feedback for this feature on this issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/357923
.Automatically generated by Suggested Reviewers Bot - an experimental ML-based recommendation engine created by ~"group::applied ml".
Started database testing pipeline (limited access). This comment will be updated once the pipeline has finished running.
1 Warning You've made some app changes, but didn't add any tests.
That's OK as long as you're refactoring existing code,
but please consider adding any of the maintenancepipelines, maintenanceworkflow, documentation, QA labels.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 database Dylan Griffith ( @DylanGriffith
) (UTC+10, 8 hours ahead of@morefice
)Alex Ives ( @alexives
) (UTC-5, 7 hours behind@morefice
)~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
Dangerchanged milestone to %15.2
added grouppipeline security label and removed grouppipeline execution label
mentioned in issue #271620 (closed)
removed [deprecated] Accepting merge requests label
mentioned in issue #295478
- Resolved by Vladimir Shushlin
@krasio could you confirm that this index is no longer used?
added databasereviewed label
@mbobin
, 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:
Thanks for your review
mentioned in issue #366333 (closed)
mentioned in issue #332953 (closed)
@morefice This looks good! Are we going to drop the index for GitLab.com with a CR? If yes, let's mark this one as Draft meanwhile. Please ping me when it's done so that we can go ahead and merge this one.
removed review request for @krasio
mentioned in issue gitlab-com/gl-infra/production#7372 (closed)
Thanks for your review
Are we going to drop the index for GitLab.com with a CR?
Yes I think this is the safest path to remove this index, just opened gitlab-com/gl-infra/production#7372 (closed) to take care of it and marked this MR as draft.
mentioned in merge request !85196 (merged)
mentioned in issue gitlab-com/gl-infra/production#7415 (closed)
Our index has been removed with a
CR
as you can see in gitlab-com/gl-infra/production#7372 (comment 1025300029).This MR will be a simple
no-op
operation and it's now ready to be merged.Thanks @morefice . LGTM from DB side! MWPS is set.
Edited by João Alexandre Cunhaadded databaseapproved label and removed databasereviewed label
requested review from @Alexand
enabled an automatic merge when the pipeline for 910f8661 succeeds
mentioned in commit d104ed81
added workflowstaging-canary label
added workflowcanary label and removed workflowstaging-canary label