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
0fa65e87
Commit
0fa65e87
authored
Nov 25, 2021
by
nmilojevic1
Committed by
Nikola Milojevic
Dec 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove legacy wal location
parent
03838afb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
23 deletions
+1
-23
lib/gitlab/database/load_balancing/sidekiq_server_middleware.rb
...tlab/database/load_balancing/sidekiq_server_middleware.rb
+1
-10
spec/lib/gitlab/database/load_balancing/sidekiq_server_middleware_spec.rb
...database/load_balancing/sidekiq_server_middleware_spec.rb
+0
-13
No files found.
lib/gitlab/database/load_balancing/sidekiq_server_middleware.rb
View file @
0fa65e87
...
...
@@ -67,16 +67,7 @@ module Gitlab
end
def
get_wal_locations
(
job
)
job
[
'dedup_wal_locations'
]
||
job
[
'wal_locations'
]
||
legacy_wal_location
(
job
)
end
# Already scheduled jobs could still contain legacy database write location.
# TODO: remove this in the next iteration
# https://gitlab.com/gitlab-org/gitlab/-/issues/338213
def
legacy_wal_location
(
job
)
wal_location
=
job
[
'database_write_location'
]
||
job
[
'database_replica_location'
]
{
::
Gitlab
::
Database
::
MAIN_DATABASE_NAME
.
to_sym
=>
wal_location
}
if
wal_location
job
[
'dedup_wal_locations'
]
||
job
[
'wal_locations'
]
end
def
load_balancing_available?
(
worker_class
)
...
...
spec/lib/gitlab/database/load_balancing/sidekiq_server_middleware_spec.rb
View file @
0fa65e87
...
...
@@ -114,19 +114,6 @@ RSpec.describe Gitlab::Database::LoadBalancing::SidekiqServerMiddleware, :clean_
it_behaves_like
'replica is up to date'
,
'replica'
end
context
'when legacy wal location is set'
do
let
(
:job
)
{
{
'job_id'
=>
'a180b47c-3fd6-41b8-81e9-34da61c3400e'
,
'database_write_location'
=>
'0/D525E3A8'
}
}
before
do
allow
(
ActiveRecord
::
Base
.
load_balancer
)
.
to
receive
(
:select_up_to_date_host
)
.
with
(
'0/D525E3A8'
)
.
and_return
(
true
)
end
it_behaves_like
'replica is up to date'
,
'replica'
end
context
'when database location is not set'
do
let
(
:job
)
{
{
'job_id'
=>
'a180b47c-3fd6-41b8-81e9-34da61c3400e'
}
}
...
...
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