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
0ee180f7
Commit
0ee180f7
authored
Jan 22, 2018
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo: Improve replication status. Relying on pg_stat_wal_receiver
parent
62e04169
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
ee/lib/gitlab/geo/health_check.rb
ee/lib/gitlab/geo/health_check.rb
+13
-1
No files found.
ee/lib/gitlab/geo/health_check.rb
View file @
0ee180f7
...
...
@@ -7,7 +7,7 @@ module Gitlab
return
''
unless
Gitlab
::
Geo
.
secondary?
return
'The Geo database configuration file is missing.'
unless
Gitlab
::
Geo
.
geo_database_configured?
return
'The Geo node has a database that is not configured for streaming replication with the primary node.'
unless
self
.
database_secondary?
return
'The Geo node does not appear to be replicating data from the primary node.'
unless
self
.
db_replication_lag_seconds
.
present
?
return
'The Geo node does not appear to be replicating data from the primary node.'
unless
self
.
streaming_active
?
database_version
=
self
.
get_database_version
.
to_i
migration_version
=
self
.
get_migration_version
.
to_i
...
...
@@ -76,6 +76,18 @@ module Gitlab
lag
.
present?
?
lag
.
to_i
:
lag
end
def
self
.
streaming_active?
# Get a streaming status
# This only works for Postgresql 9.6 and greater
status
=
ActiveRecord
::
Base
.
connection
.
execute
(
'
SELECT * FROM pg_stat_wal_receiver;'
)
.
first
.
fetch
(
'status'
)
status
==
'streaming'
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