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
f7bdab1b
Commit
f7bdab1b
authored
Dec 01, 2021
by
Aleksei Lipniagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Multistore FF for empty DB - another way
parent
71344985
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
config/initializers/active_record_transaction_observer.rb
config/initializers/active_record_transaction_observer.rb
+2
-2
lib/gitlab/redis/multi_store.rb
lib/gitlab/redis/multi_store.rb
+6
-2
No files found.
config/initializers/active_record_transaction_observer.rb
View file @
f7bdab1b
# frozen_string_literal: true
return
unless
Gitlab
.
com?
||
Gitlab
.
dev_or_test_env?
def
feature_flags_available?
# When the DBMS is not available, an exception (e.g. PG::ConnectionBad) is raised
active_db_connection
=
ActiveRecord
::
Base
.
connection
.
active?
rescue
false
...
...
@@ -11,6 +9,8 @@ rescue ActiveRecord::NoDatabaseError
false
end
return
unless
Gitlab
.
com?
||
Gitlab
.
dev_or_test_env?
Gitlab
::
Application
.
configure
do
if
feature_flags_available?
&&
::
Feature
.
enabled?
(
:active_record_transactions_tracking
,
type: :ops
,
default_enabled: :yaml
)
Gitlab
::
Database
::
Transaction
::
Observer
.
register!
...
...
lib/gitlab/redis/multi_store.rb
View file @
f7bdab1b
...
...
@@ -95,11 +95,15 @@ module Gitlab
end
def
use_primary_and_secondary_stores?
Feature
.
enabled?
(
"use_primary_and_secondary_stores_for_
#{
instance_name
.
underscore
}
"
,
default_enabled: :yaml
)
&&
!
same_redis_store?
feature_flags_available?
&&
Feature
.
enabled?
(
"use_primary_and_secondary_stores_for_
#{
instance_name
.
underscore
}
"
,
default_enabled: :yaml
)
&&
!
same_redis_store?
end
def
use_primary_store_as_default?
Feature
.
enabled?
(
"use_primary_store_as_default_for_
#{
instance_name
.
underscore
}
"
,
default_enabled: :yaml
)
&&
!
same_redis_store?
feature_flags_available?
&&
Feature
.
enabled?
(
"use_primary_store_as_default_for_
#{
instance_name
.
underscore
}
"
,
default_enabled: :yaml
)
&&
!
same_redis_store?
end
private
...
...
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