Skip to content

Establish migration strategy for Sessions workload

To support migration for Redis Sessions, we'll need to rollout 3 MRs below:

  1. Support rollback from the new CacheStore to RedisStore. MR gitlab-org/gitlab!176876 (merged). In this MR, the old RedisStore supports reading an ActiveSupport::Cache::Entry object which is introduced in MR 2. In the scenario of rollback/revert of MR 2, new session data can still be read by the application.
  2. Support rollforward from the old RedisStore to CacheStore. MR gitlab-org/gitlab!176108 (merged). This MR changes the session store implementation and support reading the old session data from RedisStore.
  3. Add MultiStore which actually does the dual-writing. MR gitlab-org/gitlab!175735 (merged).

More context can be found at #35 (comment 2278902354).

Once we roll out MR 2, sessions data in the new CacheStore will be written in a new format. The MRs above are laid out in a way that we could revert the MR from 2 -> 1 or 3 -> 2.

Rollout of MR 2 requires updating environment variable USE_REDIS_CACHE_STORE_AS_SESSION_STORE. We couldn't use FF here because the session store is configured at initializer.

Rollout plan

We'll separate the CR for enabling the env var and the actual migration with MultiStore as below.

Pre: We've cancelled rolling out on pre because pre release only happens once a month.

  1. CR for enabling USE_REDIS_CACHE_STORE_AS_SESSION_STORE gitlab-com/gl-infra/production#19149 (closed)
  2. CR for configuring application to use the Redis Cluster gitlab-com/gl-infra/production#19150 (closed)

Staging:

  1. CR for enabling USE_REDIS_CACHE_STORE_AS_SESSION_STORE gitlab-com/gl-infra/production#19142 (closed)
  2. CR for configuring application to use the Redis Cluster gitlab-com/gl-infra/production#19171 (closed)

Prod:

  1. CR for enabling USE_REDIS_CACHE_STORE_AS_SESSION_STORE gitlab-com/gl-infra/production#19144 (closed)
  2. CR for configuring application to use the Redis Cluster gitlab-com/gl-infra/production#19252 (closed)

Issue from previous migration: https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/2858

Edited by Marco Gregorius
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information