Skip to content

Add ClusterRateLimiting for Redis Cluster migration

What does this MR do and why?

This MR adds Gitlab::Redis::ClusterRateLimiting which contains a MultiStore object of primary: ClusterRateLimiting (reads config/redis.cluster_rate_limiting.yml) and secondary: RateLimiting.

Only 2 components use Gitlab::Redis::RateLimiting:

  1. Gitlab::ApplicationRateLimiter::BaseStrategy: update with_redis to toggle between 2 stores via feature flag
  2. Gitlab::RackAttack::InstrumentedCacheStore via a Rails.cache store: Define RateLimitingMigrator and create RedisCacheStore using it

Why: Scalability team is migrating rate-limiting operations from redis-ratelimiting (redis sentinel) to a Redis Cluster setup.

See issue for more info: gitlab-com/gl-infra/scalability#2036

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Sylvester Chin

Merge request reports

Loading