Commit d41405f5 authored by Stan Hu's avatar Stan Hu

Add warning to stop Puma and Sidekiq when restoring from backup

As we saw in https://gitlab.com/gitlab-org/gitlab/-/issues/36405, having
processes that can write to GitLab tables while restoring from a
database backup can cause duplicate rows be inserted and schema changes
to fail quietly. At the moment, we don't have a good story of restoring
a database backup in a single transaction, so we need to tell admins to
stop Puma and Sidekiq.
parent 4e12f87c
---
title: Add warning to stop Puma and Sidekiq when restoring from backup
merge_request: 40791
author:
type: other
...@@ -47,6 +47,11 @@ namespace :gitlab do ...@@ -47,6 +47,11 @@ namespace :gitlab do
begin begin
unless ENV['force'] == 'yes' unless ENV['force'] == 'yes'
warning = <<-MSG.strip_heredoc warning = <<-MSG.strip_heredoc
Be sure to stop Puma, Sidekiq, and any other process that
connects to the database before proceeding. For Omnibus
installs, see the following link for more information:
https://docs.gitlab.com/ee/raketasks/backup_restore.html#restore-for-omnibus-gitlab-installations
Before restoring the database, we will remove all existing Before restoring the database, we will remove all existing
tables to avoid future upgrade problems. Be aware that if you have tables to avoid future upgrade problems. Be aware that if you have
custom tables in the GitLab database these tables and all data will be custom tables in the GitLab database these tables and all data will be
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment