Commit f2266867 authored by Pavel Shutsin's avatar Pavel Shutsin

Merge branch 'log_primary_host_offline' into 'master'

Log when primary host for DB load balancing is marked offline

See merge request gitlab-org/gitlab!73904
parents e9c593c3 9a13e3ee
...@@ -49,6 +49,11 @@ module Gitlab ...@@ -49,6 +49,11 @@ module Gitlab
end end
def offline! def offline!
::Gitlab::Database::LoadBalancing::Logger.warn(
event: :host_offline,
message: 'Marking primary host as offline'
)
nil nil
end end
......
...@@ -51,7 +51,11 @@ RSpec.describe Gitlab::Database::LoadBalancing::PrimaryHost do ...@@ -51,7 +51,11 @@ RSpec.describe Gitlab::Database::LoadBalancing::PrimaryHost do
end end
describe '#offline!' do describe '#offline!' do
it 'does nothing' do it 'logs the event but does nothing else' do
expect(Gitlab::Database::LoadBalancing::Logger).to receive(:warn)
.with(hash_including(event: :host_offline))
.and_call_original
expect(host.offline!).to be_nil expect(host.offline!).to be_nil
end end
end end
......
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