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
8d2dc120
Commit
8d2dc120
authored
Mar 21, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for streaming replication in GeoNode status
Part of #1929
parent
c80b852b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
lib/gitlab/geo/health_check.rb
lib/gitlab/geo/health_check.rb
+9
-0
No files found.
lib/gitlab/geo/health_check.rb
View file @
8d2dc120
...
...
@@ -4,6 +4,7 @@ module Gitlab
def
self
.
perform_checks
return
''
unless
Gitlab
::
Geo
.
secondary?
return
'The Geo database configuration file is missing.'
unless
Gitlab
::
Geo
.
configured?
return
'The Geo node has a database that is not configured for streaming replication with the primary node.'
unless
self
.
database_secondary?
database_version
=
self
.
get_database_version
.
to_i
migration_version
=
self
.
get_migration_version
.
to_i
...
...
@@ -48,6 +49,14 @@ module Gitlab
latest_migration
end
def
self
.
database_secondary?
raise
NotImplemented
unless
Gitlab
::
Database
.
postgresql?
ActiveRecord
::
Base
.
connection
.
execute
(
'SELECT pg_is_in_recovery()'
)
.
first
.
fetch
(
'pg_is_in_recovery'
)
==
't'
end
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