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
20795aec
Commit
20795aec
authored
Mar 28, 2019
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo: Check for DB replication enabled and working
parent
5c2ec7af
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
5 deletions
+44
-5
ee/lib/system_check/geo/database_replication_enabled_check.rb
...ib/system_check/geo/database_replication_enabled_check.rb
+10
-4
ee/lib/system_check/geo/database_replication_working_check.rb
...ib/system_check/geo/database_replication_working_check.rb
+32
-0
ee/lib/system_check/rake_task/geo_task.rb
ee/lib/system_check/rake_task/geo_task.rb
+2
-1
No files found.
ee/lib/system_check/geo/database_replication_check.rb
→
ee/lib/system_check/geo/database_replication_
enabled_
check.rb
View file @
20795aec
...
...
@@ -2,8 +2,8 @@
module
SystemCheck
module
Geo
class
DatabaseReplicationCheck
<
SystemCheck
::
BaseCheck
set_name
'
Using database streaming replication
?'
class
DatabaseReplication
Enabled
Check
<
SystemCheck
::
BaseCheck
set_name
'
Database replication enabled
?'
set_skip_reason
'not a secondary node'
def
skip?
...
...
@@ -11,16 +11,22 @@ module SystemCheck
end
def
check?
Gitlab
::
Database
.
db_read_only
?
geo_health_check
.
replication_enabled
?
end
def
show_error
try_fixing_it
(
'Follow Geo setup instructions to configure primary and secondary nodes for
streaming
replication'
'Follow Geo setup instructions to configure primary and secondary nodes for replication'
)
for_more_information
(
'doc/gitlab-geo/database.md'
)
end
private
def
geo_health_check
@geo_health_check
||=
Gitlab
::
Geo
::
HealthCheck
.
new
end
end
end
end
ee/lib/system_check/geo/database_replication_working_check.rb
0 → 100644
View file @
20795aec
# frozen_string_literal: true
module
SystemCheck
module
Geo
class
DatabaseReplicationWorkingCheck
<
SystemCheck
::
BaseCheck
set_name
'Database replication working?'
set_skip_reason
'not a secondary node'
def
skip?
!
Gitlab
::
Geo
.
secondary?
end
def
check?
geo_health_check
.
replication_enabled?
&&
geo_health_check
.
replication_working?
end
def
show_error
try_fixing_it
(
'Follow Geo setup instructions to configure primary and secondary nodes for replication'
)
for_more_information
(
'doc/gitlab-geo/database.md'
)
end
private
def
geo_health_check
@geo_health_check
||=
Gitlab
::
Geo
::
HealthCheck
.
new
end
end
end
end
ee/lib/system_check/rake_task/geo_task.rb
View file @
20795aec
...
...
@@ -15,7 +15,8 @@ module SystemCheck
SystemCheck
::
Geo
::
LicenseCheck
,
SystemCheck
::
Geo
::
EnabledCheck
,
SystemCheck
::
Geo
::
GeoDatabaseConfiguredCheck
,
SystemCheck
::
Geo
::
DatabaseReplicationCheck
,
SystemCheck
::
Geo
::
DatabaseReplicationEnabledCheck
,
SystemCheck
::
Geo
::
DatabaseReplicationWorkingCheck
,
SystemCheck
::
Geo
::
FdwEnabledCheck
,
SystemCheck
::
Geo
::
FdwSchemaUpToDateCheck
,
SystemCheck
::
Geo
::
HttpConnectionCheck
,
...
...
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