[FF] ci_bulk_insert_pipeline_records
Summary
This issue is to roll out the bulk insert feature for pipeline records on production, that is currently behind the ci_bulk_insert_pipeline_records feature flag.
Related MR: !224483 (merged) Closes: #588748
This feature implements bulk insert for pipeline records to fix long-running database transactions during MR pipeline creation.
Owners
- Most appropriate Slack channel to reach out to:
#g_pipeline-authoring - Best individual to reach out to: @lauraXD
Expectations
What are we expecting to happen?
This feature flag gates the bulk insert implementation for pipeline creation, which:
- Reduces database round trips by bulk inserting stages, builds, execution configs, job definitions, build needs, and job sources
- Reduces transaction duration from 10+ minutes to seconds
- Eliminates "idle in transaction" issues causing production incidents
Rollout Steps
Note: Please make sure to run the chatops commands in the Slack channel that gets impacted by the command.
Rollout on non-production environments
master and has been deployed to non-production environments with /chatops gitlab run auto_deploy status <merge-commit-of-your-feature>
- Enable the feature globally on non-production environments with
/chatops gitlab run feature set ci_bulk_insert_pipeline_records true --dev --pre --staging --staging-ref
Specific rollout on production
For visibility, all /chatops commands that target production must be executed in the #production Slack channel and cross-posted (with the command results) to the responsible team's Slack channel.
-
Ensure that the feature MRs have been deployed to both production and canary with
/chatops gitlab run auto_deploy status <merge-commit-of-your-feature>Depending on the type of actor you are using, pick one of these options:
-
/chatops gitlab run feature set --namespace=lauraXD ci_bulk_insert_pipeline_records true -
For project-actor:
/chatops gitlab run feature set --project=gitlab-org/gitlab,gitlab-org/gitlab-foss,gitlab-com/www-gitlab-com ci_bulk_insert_pipeline_records true -
Verify that the feature works for the specific actors.
Preparation before global rollout
-
Set a milestone to this rollout issue to signal for enabling and removing the feature flag when it is stable.
-
Ensure that you or a representative in development can be available for at least 2 hours after feature flag updates in production. If a different developer will be covering, or an exception is needed, please inform the oncall SRE by using the
@sre-oncallSlack alias. -
Incrementally roll out the feature on production.
-
/chatops gitlab run feature set ci_bulk_insert_pipeline_records 15 --actors. -
/chatops gitlab run feature set ci_bulk_insert_pipeline_records 30 --actors. -
/chatops gitlab run feature set ci_bulk_insert_pipeline_records 50 --actors. -
/chatops gitlab run feature set ci_bulk_insert_pipeline_records 75 --actors. -
/chatops gitlab run feature set ci_bulk_insert_pipeline_records true
-
-
Between every step wait for at least 15 minutes and monitor the appropriate graphs on https://dashboards.gitlab.net.
-
After the feature has been 100% enabled, wait for at least one day before releasing the feature.
Release the feature
You can either create a follow-up issue for Feature Flag Cleanup or use the checklist below in this same issue.
- Create a merge request to remove the
ci_bulk_insert_pipeline_recordsfeature flag. Ask for review/approval/merge as usual. - Ensure that the cleanup MR has been included in the release package. If the merge request was deployed before the monthly release was tagged, the feature can be officially announced in a release blog post:
/chatops gitlab run release check <merge-request-url> <milestone> - Once the cleanup MR has been deployed to production, clean up the feature flag from all environments by running these chatops command in
#productionchannel:/chatops gitlab run feature delete ci_bulk_insert_pipeline_records --dev --pre --staging --staging-ref --production
Rollback Steps
- This feature can be disabled on production by running the following Chatops command:
/chatops gitlab run feature set ci_bulk_insert_pipeline_records false
- Disable the feature flag on non-production environments:
/chatops gitlab run feature set ci_bulk_insert_pipeline_records false --dev --pre --staging --staging-ref
- Delete feature flag from all environments:
/chatops gitlab run feature delete ci_bulk_insert_pipeline_records --dev --pre --staging --staging-ref --production