diff options
author | Andreas Brandl <abrandl@gitlab.com> | 2019-06-27 15:36:00 +0300 |
---|---|---|
committer | Andreas Brandl <abrandl@gitlab.com> | 2019-06-27 15:36:00 +0300 |
commit | 5c4d0dc69be52c7cb2a24ee7fe13c96c621994ea (patch) | |
tree | 4c56437e1671025a52fd9d0e09a0cbc4dca75004 /app | |
parent | 47089be063b754b3cc76c47bda7d26876889e5de (diff) | |
parent | d092ed178fe490769f60df2e1ce8a667b812fc79 (diff) |
Merge branch 'sh-handle-nil-replication-lag' into 'master'
Fix background migrations failing with unused replication slot
Closes #63666
See merge request gitlab-org/gitlab-ce!30042
Diffstat (limited to 'app')
-rw-r--r-- | app/models/postgresql/replication_slot.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/postgresql/replication_slot.rb b/app/models/postgresql/replication_slot.rb index 74ccf23cf69..7a123deb719 100644 --- a/app/models/postgresql/replication_slot.rb +++ b/app/models/postgresql/replication_slot.rb @@ -28,7 +28,7 @@ module Postgresql # We force the use of a transaction here so the query always goes to the # primary, even when using the EE DB load balancer. sizes = transaction { pluck(lag_function) } - too_great = sizes.count { |size| size >= max } + too_great = sizes.compact.count { |size| size >= max } # If too many replicas are falling behind too much, the availability of a # GitLab instance might suffer. To prevent this from happening we require |