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
f1e2fdb0
Commit
f1e2fdb0
authored
Jan 16, 2018
by
Toon Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable FDW for Geo by default
If the database is set up for that.
parent
67c5debf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
config/database_geo.yml.postgresql
config/database_geo.yml.postgresql
+4
-4
doc/gitlab-geo/database.md
doc/gitlab-geo/database.md
+1
-1
doc/gitlab-geo/database_source.md
doc/gitlab-geo/database_source.md
+1
-1
ee/lib/gitlab/geo.rb
ee/lib/gitlab/geo.rb
+3
-3
spec/ee/spec/lib/gitlab/geo_spec.rb
spec/ee/spec/lib/gitlab/geo_spec.rb
+3
-3
No files found.
config/database_geo.yml.postgresql
View file @
f1e2fdb0
...
...
@@ -9,7 +9,7 @@ production:
username: git
password: "secure password"
host: localhost
# fdw: fals
e
fdw: tru
e
#
# Development specific
...
...
@@ -22,7 +22,7 @@ development:
username: postgres
password: "secure password"
host: localhost
# fdw: fals
e
fdw: tru
e
#
# Staging specific
...
...
@@ -35,7 +35,7 @@ staging:
username: git
password: "secure password"
host: localhost
# fdw: fals
e
fdw: tru
e
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
...
...
@@ -48,4 +48,4 @@ test: &test
username: postgres
password:
host: localhost
# fdw: fals
e
fdw: tru
e
doc/gitlab-geo/database.md
View file @
f1e2fdb0
...
...
@@ -304,7 +304,7 @@ because we have not yet configured the secondary server. This is the next step.
connections. The certificate can only be replicated by someone with access
to the private key, which is **only** present on the primary node.
1.
Optional:
Configure PostreSQL to enable FDW support
1.
Configure PostreSQL to enable FDW support
This step is similar to how we configured the primary instance.
We need to enable this, to enable FDW support, even if using a single node.
...
...
doc/gitlab-geo/database_source.md
View file @
f1e2fdb0
...
...
@@ -263,7 +263,7 @@ node.
bundle exec rake geo:db:migrate
```
1.
Optional:
Configure the
[
PostgreSQL FDW
][
FDW
]
connection and credentials:
1.
Configure the
[
PostgreSQL FDW
][
FDW
]
connection and credentials:
Save the script below in a file, ex. `/tmp/geo_fdw.sh` and modify the connection
params to match your environment.
...
...
ee/lib/gitlab/geo.rb
View file @
f1e2fdb0
...
...
@@ -76,9 +76,9 @@ module Gitlab
def
self
.
fdw?
return
false
unless
self
.
fdw_capable?
# FDW is
disabled by default: https://gitlab.com/gitlab-org/gitlab-ee/issues/4558
# Enable it by setting `fdw: true` in config/database_geo.yml
Rails
.
configuration
.
geo_database
.
fetch
(
'fdw'
,
false
)
# FDW is
enabled by default, disable it by setting `fdw: false` in config/database_geo.yml
value
=
Rails
.
configuration
.
geo_database
[
'fdw'
]
value
.
nil?
?
true
:
value
end
def
self
.
fdw_table
(
table_name
)
...
...
spec/ee/spec/lib/gitlab/geo_spec.rb
View file @
f1e2fdb0
...
...
@@ -46,15 +46,15 @@ describe Gitlab::Geo, :geo do
expect
(
described_class
.
fdw?
).
to
be_falsey
end
context
'fdw capable'
do
context
'
with
fdw capable'
do
before
do
allow
(
described_class
).
to
receive
(
:fdw_capable?
).
and_return
(
true
)
end
it
'returns
fals
e by default'
do
it
'returns
tru
e by default'
do
allow
(
Rails
.
configuration
).
to
receive
(
:geo_database
).
and_return
(
'fdw'
=>
nil
)
expect
(
described_class
.
fdw?
).
to
be_
false
y
expect
(
described_class
.
fdw?
).
to
be_
truth
y
end
it
'returns false if configured in `config/database_geo.yml`'
do
...
...
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