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
357fb56c
Commit
357fb56c
authored
Jun 07, 2021
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'jv-redis-trace-chunks-store' into 'master'"
This reverts merge request !62767
parent
a61676b6
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
4 additions
and
207 deletions
+4
-207
.gitignore
.gitignore
+0
-1
app/controllers/admin/dashboard_controller.rb
app/controllers/admin/dashboard_controller.rb
+1
-1
app/controllers/health_controller.rb
app/controllers/health_controller.rb
+0
-1
config/README.md
config/README.md
+0
-31
config/initializers/7_redis.rb
config/initializers/7_redis.rb
+0
-1
config/redis.trace_chunks.yml.example
config/redis.trace_chunks.yml.example
+0
-38
lib/gitlab/health_checks/redis/redis_check.rb
lib/gitlab/health_checks/redis/redis_check.rb
+1
-2
lib/gitlab/health_checks/redis/trace_chunks_check.rb
lib/gitlab/health_checks/redis/trace_chunks_check.rb
+0
-35
lib/gitlab/instrumentation/redis.rb
lib/gitlab/instrumentation/redis.rb
+1
-2
lib/gitlab/redis/trace_chunks.rb
lib/gitlab/redis/trace_chunks.rb
+0
-12
lib/gitlab/redis/wrapper.rb
lib/gitlab/redis/wrapper.rb
+0
-15
scripts/prepare_build.sh
scripts/prepare_build.sh
+0
-3
spec/lib/gitlab/health_checks/redis/trace_chunks_check_spec.rb
...lib/gitlab/health_checks/redis/trace_chunks_check_spec.rb
+0
-8
spec/lib/gitlab/instrumentation/redis_spec.rb
spec/lib/gitlab/instrumentation/redis_spec.rb
+1
-2
spec/lib/gitlab/redis/trace_chunks_spec.rb
spec/lib/gitlab/redis/trace_chunks_spec.rb
+0
-55
No files found.
.gitignore
View file @
357fb56c
...
...
@@ -42,7 +42,6 @@ eslint-report.html
/config/redis.cache.yml
/config/redis.queues.yml
/config/redis.shared_state.yml
/config/redis.trace_chunks.yml
/config/unicorn.rb
/config/puma.rb
/config/puma_actioncable.rb
...
...
app/controllers/admin/dashboard_controller.rb
View file @
357fb56c
...
...
@@ -15,7 +15,7 @@ class Admin::DashboardController < Admin::ApplicationController
@groups
=
Group
.
order_id_desc
.
with_route
.
limit
(
10
)
@notices
=
Gitlab
::
ConfigChecker
::
PumaRuggedChecker
.
check
@notices
+=
Gitlab
::
ConfigChecker
::
ExternalDatabaseChecker
.
check
@redis_versions
=
[
Gitlab
::
Redis
::
Queues
,
Gitlab
::
Redis
::
SharedState
,
Gitlab
::
Redis
::
Cache
,
Gitlab
::
Redis
::
TraceChunks
].
map
(
&
:version
).
uniq
@redis_versions
=
[
Gitlab
::
Redis
::
Queues
,
Gitlab
::
Redis
::
SharedState
,
Gitlab
::
Redis
::
Cache
].
map
(
&
:version
).
uniq
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
app/controllers/health_controller.rb
View file @
357fb56c
...
...
@@ -15,7 +15,6 @@ class HealthController < ActionController::Base
Gitlab
::
HealthChecks
::
Redis
::
CacheCheck
,
Gitlab
::
HealthChecks
::
Redis
::
QueuesCheck
,
Gitlab
::
HealthChecks
::
Redis
::
SharedStateCheck
,
Gitlab
::
HealthChecks
::
Redis
::
TraceChunksCheck
,
Gitlab
::
HealthChecks
::
GitalyCheck
].
freeze
...
...
config/README.md
View file @
357fb56c
...
...
@@ -147,34 +147,3 @@ searched):
3.
the configuration file pointed to by the
`GITLAB_REDIS_CONFIG_FILE`
environment variable
4.
the configuration file
`resque.yml`
## redis.trace_chunks.yml
If configured,
`redis.trace_chunks.yml`
overrides the
`resque.yml`
settings to configure the Redis database instance
used for clients of
`::Gitlab::Redis::TraceChunks`
which stores CI trace chunks.
Settings here can be overridden by the environment variable
`GITLAB_REDIS_TRACE_CHUNKS_CONFIG_FILE`
which provides
an alternate location for configuration settings.
The order of precedence for the URL used to connect to the Redis instance
used for
`trace_chunks`
is:
1.
URL from a configuration file pointed to by the
`GITLAB_REDIS_TRACE_CHUNKS_CONFIG_FILE`
environment variable
2.
URL from
`redis.trace_chunks.yml`
3.
URL from a configuration file pointed to by the
`GITLAB_REDIS_CONFIG_FILE`
environment variable
4.
URL from
`resque.yml`
5.
`redis://localhost:6383`
The order of precedence for all other configuration settings for
`trace_chunks`
are selected from only the first of the following files found (if a setting
is not provided in an earlier file, the remainder of the files are not
searched):
1.
the configuration file pointed to by the
`GITLAB_REDIS_TRACE_CHUNKS_CONFIG_FILE`
environment variable
2.
the configuration file
`redis.trace_chunks.yml`
3.
the configuration file pointed to by the
`GITLAB_REDIS_CONFIG_FILE`
environment variable
4.
the configuration file
`resque.yml`
config/initializers/7_redis.rb
View file @
357fb56c
...
...
@@ -8,4 +8,3 @@
Gitlab
::
Redis
::
Cache
.
with
{
nil
}
Gitlab
::
Redis
::
Queues
.
with
{
nil
}
Gitlab
::
Redis
::
SharedState
.
with
{
nil
}
Gitlab
::
Redis
::
TraceChunks
.
with
{
nil
}
config/redis.trace_chunks.yml.example
deleted
100644 → 0
View file @
a61676b6
# If you change this file in a merge request, please also create
# a merge request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
#
development:
url: redis://localhost:6379/13
#
# url: redis://localhost:6382
# sentinels:
# -
# host: localhost
# port: 26382 # point to sentinel, not to redis port
# -
# host: replica2
# port: 26382 # point to sentinel, not to redis port
test:
url: redis://localhost:6379/13
#
# url: redis://localhost:6382
production:
# Redis (single instance)
url: unix:/var/run/redis/redis.trace_chunks.sock
##
# Redis + Sentinel (for HA)
#
# Please read instructions carefully before using it as you may lose data:
# http://redis.io/topics/sentinel
#
# You must specify a list of a few sentinels that will handle client connection
# please read here for more information: https://docs.gitlab.com/ee/administration/redis/index.html
##
# url: redis://master:6382
# sentinels:
# -
# host: replica1
# port: 26382 # point to sentinel, not to redis port
# -
# host: replica2
# port: 26382 # point to sentinel, not to redis port
lib/gitlab/health_checks/redis/redis_check.rb
View file @
357fb56c
...
...
@@ -20,8 +20,7 @@ module Gitlab
def
check
::
Gitlab
::
HealthChecks
::
Redis
::
CacheCheck
.
check_up
&&
::
Gitlab
::
HealthChecks
::
Redis
::
QueuesCheck
.
check_up
&&
::
Gitlab
::
HealthChecks
::
Redis
::
SharedStateCheck
.
check_up
&&
::
Gitlab
::
HealthChecks
::
Redis
::
TraceChunksCheck
.
check_up
::
Gitlab
::
HealthChecks
::
Redis
::
SharedStateCheck
.
check_up
end
end
end
...
...
lib/gitlab/health_checks/redis/trace_chunks_check.rb
deleted
100644 → 0
View file @
a61676b6
# frozen_string_literal: true
module
Gitlab
module
HealthChecks
module
Redis
class
TraceChunksCheck
extend
SimpleAbstractCheck
class
<<
self
def
check_up
check
end
private
def
metric_prefix
'redis_trace_chunks_ping'
end
def
successful?
(
result
)
result
==
'PONG'
end
# rubocop: disable CodeReuse/ActiveRecord
def
check
catch_timeout
10
.
seconds
do
Gitlab
::
Redis
::
TraceChunks
.
with
(
&
:ping
)
end
end
# rubocop: enable CodeReuse/ActiveRecord
end
end
end
end
end
lib/gitlab/instrumentation/redis.rb
View file @
357fb56c
...
...
@@ -8,9 +8,8 @@ module Gitlab
Cache
=
Class
.
new
(
RedisBase
).
enable_redis_cluster_validation
Queues
=
Class
.
new
(
RedisBase
)
SharedState
=
Class
.
new
(
RedisBase
).
enable_redis_cluster_validation
TraceChunks
=
Class
.
new
(
RedisBase
).
enable_redis_cluster_validation
STORAGES
=
[
ActionCable
,
Cache
,
Queues
,
SharedState
,
TraceChunks
].
freeze
STORAGES
=
[
ActionCable
,
Cache
,
Queues
,
SharedState
].
freeze
# Milliseconds represented in seconds (from 1 millisecond to 2 seconds).
QUERY_TIME_BUCKETS
=
[
0.001
,
0.0025
,
0.005
,
0.01
,
0.025
,
0.05
,
0.1
,
0.25
,
0.5
,
1
,
2
].
freeze
...
...
lib/gitlab/redis/trace_chunks.rb
deleted
100644 → 0
View file @
a61676b6
# frozen_string_literal: true
module
Gitlab
module
Redis
class
TraceChunks
<
::
Gitlab
::
Redis
::
Wrapper
# The data we store on TraceChunks used to be stored on SharedState.
def
self
.
config_fallback
SharedState
end
end
end
end
lib/gitlab/redis/wrapper.rb
View file @
357fb56c
...
...
@@ -64,19 +64,8 @@ module Gitlab
def
config_file_name
[
# Instance specific config sources:
ENV
[
"GITLAB_REDIS_
#{
store_name
.
underscore
.
upcase
}
_CONFIG_FILE"
],
config_file_path
(
"redis.
#{
store_name
.
underscore
}
.yml"
),
# The current Redis instance may have been split off from another one
# (e.g. TraceChunks was split off from SharedState). There are
# installations out there where the lowest priority config source
# (resque.yml) contains bogus values. In those cases, config_file_name
# should resolve to the instance we originated from (the
# "config_fallback") rather than resque.yml.
config_fallback
&
.
config_file_name
,
# Global config sources:
ENV
[
'GITLAB_REDIS_CONFIG_FILE'
],
config_file_path
(
'resque.yml'
)
].
compact
.
first
...
...
@@ -86,10 +75,6 @@ module Gitlab
name
.
demodulize
end
def
config_fallback
nil
end
def
instrumentation_class
"::Gitlab::Instrumentation::Redis::
#{
store_name
}
"
.
constantize
end
...
...
scripts/prepare_build.sh
View file @
357fb56c
...
...
@@ -42,9 +42,6 @@ sed -i 's|url:.*$|url: redis://redis:6379/11|g' config/redis.queues.yml
cp
config/redis.shared_state.yml.example config/redis.shared_state.yml
sed
-i
's|url:.*$|url: redis://redis:6379/12|g'
config/redis.shared_state.yml
cp
config/redis.trace_chunks.yml.example config/redis.trace_chunks.yml
sed
-i
's|url:.*$|url: redis://redis:6379/13|g'
config/redis.trace_chunks.yml
if
[
"
$SETUP_DB
"
!=
"false"
]
;
then
setup_db
elif
getent hosts postgres
;
then
...
...
spec/lib/gitlab/health_checks/redis/trace_chunks_check_spec.rb
deleted
100644 → 0
View file @
a61676b6
# frozen_string_literal: true
require
'spec_helper'
require_relative
'../simple_check_shared'
RSpec
.
describe
Gitlab
::
HealthChecks
::
Redis
::
TraceChunksCheck
do
include_examples
'simple_check'
,
'redis_trace_chunks_ping'
,
'RedisTraceChunks'
,
'PONG'
end
spec/lib/gitlab/instrumentation/redis_spec.rb
View file @
357fb56c
...
...
@@ -68,8 +68,7 @@ RSpec.describe Gitlab::Instrumentation::Redis do
.
to
contain_exactly
(
details_row
.
merge
(
storage:
'ActionCable'
),
details_row
.
merge
(
storage:
'Cache'
),
details_row
.
merge
(
storage:
'Queues'
),
details_row
.
merge
(
storage:
'SharedState'
),
details_row
.
merge
(
storage:
'TraceChunks'
))
details_row
.
merge
(
storage:
'SharedState'
))
end
end
end
spec/lib/gitlab/redis/trace_chunks_spec.rb
deleted
100644 → 0
View file @
a61676b6
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Gitlab
::
Redis
::
TraceChunks
do
let
(
:instance_specific_config_file
)
{
"config/redis.trace_chunks.yml"
}
let
(
:environment_config_file_name
)
{
"GITLAB_REDIS_TRACE_CHUNKS_CONFIG_FILE"
}
let
(
:shared_state_config_file
)
{
nil
}
before
do
allow
(
Gitlab
::
Redis
::
SharedState
).
to
receive
(
:config_file_name
).
and_return
(
shared_state_config_file
)
end
include_examples
"redis_shared_examples"
describe
'.config_file_name'
do
subject
{
described_class
.
config_file_name
}
let
(
:rails_root
)
{
Dir
.
mktmpdir
(
'redis_shared_examples'
)
}
before
do
# Undo top-level stub of config_file_name because we are testing that method now.
allow
(
described_class
).
to
receive
(
:config_file_name
).
and_call_original
allow
(
described_class
).
to
receive
(
:rails_root
).
and_return
(
rails_root
)
FileUtils
.
mkdir_p
(
File
.
join
(
rails_root
,
'config'
))
end
after
do
FileUtils
.
rm_rf
(
rails_root
)
end
context
'when there is only a resque.yml'
do
before
do
FileUtils
.
touch
(
File
.
join
(
rails_root
,
'config/resque.yml'
))
end
it
{
expect
(
subject
).
to
eq
(
"
#{
rails_root
}
/config/resque.yml"
)
}
context
'and there is a global env override'
do
before
do
stub_env
(
'GITLAB_REDIS_CONFIG_FILE'
,
'global override'
)
end
it
{
expect
(
subject
).
to
eq
(
'global override'
)
}
context
'and SharedState has a different config file'
do
let
(
:shared_state_config_file
)
{
'shared state config file'
}
it
{
expect
(
subject
).
to
eq
(
'shared state config file'
)
}
end
end
end
end
end
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