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
8ef028f2
Commit
8ef028f2
authored
Jan 29, 2020
by
Douglas Barbosa Alexandre
Committed by
Stan Hu
Jan 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix initialization order issue with Geo database
This caused the wrong Sidekiq pool size value for Geo secondaries.
parent
e8e2ea9d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
12 deletions
+19
-12
config/initializers/database_config.rb
config/initializers/database_config.rb
+10
-0
config/initializers/geo.rb
config/initializers/geo.rb
+4
-12
ee/changelogs/unreleased/199672-geo-initialization-order-issue-with-geo-database.yml
...9672-geo-initialization-order-issue-with-geo-database.yml
+5
-0
No files found.
config/initializers/database_config.rb
View file @
8ef028f2
...
@@ -10,6 +10,16 @@ def log_pool_size(db, previous_pool_size, current_pool_size)
...
@@ -10,6 +10,16 @@ def log_pool_size(db, previous_pool_size, current_pool_size)
Gitlab
::
AppLogger
.
debug
(
log_message
.
join
(
' '
))
Gitlab
::
AppLogger
.
debug
(
log_message
.
join
(
' '
))
end
end
Gitlab
.
ee
do
# We need to initialize the Geo database before
# setting the Geo DB connection pool size.
if
File
.
exist?
(
Rails
.
root
.
join
(
'config/database_geo.yml'
))
Rails
.
application
.
configure
do
config
.
geo_database
=
config_for
(
:database_geo
)
end
end
end
# When running on multi-threaded runtimes like Puma or Sidekiq,
# When running on multi-threaded runtimes like Puma or Sidekiq,
# set the number of threads per process as the minimum DB connection pool size.
# set the number of threads per process as the minimum DB connection pool size.
# This is to avoid connectivity issues as was documented here:
# This is to avoid connectivity issues as was documented here:
...
...
config/initializers/geo.rb
View file @
8ef028f2
# frozen_string_literal: true
# frozen_string_literal: true
Gitlab
.
ee
do
Gitlab
.
ee
do
if
File
.
exist?
(
Rails
.
root
.
join
(
'config/database_geo.yml'
))
if
Gitlab
::
Geo
.
connected?
&&
Gitlab
::
Geo
.
primary?
Rails
.
application
.
configure
do
Gitlab
::
Geo
.
current_node
&
.
update_clone_url!
config
.
geo_database
=
config_for
(
:database_geo
)
end
end
begin
if
Gitlab
::
Geo
.
connected?
&&
Gitlab
::
Geo
.
primary?
Gitlab
::
Geo
.
current_node
&
.
update_clone_url!
end
rescue
=>
e
warn
"WARNING: Unable to check/update clone_url_prefix for Geo:
#{
e
}
"
end
end
rescue
=>
e
warn
"WARNING: Unable to check/update clone_url_prefix for Geo:
#{
e
}
"
end
end
ee/changelogs/unreleased/199672-geo-initialization-order-issue-with-geo-database.yml
0 → 100644
View file @
8ef028f2
---
title
:
Fix DB connection pool size for Geo database
merge_request
:
24021
author
:
type
:
fixed
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