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
26679abb
Commit
26679abb
authored
Sep 02, 2019
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log if a host is offline due to replication lag
parent
98abc0a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
+26
-0
ee/changelogs/unreleased/load_balancing_log_lines.yml
ee/changelogs/unreleased/load_balancing_log_lines.yml
+5
-0
ee/lib/gitlab/database/load_balancing/host.rb
ee/lib/gitlab/database/load_balancing/host.rb
+7
-0
ee/spec/lib/gitlab/database/load_balancing/host_spec.rb
ee/spec/lib/gitlab/database/load_balancing/host_spec.rb
+14
-0
No files found.
ee/changelogs/unreleased/load_balancing_log_lines.yml
0 → 100644
View file @
26679abb
---
title
:
Improve DB load balancing log to log host offline due to replication lag
merge_request
:
15995
author
:
type
:
changed
ee/lib/gitlab/database/load_balancing/host.rb
View file @
26679abb
...
...
@@ -78,6 +78,13 @@ module Gitlab
db_host:
@host
,
db_port:
@port
)
else
LoadBalancing
::
Logger
.
warn
(
event: :host_offline
,
message:
'Host is offline after replica status check'
,
db_host:
@host
,
db_port:
@port
)
end
@online
...
...
ee/spec/lib/gitlab/database/load_balancing/host_spec.rb
View file @
26679abb
...
...
@@ -124,6 +124,20 @@ describe Gitlab::Database::LoadBalancing::Host do
expect
(
host
).
to
be_online
end
context
'and replica is not up to date'
do
before
do
expect
(
host
).
to
receive
(
:replica_is_up_to_date?
).
and_return
(
false
)
end
it
'marks the host offline'
do
expect
(
Gitlab
::
Database
::
LoadBalancing
::
Logger
).
to
receive
(
:warn
)
.
with
(
hash_including
(
event: :host_offline
))
.
and_call_original
expect
(
host
).
not_to
be_online
end
end
end
context
'when the replica is not online'
do
...
...
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