Skip to content
代码片段 群组 项目
未验证 提交 62c8cb57 编辑于 作者: Eugie Limpin's avatar Eugie Limpin 提交者: GitLab
浏览文件

Merge branch 'mg-cleanup-redis-cluster-sessions-migration-helper' into 'master'

Remove Gitlab::Redis::ClusterSessions post migration

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181631



Merged-by: default avatarEugie Limpin <elimpin@gitlab.com>
Approved-by: default avatarDaniyal Arshad <darshad@gitlab.com>
Approved-by: default avatarEugie Limpin <elimpin@gitlab.com>
Reviewed-by: default avatarEugie Limpin <elimpin@gitlab.com>
Co-authored-by: default avatarGregorius Marco <gmarco@gitlab.com>
No related branches found
No related tags found
无相关合并请求
---
name: use_primary_and_secondary_stores_for_sessions
feature_issue_url: https://gitlab.com/gitlab-com/gl-infra/data-access/durability/team/-/issues/28
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/175735
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/509337
milestone: '17.9'
group: group::durability
type: gitlab_com_derisk
default_enabled: false
---
name: use_primary_store_as_default_for_sessions
feature_issue_url: https://gitlab.com/gitlab-com/gl-infra/data-access/durability/team/-/issues/28
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/175735
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/509338
milestone: '17.9'
group: group::durability
type: gitlab_com_derisk
default_enabled: false
......@@ -10,7 +10,6 @@ module Redis
ALL_CLASSES = [
Gitlab::Redis::BufferedCounter,
Gitlab::Redis::Cache,
Gitlab::Redis::ClusterSessions,
Gitlab::Redis::DbLoadBalancing,
Gitlab::Redis::FeatureFlag,
*Gitlab::Redis::Queues.instances.values, # dynamically adds QueueShard* classes
......
# frozen_string_literal: true
module Gitlab
module Redis
class ClusterSessions < ::Gitlab::Redis::Wrapper
class << self
# The data we store on Sessions used to be stored on SharedState.
def config_fallback
SharedState
end
end
end
end
end
......@@ -2,7 +2,7 @@
module Gitlab
module Redis
class Sessions < ::Gitlab::Redis::MultiStoreWrapper
class Sessions < ::Gitlab::Redis::Wrapper
SESSION_NAMESPACE = 'session:gitlab'
USER_SESSIONS_NAMESPACE = 'session:user:gitlab'
USER_SESSIONS_LOOKUP_NAMESPACE = 'session:lookup:user:gitlab'
......@@ -13,10 +13,6 @@ class Sessions < ::Gitlab::Redis::MultiStoreWrapper
def self.config_fallback
SharedState
end
def self.multistore
MultiStore.create_using_pool(ClusterSessions.pool, pool, store_name)
end
end
end
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Redis::ClusterSessions, feature_category: :scalability do
include_examples "redis_new_instance_shared_examples", 'cluster_sessions', Gitlab::Redis::SharedState
end
......@@ -3,7 +3,6 @@
require 'spec_helper'
RSpec.describe Gitlab::Redis::Sessions, feature_category: :shared do
include_examples "multi_store_wrapper_shared_examples"
include_examples "redis_new_instance_shared_examples", 'sessions', Gitlab::Redis::SharedState
describe '#store' do
......@@ -14,9 +13,4 @@
expect([::Redis::Store, ::Gitlab::Redis::ClusterStore].include?(store.class)).to eq(true)
end
end
it 'migrates from self to ClusterSessions' do
expect(described_class.multistore.secondary_pool).to eq(described_class.pool)
expect(described_class.multistore.primary_pool).to eq(Gitlab::Redis::ClusterSessions.pool)
end
end
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册