Commit 68327a42 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Added extra checks for secondary nodes

parent 031aab53
module SystemCheck
module Geo
class DatabaseReplicationCheck < SystemCheck::BaseCheck
set_name 'Using database streaming replication?'
set_skip_reason 'not a secondary node'
def skip?
!Gitlab::Geo.secondary?
end
def check?
ActiveRecord::Base.connection.execute('SELECT pg_is_in_recovery()').first.fetch('pg_is_in_recovery') == 't'
end
def show_error
try_fixing_it(
'Follow Geo setup instructions to configure primary and secondary nodes for streaming replication'
)
for_more_information('doc/gitlab-geo/database.md')
end
end
end
end
module SystemCheck
module Geo
class GeoDatabaseConfiguredCheck < SystemCheck::BaseCheck
set_name 'GitLab Geo secondary database is correctly configured'
set_skip_reason 'not a secondary node'
def skip?
!Gitlab::Geo.secondary?
end
def check?
Gitlab::Geo.geo_database_configured?
end
def show_error
try_fixing_it(
'Check if you enabled the `geo_secondary_role` or `geo_postgresql` in the gitlab.rb config file.'
)
for_more_information('doc/gitlab-geo/database.md')
end
end
end
end
......@@ -549,6 +549,8 @@ namespace :gitlab do
checks = [
SystemCheck::Geo::LicenseCheck,
SystemCheck::Geo::EnabledCheck,
SystemCheck::Geo::GeoDatabaseConfiguredCheck,
SystemCheck::Geo::DatabaseReplicationCheck,
SystemCheck::Geo::HttpConnectionCheck
]
......
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