Skip to content

Dry up adding a redis shard

Bob Van Landuyt requested to merge bvl-dry-up-adding-redis-shards into master

What does this MR do and why?

This makes the new constant a single source of truth for a new Redis instance.

This makes sure we only need to add a new subclass of Gitlab::Redis::Wrapper to define a new redis instance and add it to this constant.

This will automatically add the instrumentation for the new redis instance and add health checks for it to the readiness & liveliness endpoints.

Doing so will also automatically generate the right spec helpers for clearing the instance when needed.

This also a health check constant for each Redis instance dynamically. The constant is named Gitlab::HealthChecks::Redis::<IntanceName>Check. For example Gitlab::HealthChecks::Redis::SharedStateCheck.

The health checks are used from the HealthController which is hit by kubernetes configured in our helm charts.

All of this is to make it easier to add a new Redis shard, an example in !95064 (closed) shows that we only need to add the class, load it from application.rb and write the documentation what the redis instance will hold

For gitlab-com/gl-infra/scalability#1820 (closed)

Edited by Bob Van Landuyt

Merge request reports