Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
P
production
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 122
    • Issues 122
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 1
    • Merge Requests 1
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.com
  • GitLab Infrastructure Team
  • production
  • Issues
  • #1851

Closed
Open
Opened Mar 27, 2020 by Ahmad Sherif@ahmadsherifMaintainer7 of 7 tasks completed7/7 tasks

Enable external merge request diff storage

Production Change - Criticality 2 C2

Related to infrastructure#7356 (closed)

Change Objective Describe the objective of the change
Change Type ConfigurationChange
Services Impacted ServiceWeb ServiceSidekiq ServiceAPI ServiceGit
Change Team Members @ahmadsherif
Change Criticality C2
Change Reviewer A colleague who will review the change
Tested in staging It has been running in staging for a quite a while infrastructure#8184 (closed)
Dry-run output
Due Date 2020-03-27
Time tracking 1 hour

Detailed steps for the change

  1. Stop Chef on the front-end nodes that are running Puma
    • knife ssh 'roles:gprd-base-fe AND omnibus-gitlab_gitlab_rb_puma_enable:true' 'sudo systemctl stop chef-client'
  2. Stop Chef on the Sidekiq nodes
    • knife ssh 'roles:gprd-base-be-sidekiq' 'sudo systemctl stop chef-client'
  3. Merge and apply https://ops.gitlab.net/gitlab-cookbooks/chef-repo/-/merge_requests/2982
  4. Node by node (4 at a time in parallel for efficiency), drain from haproxy, run/enable chef, and undrain:
    ./bin/set-server-state gprd drain NODE
    ssh NODE "sudo chef-client"
    ./bin/set-server-state gprd ready NODE
  5. Converge the Sidekiq nodes
    • knife ssh -C3 'roles:gprd-base-be-sidekiq' 'sudo chef-client'

Monitor

  1. Sentry for any diff-related errors https://sentry.gitlab.net/gitlab/gitlabcom/
  2. Triage dashboard for an overview of any blips https://dashboards.gitlab.net/d/RZmbBr7mk/gitlab-triage?orgId=1&refresh=30s

Rollback steps

  1. Revert and apply https://ops.gitlab.net/gitlab-cookbooks/chef-repo/-/merge_requests/2982
  2. Converge Chef

Migrate the files back to the database

  1. Compile a list of migrated diff files
    • There's no index that can be used to find the migrated records, so the following query should be run in non-production database (e.g. archive-replica).
    • MergeRequestDiff.where(stored_externally: true).pluck(:id)
  2. Transfer the list of IDs to a console node, run something like:
    • ids_list.with_groups_of(100) { |ids| MergeRequestDiff.find(ids).each(&:migrate_files_to_database!) }

Changes checklist

  • Detailed steps and rollback steps have been filled prior to commencing work
  • Person on-call has been informed prior to change being rolled out
Edited Mar 27, 2020 by Ahmad Sherif
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
Nov 24, 2020
Due date
Nov 24, 2020
Reference: gitlab-com/gl-infra/production#1851