Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2209afc5
Commit
2209afc5
authored
Jun 27, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
7794cc97
5c4d0dc6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
app/models/postgresql/replication_slot.rb
app/models/postgresql/replication_slot.rb
+1
-1
changelogs/unreleased/sh-handle-nil-replication-lag.yml
changelogs/unreleased/sh-handle-nil-replication-lag.yml
+5
-0
spec/models/postgresql/replication_slot_spec.rb
spec/models/postgresql/replication_slot_spec.rb
+8
-0
No files found.
app/models/postgresql/replication_slot.rb
View file @
2209afc5
...
...
@@ -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
.
co
mpact
.
co
unt
{
|
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
...
...
changelogs/unreleased/sh-handle-nil-replication-lag.yml
0 → 100644
View file @
2209afc5
---
title
:
Fix background migrations failing with unused replication slot
merge_request
:
30042
author
:
type
:
fixed
spec/models/postgresql/replication_slot_spec.rb
View file @
2209afc5
...
...
@@ -47,5 +47,13 @@ describe Postgresql::ReplicationSlot, :postgresql do
expect
(
described_class
.
lag_too_great?
).
to
eq
(
false
)
end
it
'returns false when there is a nil replication lag'
do
expect
(
described_class
)
.
to
receive
(
:pluck
)
.
and_return
([
0
.
megabytes
,
nil
])
expect
(
described_class
.
lag_too_great?
).
to
eq
(
false
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment