summaryrefslogtreecommitdiff
path: root/lib/backup
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-03 20:34:32 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-03 20:34:32 +0000
commita47bbf7ce093a46ce83cd66da5d9ce3150324860 (patch)
tree36ee17fd93f50c371dba3e8829283fa4bfb98f99 /lib/backup
parent4bafeeda963a11ce4004bbe35a4ff2606bc4d10a (diff)
downloadgitlab-ce-a47bbf7ce093a46ce83cd66da5d9ce3150324860.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-ee
Diffstat (limited to 'lib/backup')
-rw-r--r--lib/backup/database.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/backup/database.rb b/lib/backup/database.rb
index 851445f703d..0429d9496d6 100644
--- a/lib/backup/database.rb
+++ b/lib/backup/database.rb
@@ -140,7 +140,14 @@ module Backup
'sslcrl' => 'PGSSLCRL',
'sslcompression' => 'PGSSLCOMPRESSION'
}
- args.each { |opt, arg| ENV[arg] = config[opt].to_s if config[opt] }
+ args.each do |opt, arg|
+ # This enables the use of different PostgreSQL settings in
+ # case PgBouncer is used. PgBouncer clears the search path,
+ # which wreaks havoc on Rails if connections are reused.
+ override = "GITLAB_BACKUP_#{arg}"
+ val = ENV[override].presence || config[opt].to_s.presence
+ ENV[arg] = val if val
+ end
end
def report_success(success)